/*
Theme Name: Muhammad Rahmat
Theme URI: https://muhammadrahmat.com
Author: Muhammad Rahmat
Description: Tema portal berita dan opini dengan tampilan hijau-emas yang profesional.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: muhammadrahmat
*/

/* ==========================================================================
   1. VARIABEL WARNA & DASAR
   ========================================================================== */
:root {
    --brand-50:  #f0fdf4;
    --brand-100: #dcfce7;
    --brand-200: #bbf7d0;
    --brand-500: #22c55e;
    --brand-600: #15803d;
    --brand-700: #166534;
    --brand-800: #14532d;
    --brand-900: #0f3d21;
    --gold-400:  #e8c660;
    --gold-500:  #d4a931;
    --gold-600:  #b8891a;
    --ink:       #1e293b;
    --muted:     #64748b;
    --line:      #e2e8f0;
    --bg:        #f8fafc;
    --radius:    .75rem;
    --shadow:    0 4px 14px -4px rgba(15, 61, 33, .18);
    --shadow-lg: 0 18px 40px -12px rgba(15, 61, 33, .30);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 130px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

img, video, iframe, svg { max-width: 100%; height: auto; }

a { color: var(--brand-700); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--gold-600); }

::selection { background: var(--gold-400); color: var(--brand-900); }

:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; border-radius: 4px; }

/* ==========================================================================
   2. HEADER (pelengkap header.php)
   ========================================================================== */
/* Header menempel di bawah toolbar admin WordPress saat login */
body.admin-bar #site-header { top: 32px; }
body.admin-bar #read-progress { top: 32px; }
@media screen and (max-width: 782px) {
    body.admin-bar #site-header { top: 46px; }
    body.admin-bar #read-progress { top: 46px; }
}
/* Toolbar admin tidak ikut menempel di layar kecil */
@media screen and (max-width: 600px) {
    body.admin-bar #site-header { top: 0; }
    body.admin-bar #read-progress { top: 0; }
}

/* ==========================================================================
   3. JUDUL HALAMAN / ARSIP
   ========================================================================== */
.page-header,
.archive-header,
.page-title-wrap {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 5px solid var(--gold-500);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.page-title,
.archive-title {
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--brand-800);
    text-transform: uppercase;
    letter-spacing: .02em;
}

.archive-description { margin: .4rem 0 0; color: var(--muted); font-size: .9rem; }

/* ==========================================================================
   4. KARTU ARTIKEL (daftar berita)
   ========================================================================== */
article.post,
article.page,
.post-card,
.hentry {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform .25s ease, box-shadow .25s ease;
}

.post-card:hover,
.archive article.post:hover,
.blog article.post:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.post-thumbnail img,
.wp-post-image { width: 100%; height: auto; display: block; object-fit: cover; }

.entry-header { padding: 1.25rem 1.5rem 0; }

.entry-title {
    margin: 0 0 .5rem;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--brand-900);
}
.entry-title a { color: inherit; }
.entry-title a:hover { color: var(--brand-600); }

.entry-meta,
.posted-on,
.byline {
    font-size: .78rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .9rem;
}

.cat-links a,
.tags-links a {
    display: inline-block;
    background: var(--brand-100);
    color: var(--brand-700);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .2rem .6rem;
    border-radius: 999px;
    margin: 0 .3rem .3rem 0;
}
.cat-links a:hover,
.tags-links a:hover { background: var(--gold-500); color: var(--brand-900); }

.entry-summary,
.entry-content { padding: 1rem 1.5rem 1.5rem; }

.more-link,
.read-more,
a.button,
button.button,
input[type="submit"],
.wp-block-button__link {
    display: inline-block;
    background: var(--brand-700);
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    padding: .65rem 1.3rem;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}
.more-link:hover,
.read-more:hover,
a.button:hover,
button.button:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover {
    background: var(--gold-500);
    color: var(--brand-900);
    transform: translateY(-1px);
}

/* ==========================================================================
   5. ISI ARTIKEL (single post & halaman)
   ========================================================================== */
.entry-content { font-size: 1.05rem; }
.entry-content > * + * { margin-top: 1.1em; }

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--brand-800);
    line-height: 1.3;
    margin-top: 1.8em;
}
.entry-content h2 { font-size: 1.6rem; border-bottom: 3px solid var(--gold-500); padding-bottom: .3rem; display: inline-block; }
.entry-content h3 { font-size: 1.35rem; }
.entry-content h4 { font-size: 1.15rem; }

.entry-content a { color: var(--brand-600); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:hover { color: var(--gold-600); }

.entry-content ul,
.entry-content ol { padding-left: 1.5rem; }
.entry-content li { margin-bottom: .35em; }
.entry-content ul li::marker { color: var(--gold-500); }

blockquote,
.wp-block-quote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--brand-50);
    border-left: 5px solid var(--gold-500);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--brand-800);
}
blockquote p:last-child { margin-bottom: 0; }

pre, code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .9em;
}
code { background: var(--brand-50); padding: .15em .4em; border-radius: .3rem; }
pre {
    background: var(--brand-900);
    color: #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
}
pre code { background: transparent; padding: 0; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { border: 1px solid var(--line); padding: .6rem .8rem; text-align: left; }
th { background: var(--brand-700); color: #fff; }
tr:nth-child(even) td { background: var(--brand-50); }

hr { border: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold-500), transparent); margin: 2rem 0; }

/* ==========================================================================
   6. KELAS BAWAAN WORDPRESS
   ========================================================================== */
.alignleft   { float: left;  margin: .3rem 1.5rem 1rem 0; }
.alignright  { float: right; margin: .3rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide   { max-width: 100%; }

.wp-caption { max-width: 100%; }
.wp-caption-text,
figcaption { font-size: .8rem; color: var(--muted); text-align: center; padding-top: .4rem; }

.screen-reader-text {
    border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
    height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
    position: absolute !important; word-wrap: normal !important;
}
.screen-reader-text:focus {
    background: #fff; clip: auto !important; clip-path: none; color: var(--brand-800);
    display: block; font-weight: 700; height: auto; width: auto; padding: 1rem 1.5rem;
    left: 5px; top: 5px; z-index: 100000;
}

.sticky .entry-title::before { content: "★ "; color: var(--gold-500); }
.gallery { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gallery-item { margin: 0; }
.bypostauthor { display: block; }

/* ==========================================================================
   7. PAGINASI
   ========================================================================== */
.pagination,
.nav-links,
.posts-navigation,
.post-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: center;
    margin: 2rem 0;
}

.page-numbers,
.nav-previous a,
.nav-next a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 .9rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-weight: 600;
    font-size: .85rem;
    color: var(--brand-700);
}
.page-numbers:hover,
.nav-previous a:hover,
.nav-next a:hover { background: var(--brand-100); }
.page-numbers.current { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }

/* ==========================================================================
   8. SIDEBAR & WIDGET
   ========================================================================== */
.widget {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.widget img { max-width: 100%; height: auto; border-radius: .5rem; }

.widget-title,
.widgettitle {
    margin: 0 0 1rem;
    padding-bottom: .6rem;
    font-size: .95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--brand-800);
    border-bottom: 3px solid var(--gold-500);
}

.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: .5rem 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.widget li:last-child { border-bottom: 0; }
.widget li a { color: var(--ink); }
.widget li a:hover { color: var(--brand-600); }

/* ==========================================================================
   9. FORMULIR & PENCARIAN
   ========================================================================== */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: .7rem 1rem;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    font: inherit;
    color: var(--ink);
    transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus,
textarea:focus,
select:focus {
    outline: 0;
    border-color: var(--brand-600);
    box-shadow: 0 0 0 3px var(--brand-200);
}
textarea { min-height: 140px; resize: vertical; }
label { font-weight: 600; font-size: .9rem; }

/* ==========================================================================
   10. KOMENTAR
   ========================================================================== */
.comments-area {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 2rem;
}
.comments-title,
.comment-reply-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    color: var(--brand-800);
    margin-top: 0;
}
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list .children { list-style: none; padding-left: 1.5rem; border-left: 3px solid var(--brand-100); }
.comment-body { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.comment-author .avatar { border-radius: 999px; margin-right: .6rem; vertical-align: middle; }
.comment-metadata { font-size: .75rem; color: var(--muted); }
.reply a { font-size: .8rem; font-weight: 700; color: var(--brand-600); }

/* ==========================================================================
   11. FOOTER (pelengkap footer.php)
   ========================================================================== */
footer ul { list-style: none; margin: 0; padding: 0; }
footer a { transition: color .2s ease; }
footer .menu li { margin-bottom: .4rem; }
footer .menu a { color: #cbd5e1; }
footer .menu a:hover { color: #fff; padding-left: .25rem; }

/* ==========================================================================
   12. TOMBOL KEMBALI KE ATAS & UTILITAS
   ========================================================================== */
.text-balance { text-wrap: balance; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ==========================================================================
   13. RESPONSIF
   ========================================================================== */
@media (max-width: 768px) {
    .entry-title { font-size: 1.35rem; }
    .entry-header { padding: 1rem 1rem 0; }
    .entry-summary,
    .entry-content { padding: .75rem 1rem 1.25rem; font-size: 1rem; }
    .page-title,
    .archive-title { font-size: 1.2rem; }
    .alignleft,
    .alignright { float: none; display: block; margin: 1rem auto; }
    .widget { padding: 1rem; }
}

/* ==========================================================================
   14. MODE CETAK
   ========================================================================== */
@media print {
    #site-header, footer, #read-progress, .widget, .comments-area, .pagination { display: none !important; }
    body { background: #fff; color: #000; }
    a { color: #000; text-decoration: underline; }
}

/* Hormati preferensi pengguna yang mengurangi animasi */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}