:root {
    --bg: #f5f0e6;
    --bg-card: #fdfaf3;
    --bg-alt: #faf8f2;
    --bg-input: #ffffff;
    --bg-placeholder: #e9e5d8;
    --text: #1a1a1a;
    --text-soft: #4a4638;
    --text-muted: #6b7280;
    --text-faint: #8a8578;
    --border: #e3e0d5;
    --border-strong: #1a1a1a;
    --input-border: #d1cdbf;
    --accent: #a93226;
    --shadow: rgba(0, 0, 0, .12);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #14181f;
        --bg-card: #1c212b;
        --bg-alt: #242a35;
        --bg-input: #1c212b;
        --bg-placeholder: #2a303c;
        --text: #e8e6e0;
        --text-soft: #c9c6bd;
        --text-muted: #9aa0ab;
        --text-faint: #7d8390;
        --border: #2d3340;
        --border-strong: #3a4150;
        --input-border: #3a4150;
        --accent: #e2685c;
        --shadow: rgba(0, 0, 0, .4);
    }
}

:root[data-theme="dark"] {
    --bg: #14181f;
    --bg-card: #1c212b;
    --bg-alt: #242a35;
    --bg-input: #1c212b;
    --bg-placeholder: #2a303c;
    --text: #e8e6e0;
    --text-soft: #c9c6bd;
    --text-muted: #9aa0ab;
    --text-faint: #7d8390;
    --border: #2d3340;
    --border-strong: #3a4150;
    --input-border: #3a4150;
    --accent: #e2685c;
    --shadow: rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); transition: background-color .2s, color .2s; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; }

.coming-soon { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.coming-soon h1 { font-size: 3rem; margin-bottom: .25rem; }
.coming-soon h1 span { color: var(--accent); }
.coming-soon p { margin: .25rem 0; }
.coming-soon__note { color: var(--text-muted); font-size: .9rem; margin-top: 1rem; }

/* Header */
.site-header { background: var(--bg-card); border-bottom: 2px solid var(--border-strong); position: sticky; top: 0; z-index: 20; }
.site-header__top { position: relative; max-width: 1180px; margin: 0 auto; padding: 1rem 1.25rem .5rem; display: flex; align-items: center; gap: 1rem; }
.site-brand { display: inline-flex; align-items: center; font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; font-size: 1.8rem; font-weight: 700; letter-spacing: -.5px; margin-right: auto; color: var(--text); }
.site-brand span { color: var(--accent); }
.site-brand__logo { height: 40px; width: auto; max-width: 200px; object-fit: contain; }
.footer-col--brand .site-brand { margin-right: 0; font-size: 1.5rem; }
.footer-col--brand .site-brand__logo { height: 32px; }

/* Hamburger (mobile only) */
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 4px; width: 34px; height: 34px; border: 1px solid var(--input-border); border-radius: 6px; background: var(--bg-input); cursor: pointer; padding: 0; flex-shrink: 0; }
.nav-toggle span { display: block; width: 16px; height: 2px; background: var(--text); margin: 0 auto; }

/* Grup ikon aksi header: sosmed, dark mode, cari */
.site-header__actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--input-border); border-radius: 50%; background: var(--bg-input); cursor: pointer; color: var(--text-soft); flex-shrink: 0; padding: 0; }
.icon-btn svg { width: 17px; height: 17px; fill: currentColor; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.social-icon { border-color: transparent; background: none; }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .icon-sun { display: none; }
    :root:not([data-theme="light"]) .icon-moon { display: block; }
}

.search-box { position: relative; width: 320px; max-width: 45vw; display: none; align-items: center; gap: .5rem; }
.search-box.is-open { display: flex; }
.search-box__icon { color: var(--text-faint); flex-shrink: 0; }
.search-box__input { flex: 1; min-width: 0; padding: .55rem .8rem; border: 1px solid var(--input-border); border-radius: 20px; font-size: .9rem; background: var(--bg-input); color: var(--text); }
.search-box__input:focus { outline: none; border-color: var(--accent); }
.search-close { display: none; }

.search-dropdown { position: absolute; top: calc(100% + 6px); right: 0; width: 340px; max-width: 80vw; background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 28px var(--shadow); overflow: hidden; z-index: 30; }
.search-dropdown__header { padding: .6rem .9rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); background: var(--bg-alt); border-bottom: 1px solid var(--border); }
.search-dropdown__loading, .search-dropdown__empty { padding: .9rem; font-size: .85rem; color: var(--text-muted); }

.search-skeleton-row { display: flex; flex-direction: column; gap: .4rem; padding: .65rem .9rem; border-bottom: 1px solid var(--border); }
.search-skeleton-line { display: block; height: .7rem; border-radius: 4px; background-image: linear-gradient(100deg, var(--bg-placeholder) 8%, rgba(255,255,255,.4) 18%, var(--bg-placeholder) 33%); background-size: 200% 100%; animation: lazy-shimmer 1.5s ease-in-out infinite; }
.search-skeleton-line--title { width: 80%; }
.search-skeleton-line--meta { width: 45%; height: .55rem; }
.search-dropdown__item { display: flex; flex-direction: column; gap: .15rem; padding: .6rem .9rem; border-bottom: 1px solid var(--border); }
.search-dropdown__item:hover { background: var(--bg-alt); }
.search-dropdown__item-title { font-size: .88rem; font-weight: 600; color: var(--text); }
.search-dropdown__item-meta { font-size: .75rem; color: var(--text-faint); }
.search-dropdown__seeall { display: block; padding: .65rem .9rem; font-size: .82rem; text-align: center; color: var(--accent); font-weight: 600; background: var(--bg-alt); }

/* Ketika search dibuka lewat ikon (desktop & mobile), tampil sebagai dropdown/overlay di bawah header */
.search-box.is-open {
    position: absolute; top: 100%; right: 0; left: auto;
    background: var(--bg-card); padding: .75rem 1rem;
    border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 12px 28px var(--shadow);
    z-index: 25;
}

/* Nav (desktop: inline row + "Lainnya" dropdown; mobile: hamburger panel) */
.site-nav { max-width: 1180px; margin: 0 auto; padding: .4rem 1.25rem .7rem; display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.site-nav a { font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-soft); white-space: nowrap; }
.site-nav a:hover { color: var(--accent); }

.nav-more { position: relative; }
.nav-more__toggle { display: inline-flex; align-items: center; gap: .3rem; background: none; border: none; cursor: pointer; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-soft); font-family: inherit; padding: 0; }
.nav-more__toggle:hover { color: var(--accent); }
.nav-more__caret { font-size: .7rem; }
.nav-more__dropdown { display: none; position: absolute; top: calc(100% + 10px); left: 0; min-width: 180px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 28px var(--shadow); flex-direction: column; padding: .4rem 0; z-index: 30; }
.nav-more.is-open .nav-more__dropdown { display: flex; }
.nav-more__dropdown a { padding: .5rem 1rem; }
.nav-more__dropdown a:hover { background: var(--bg-alt); }

@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .site-nav { display: none; flex-direction: column; align-items: stretch; gap: 0; padding: .25rem 1.25rem .75rem; }
    .site-nav.is-open { display: flex; }
    .site-nav a { padding: .55rem 0; border-bottom: 1px solid var(--border); }

    .nav-more__toggle { display: none; }
    .nav-more__dropdown { display: flex; position: static; box-shadow: none; border: none; padding: 0 0 0 .75rem; }

    .site-header__actions .social-icon { display: none; }

    .search-box.is-open {
        position: absolute; top: 100%; left: 0; right: 0;
        width: auto; max-width: none; border-radius: 0;
        border-left: none; border-right: none;
    }
    .search-close { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: none; background: none; font-size: 1.4rem; line-height: 1; color: var(--text-muted); cursor: pointer; flex-shrink: 0; }
    .search-dropdown { left: 0; right: 0; width: auto; max-width: none; }
}

/* Layout */
.site-main { max-width: 1180px; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }
.home-grid { display: grid; grid-template-columns: 2.4fr 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 860px) { .home-grid { grid-template-columns: 1fr; } }

.label-category { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin-bottom: .35rem; }
.label-category:hover { text-decoration: underline; }
.label-category-group { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .35rem; }
.label-category-group .label-category { margin-bottom: 0; }

.baca-juga { display: flex; flex-direction: column; gap: .4rem; background: var(--bg-alt); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: .9rem 1.1rem; margin: 1rem 0; }
.baca-juga__label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.baca-juga__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.baca-juga__list a { font-size: .9rem; font-weight: 600; color: var(--text); }
.baca-juga__list a:hover { color: var(--accent); }
.byline { font-size: .78rem; color: var(--text-faint); }
.section-title { font-size: 1.1rem; margin: 2rem 0 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.page-title { font-size: 1.8rem; margin-bottom: .3rem; }
.page-desc { color: var(--text-muted); margin-top: 0; }
.empty-state { color: var(--text-faint); font-style: italic; }

.headline-card h1 { font-size: 2rem; line-height: 1.2; margin: .3rem 0; }
.headline-card p { color: var(--text-soft); }
/* Skeleton shimmer — tampil selagi gambar (lazy-loaded) belum selesai dimuat */
.lazy-img { background-image: linear-gradient(100deg, var(--bg-placeholder) 8%, rgba(255,255,255,.4) 18%, var(--bg-placeholder) 33%); background-size: 200% 100%; animation: lazy-shimmer 1.5s ease-in-out infinite; }
.lazy-img.is-loaded { animation: none; background-image: none; }
@keyframes lazy-shimmer { 0% { background-position-x: 180%; } 100% { background-position-x: -20%; } }

.headline-card__img { width: 100%; height: 340px; object-fit: cover; border-radius: 8px; margin: .75rem 0; background: var(--bg-placeholder); }

.article-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin-top: 1.5rem; }
@media (max-width: 600px) { .article-grid { grid-template-columns: 1fr; } }
.article-card__img { width: 100%; height: 150px; object-fit: cover; border-radius: 6px; background: var(--bg-placeholder); margin-bottom: .5rem; }
.article-card h3 { font-size: 1rem; margin: .2rem 0; }
.article-card p { margin: .2rem 0; color: var(--text-soft); font-size: .85rem; }

.article-list { display: flex; flex-direction: column; gap: 1.25rem; }
.article-row { display: flex; gap: 1rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.article-row__img { width: 140px; height: 96px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: var(--bg-placeholder); }
.article-row h3 { font-size: 1.05rem; margin: 0 0 .3rem; }
.article-row p { margin: .2rem 0; color: var(--text-soft); font-size: .9rem; }

/* Ad slots (placeholder — konten sungguhan ditarik dari admin panel jika ada iklan aktif) */
.ad-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; border: 1px dashed var(--input-border); border-radius: 8px; background: var(--bg-alt); color: var(--text-faint); margin-bottom: 1.25rem; }
.ad-slot__label { font-size: .7rem; font-weight: 700; letter-spacing: .08em; }
.ad-slot__dim { font-size: .7rem; }
.ad-slot--square { width: 100%; aspect-ratio: 1 / 1; }
.ad-slot--banner { width: 100%; height: 90px; margin-top: 2rem; margin-bottom: 0; }
.ad-slot--top { margin-top: 0; margin-bottom: 1.75rem; }
.ad-slot--filled { display: block; border: none; background: none; padding: 0; overflow: hidden; }
.ad-slot--filled img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }

.home-sidebar { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; }
.popular-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .9rem; }
.popular-list li { display: flex; flex-direction: column; }
.popular-list__rank { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; color: var(--accent); font-size: .85rem; }
.popular-list a { font-size: .9rem; font-weight: 600; }
.popular-list a:hover { color: var(--accent); }
.popular-list__views { font-size: .72rem; color: var(--text-faint); }

.breadcrumb { font-size: .8rem; color: var(--text-faint); margin-bottom: .75rem; }
.breadcrumb a:hover { color: var(--accent); }

.share-buttons { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 1rem 0 1.5rem; }
.share-buttons__label { font-size: .8rem; color: var(--text-muted); font-weight: 600; }
.share-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .9rem; border-radius: 20px; font-size: .82rem; font-weight: 600; border: 1px solid transparent; cursor: pointer; font-family: inherit; line-height: 1; transition: opacity .15s; }
.share-btn:hover { opacity: .88; }
.share-btn svg { width: 15px; height: 15px; fill: currentColor; flex-shrink: 0; }
.share-btn--facebook { background: #1877f2; color: #fff; }
.share-btn--whatsapp { background: #25d366; color: #fff; }
.share-btn--copy { background: var(--bg-input); color: var(--text-soft); border-color: var(--input-border); }
.share-btn--copy.is-copied { background: #1e7d3c; color: #fff; border-color: #1e7d3c; }

.article-detail h1 { font-size: 1.9rem; line-height: 1.25; margin: .4rem 0 .6rem; }
.article-detail__excerpt { font-size: 1.05rem; color: var(--text-soft); margin: 0 0 .5rem; }
.article-detail__figure { margin: 1rem 0; }
.article-detail__figure img { width: 100%; max-height: 420px; object-fit: cover; border-radius: 8px; background: var(--bg-placeholder); }
.article-detail__content { font-size: 1.02rem; line-height: 1.75; color: var(--text); }
.article-detail__content p { margin: 0 0 1.1rem; }
.article-detail__content img { max-width: 100%; border-radius: 6px; }
.article-detail__source { font-size: .8rem; color: var(--text-faint); margin-top: 1rem; }

.pagination { display: flex; gap: .4rem; margin-top: 1.75rem; }
.pagination a { padding: .4rem .75rem; border: 1px solid var(--border); border-radius: 6px; font-size: .85rem; }
.pagination a.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Footer */
.site-footer { background: var(--bg-card); border-top: 1px solid var(--border); margin-top: 2rem; }
.site-footer__inner { max-width: 1180px; margin: 0 auto; padding: 2.5rem 1.25rem 2rem; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
@media (max-width: 860px) { .site-footer__inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .site-footer__inner { grid-template-columns: 1fr; } }

.footer-col { display: flex; flex-direction: column; gap: .55rem; }
.footer-col h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 0 0 .3rem; }
.footer-col a { font-size: .88rem; color: var(--text-soft); }
.footer-col a:hover { color: var(--accent); }
.footer-col p { font-size: .85rem; color: var(--text-soft); margin: 0; }
.footer-col--brand p { color: var(--text-muted); font-size: .85rem; }

.footer-social { display: flex; gap: .6rem; margin-top: .4rem; }
.footer-social a { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); color: var(--text-soft); }
.footer-social a svg { width: 16px; height: 16px; fill: currentColor; }
.footer-social a:hover { color: var(--accent); border-color: var(--accent); }

.site-footer__bottom { border-top: 1px solid var(--border); text-align: center; padding: 1.1rem; }
.site-footer__bottom p { margin: 0; font-size: .78rem; color: var(--text-faint); }

/* Halaman statis */
.static-page .article-detail__content { margin-top: 1rem; }

/* Komentar */
.comments-section { margin-top: 2rem; }
.alert { padding: .65rem .9rem; border-radius: 8px; font-size: .85rem; margin-bottom: 1rem; }
.alert--error { background: #fdecea; color: #b3261e; border: 1px solid #f5c2bd; }
.alert--success { background: #e3f5e9; color: #1e7d3c; border: 1px solid #b7e4c7; }

.hp-field { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }

.comment-form { display: flex; flex-direction: column; gap: .8rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem; margin-bottom: 1.5rem; }
.comment-form label { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; color: var(--text-muted); }
.comment-form__row { display: flex; gap: .8rem; flex-wrap: wrap; }
.comment-form__row label { flex: 1; min-width: 160px; }
.comment-form input, .comment-form textarea { padding: .5rem .7rem; border: 1px solid var(--input-border); border-radius: 6px; font-size: .9rem; font-family: inherit; background: var(--bg-input); color: var(--text); }
.comment-form textarea { resize: vertical; }
.btn-comment-submit { align-self: flex-start; background: var(--accent); color: #fff; border: none; padding: .55rem 1.2rem; border-radius: 20px; font-size: .85rem; font-weight: 600; cursor: pointer; }
.btn-comment-submit:hover { opacity: .9; }

.comment-list { display: flex; flex-direction: column; gap: 1.25rem; }
.comment { border-bottom: 1px solid var(--border); padding-bottom: 1.1rem; }
.comment__body { display: flex; gap: .8rem; align-items: flex-start; }
.comment__main { flex: 1; min-width: 0; }
.comment__avatar {
    flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent); color: #fff; font-weight: 700; font-size: 1rem;
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
}
.comment__avatar--reply {
    width: 28px; height: 28px; font-size: .8rem;
    background: var(--bg-input); color: var(--text-muted); border: 1px solid var(--border);
}
.comment__header { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .3rem; }
.comment__name { font-weight: 700; font-size: .9rem; }
.comment__date { font-size: .75rem; color: var(--text-faint); }
.comment__content { font-size: .92rem; color: var(--text-soft); margin: 0 0 .4rem; white-space: pre-line; }
.comment__reply-toggle { background: none; border: none; color: var(--accent); font-size: .8rem; font-weight: 600; cursor: pointer; padding: 0; font-family: inherit; }
.comment-reply-form { margin-top: .8rem; }
.comment-replies { margin-top: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.comment--reply { border-bottom: none; padding-bottom: 0; }

/* Back to top (desktop saja) */
.back-to-top {
    display: none; position: fixed; bottom: 2rem; right: 2rem;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--accent); color: #fff; border: none; cursor: pointer;
    align-items: center; justify-content: center;
    box-shadow: 0 8px 20px var(--shadow); z-index: 15;
}
.back-to-top svg { width: 20px; height: 20px; }
.back-to-top[hidden] { display: none; }
@media (min-width: 769px) {
    .back-to-top:not([hidden]) { display: flex; }
}
