/* ============================================================
   HEADER NAVIGATION — CSS ONLY — FULL SCRIPT
   DESKTOP : [Penerbitpu.id] | [PORTAL/tagline] | [nav links] | [search + btn merah]
   MOBILE  : [Penerbitpu.id] [search + btn merah] [hamburger ≡]  ← 1 baris sejajar
   DRAWER  : slide dari atas — logo + ✕ | menu link biru besar

   CSS-only toggle: <input type="checkbox" id="nav-toggle">
   harus menjadi SIBLING dari .site-header dan .mobile-drawer
   ============================================================ */

/* ============================================================
   TOPBAR
============================================================ */
.topbar {
    background: var(--ink);
    color: rgba(250,248,244,.4);
    font-size: 11px;
    padding: 6px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: .02em;
}

/* ============================================================
   CHECKBOX HIDDEN — CSS-only trick
   Letakkan di HTML sebelum .site-header dan .mobile-drawer:
   <input type="checkbox" id="nav-toggle">
============================================================ */
#nav-toggle {
    display: none;
}

/* ============================================================
   SITE HEADER
============================================================ */
.site-header {
    background: var(--ink);
    border-bottom: 1px solid rgba(250,248,244,.08);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.header-inner {
    max-width: 1550px;
    margin: 0 auto;
    padding: 11px 40px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    width: 100%;
}

/* ============================================================
   LOGO PENERBIT
============================================================ */
.logo-penerbit {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.lp-main {
    font-family: var(--ff-body);
    font-size: 26px;
    font-weight: 700;
    color: rgba(250,248,244,0.92);
    letter-spacing: -.4px;
}

.lp-dot {
    font-family: var(--ff-body);
    font-size: 26px;
    font-weight: 700;
    color: rgba(250,248,244,0.92);
}

.lp-tld {
    font-family: var(--ff-body);
    font-size: 26px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -.3px;
}

/* ============================================================
   DIVIDER VERTIKAL antara logo penerbit & logo portal
============================================================ */
.logo-divider {
    width: 1px;
    height: 52px;
    background: rgba(250,248,244,.13);
    flex-shrink: 0;
    margin: 0 4px;
}

/* ============================================================
   LOGO PORTAL — garis merah + PORTAL / tagline
============================================================ */
.logo-portal {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
}

.logo-bar {
    width: 3px;
    height: 58px;
    background: var(--accent);
    border-radius: 2px;
    flex-shrink: 0;
}

.logo-text-wrap h1 {
    font-family: var(--ff-display);
    font-size: 28px;
    color: var(--cream);
    letter-spacing: -1px;
    line-height: 1;
}

.logo-text-wrap p {
    font-size: 9px;
    color: rgba(250,248,244,.32);
    letter-spacing: .32em;
    text-transform: uppercase;
    margin-top: 3px;
}

/* ============================================================
   NAV LINKS — desktop
============================================================ */
.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin-left: 8px;
    flex: 1;
}

.nav-links li a {
    display: block;
    padding: 7px 13px;
    font-family: var(--ff-body);
    font-size: 13px;
    font-weight: 500;
    color: rgba(250,248,244,.72);
    text-decoration: none;
    border-radius: 6px;
    white-space: nowrap;
    letter-spacing: .01em;
    transition: background .18s, color .18s;
}

.nav-links li a:hover {
    background: rgba(250,248,244,.08);
    color: var(--cream);
}

.nav-links li a.active {
    background: rgba(192,57,43,.15);
    color: #e87b6e;
}

/* ============================================================
   SEARCH — desktop
============================================================ */
.header-search {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}

.header-search-input {
    height: 38px;
    padding: 0 13px;
    background: rgba(250,248,244,.09);
    border: 1px solid rgba(250,248,244,.14);
    border-right: none;
    border-radius: 6px 0 0 6px;
    color: var(--cream);
    font-family: var(--ff-body);
    font-size: 13px;
    outline: none;
    width: 200px;
    transition: background .2s, border-color .2s, width .3s ease;
}

.header-search-input::placeholder {
    color: rgba(250,248,244,.28);
}

.header-search-input:focus {
    background: rgba(250,248,244,.14);
    border-color: rgba(250,248,244,.28);
    width: 240px;
}

.header-search-btn {
    height: 38px;
    width: 38px;
    background: var(--accent);
    border: none;
    border-radius: 0 6px 6px 0;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .18s;
}

.header-search-btn:hover {
    background: #a93226;
}

/* ============================================================
   HAMBURGER LABEL — hidden desktop, tampil mobile
============================================================ */
.hamburger-label {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: rgba(250,248,244,.08);
    border: 1px solid rgba(250,248,244,.12);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .18s;
}

.hamburger-label:hover {
    background: rgba(250,248,244,.14);
}

.ham-icon {
    display: block;
    width: 18px;
    height: 2px;
    background: rgba(250,248,244,.85);
    border-radius: 2px;
    position: relative;
    transition: background .25s;
}

.ham-icon::before,
.ham-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: rgba(250,248,244,.85);
    border-radius: 2px;
    transition: transform .28s cubic-bezier(.4,0,.2,1),
                top .28s cubic-bezier(.4,0,.2,1);
}

.ham-icon::before { top: -6px; }
.ham-icon::after  { top:  6px; }

/* Animasi hamburger → ✕ saat checkbox checked */
#nav-toggle:checked ~ .site-header .ham-icon {
    background: transparent;
}

#nav-toggle:checked ~ .site-header .ham-icon::before {
    top: 0;
    transform: rotate(45deg);
}

#nav-toggle:checked ~ .site-header .ham-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

/* ============================================================
   TICKER
============================================================ */
.ticker-row {
    background: var(--ink);
    display: flex;
    align-items: stretch;
    border-top: 1px solid rgba(250,248,244,.06);
    overflow: hidden;
    width: 100%;
}

.ticker-label {
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 0 18px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.ticker-box {
    overflow: hidden;
    flex: 1;
    height: 36px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    min-width: 0;
}

.running-text-inner {
    display: inline-block;
    white-space: nowrap;
    animation: ticker 35s linear infinite;
    padding-left: 100%;
    font-size: 12px;
    font-weight: 400;
    color: rgba(250,248,244,.45);
    will-change: transform;
}

@keyframes ticker {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.running-text-inner.paused {
    animation-play-state: paused;
}

/* ============================================================
   MOBILE DRAWER — hidden desktop
============================================================ */
.mobile-drawer {
    display: none;
}

/* ============================================================
   RESPONSIVE — TABLET ≤960px
============================================================ */
@media (max-width: 960px) {

    .topbar {
        padding: 5px 16px;
    }

    .header-inner {
        padding: 11px 16px;
        gap: 12px;
    }

    .lp-main,
    .lp-dot,
    .lp-tld {
        font-size: 22px;
    }

    .logo-divider {
        height: 48px;
    }

    .logo-text-wrap h1 {
        font-size: 22px;
    }

    .logo-bar {
        height: 54px;
    }

    .nav-links li a {
        padding: 7px 9px;
        font-size: 12px;
    }

    .header-search-input {
        width: 140px;
    }

    .header-search-input:focus {
        width: 170px;
    }
}

/* ============================================================
   RESPONSIVE — MOBILE ≤640px
   Layout 1 baris: [Logo] [Search.....🔍] [≡]
============================================================ */
@media (max-width: 640px) {

    /* Topbar hilang */
    .topbar {
        display: none;
    }

    /* ── KUNCI UTAMA: paksa satu baris horizontal ── */
    .header-inner {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        padding: 10px 14px;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    /* Logo kiri — tidak menyusut */
    .logo-penerbit {
        flex-shrink: 0;
        order: 1;
    }

    .lp-main,
    .lp-dot,
    .lp-tld {
        font-size: 17px;
        letter-spacing: -.2px;
    }

    /* Divider hilang */
    .logo-divider {
        display: none;
    }

    /* Logo portal hilang */
    .logo-portal {
        display: none;
    }

    /* Nav links desktop hilang */
    .nav-links {
        display: none;
    }

    /* Search — mengisi sisa ruang di tengah */
    .header-search {
        flex: 1 1 auto;
        min-width: 0;
        margin-left: 0;   /* override desktop margin-left: auto */
        order: 2;
    }

    .header-search-input {
        width: 100%;
        min-width: 0;
        height: 36px;
        border-radius: 6px 0 0 6px;
        transition: none;
        font-size: 13px;
    }

    .header-search-input:focus {
        width: 100%;
    }

    .header-search-btn {
        height: 36px;
        width: 36px;
        flex-shrink: 0;
    }

    /* Hamburger kanan — tidak menyusut */
    .hamburger-label {
        display: flex;
        flex-shrink: 0;
        order: 3;
    }

    /* ── DRAWER ── */
    .mobile-drawer {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 200;
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        transition: opacity .28s ease, visibility .28s ease;
    }

    .drawer-overlay {
        position: absolute;
        inset: 0;
        background: rgba(26,23,20,.52);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        cursor: pointer;
    }

    .drawer-panel {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        border-radius: 0 0 20px 20px;
        box-shadow: 0 12px 40px rgba(26,23,20,.22);
        transform: translateY(-105%);
        transition: transform .32s cubic-bezier(.4,0,.2,1);
        overflow: hidden;
    }

    .drawer-head {
        background: var(--ink);
        padding: 11px 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .drawer-head .lp-main,
    .drawer-head .lp-dot,
    .drawer-head .lp-tld {
        font-size: 16px;
    }

    .drawer-close {
        display: flex;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: rgba(250,248,244,.1);
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: rgba(250,248,244,.8);
        font-size: 22px;
        font-weight: 300;
        line-height: 1;
        font-family: var(--ff-body);
        transition: background .18s;
        flex-shrink: 0;
        user-select: none;
    }

    .drawer-close::before {
        content: '×';
    }

    .drawer-close:hover {
        background: rgba(192,57,43,.35);
    }

    .drawer-nav {
        list-style: none;
        padding: 10px 16px 24px;
    }

    .drawer-nav li a {
        display: block;
        padding: 17px 20px;
        font-family: var(--ff-body);
        font-size: 20px;
        font-weight: 600;
        color: #2563eb;
        text-align: center;
        letter-spacing: -.2px;
        border-radius: 14px;
        margin: 3px 0;
        text-decoration: none;
        transition: background .15s, color .15s;
    }

    .drawer-nav li a:hover {
        background: #eff6ff;
        color: #1d4ed8;
    }

    .drawer-nav li:first-child a {
        background: #eff6ff;
    }

    /* CSS-ONLY TOGGLE */
    #nav-toggle:checked ~ .mobile-drawer {
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }

    #nav-toggle:checked ~ .mobile-drawer .drawer-panel {
        transform: translateY(0);
    }

    /* Override halaman */
    .page-wrapper {
        padding: 32px 16px 80px;
        max-width: 100%;
        overflow-x: clip;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .detail-body,
    .komentar-body {
        padding: 24px 18px;
    }

    .detail-title {
        font-size: 24px;
    }
}