/* ==========================================================================
   1. HEADER UTAMA (Dikunci hanya di dalam #header-portal-balaipikir)
   ========================================================================== */
#header-portal-balaipikir {
    position: sticky;
    top: 0;
    z-index: 999;
    background-color: #253A7C;
    width: 100%;
    font-family: system-ui, -apple-system, sans-serif;
}

#header-portal-balaipikir .header-container-1100 {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
}

#header-portal-balaipikir .header-top-bar {
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

#header-portal-balaipikir .header-logo { flex-grow: 1; }
#header-portal-balaipikir .header-logo .logo-svg {
    height: 42px;
    width: auto;
    filter: brightness(0) invert(1);
    display: block;
}

/* Tombol di dalam Header */
#header-portal-balaipikir .header-right-actions { display: flex; align-items: center; gap: 12px; }

.btn-header {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    transition: 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-outline { border: 1.5px solid rgba(255,255,255,0.4); color: #fff !important; }
.btn-kirim { background: #FFD166 !important; color: #121b39 !important; border: 1.5px solid #FFD166; }

/* Efek Hover biar lebih mantap */
.btn-outline:hover { background: rgba(255,255,255,0.1); }
.btn-kirim:hover { filter: brightness(0.9); }

#header-portal-balaipikir button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    display: flex;
}

/* Navigasi Kategori */
#header-portal-balaipikir .header-nav-bar { background: #253A7C; border-bottom: 2px solid rgba(0,0,0,0.1); }
#header-portal-balaipikir .nav-wrapper { justify-content: space-between; display: flex; align-items: center; }
#header-portal-balaipikir .nav-scroll-area { display: flex; overflow-x: auto; white-space: nowrap; flex-grow: 1; scrollbar-width: none; }
#header-portal-balaipikir .nav-scroll-area::-webkit-scrollbar { display: none; }

#header-portal-balaipikir .nav-scroll-area a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 700;
    padding: 15px 20px 15px 0;
    text-transform: uppercase;
    position: relative;
}

#header-portal-balaipikir .nav-scroll-area a.active { color: #fff; }
#header-portal-balaipikir .nav-scroll-area a.active::after {
    content: ""; position: absolute; bottom: 0; left: 0; right: 20px; height: 4px; background: #FFD166;
}

/* ==========================================================================
   2. MOBILE SIDEBAR & OVERLAY (Dikunci ke ID Masing-masing)
   ========================================================================== */
#mobile-sidebar {
    position: fixed; top: 0; right: -320px; width: 300px; height: 100vh;
    background: #253A7C; z-index: 1000001 !important;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(0,0,0,0.3); visibility: hidden;
}

#mobile-sidebar.open { right: 0; visibility: visible; }

/* Styling Isi Sidebar */
#mobile-sidebar .sidebar-header { display: flex; justify-content: space-between; align-items: center; color: #ffffff; padding: 25px; border-bottom: 1px solid rgba(255,255,255,0.1); }
#mobile-sidebar .sidebar-body { padding: 20px; overflow-y: auto; flex-grow: 1; scrollbar-width: none; }
#mobile-sidebar .sidebar-body::-webkit-scrollbar { display: none; }
#mobile-sidebar button#btn-close-sidebar { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }

#mobile-sidebar .sidebar-nav { display: flex; flex-direction: column; gap: 8px; }
#mobile-sidebar .sidebar-nav a {
    display: block; color: #ffffff; text-decoration: none; font-size: 15px; font-weight: 600;
    padding: 14px 18px; border-radius: 10px; background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid transparent; transition: 0.3s all ease;
}
#mobile-sidebar .sidebar-nav a:hover { background: rgba(255, 255, 255, 0.12); color: #FFD166; border-left: 4px solid #FFD166; padding-left: 22px; }

#mobile-sidebar .sidebar-footer-credit { margin-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 20px; }
#mobile-sidebar .sidebar-footer-credit p { font-size: 11px; color: rgba(255, 255, 255, 1); margin: 0; text-transform: uppercase; font-weight: 500; }
#mobile-sidebar .sidebar-footer-credit strong { color: #FFD166; font-weight: 700; display: block; font-size: 13px; margin-bottom: 4px; }

/* ==========================================================================
   3. PENCARIAN LAYAR PENUH (Dikunci ke ID #search-modal-full)
   ========================================================================== */
#search-modal-full {
    position: fixed; inset: 0; background: rgba(37, 58, 124, 0.98);
    z-index: 1000002; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: 0.3s ease; backdrop-filter: blur(8px);
}

#search-modal-full.active { opacity: 1; visibility: visible; }
#search-modal-full .search-modal-content { width: 100%; max-width: 800px; padding: 0 30px; position: relative; }
#search-modal-full button#btn-close-search { position: absolute; top: -60px; right: 30px; background: none; border: none; color: rgba(255,255,255,0.7); font-size: 30px; cursor: pointer; transition: 0.3s; }
#search-modal-full button#btn-close-search:hover { color: #FFD166; transform: scale(1.1); }

#search-modal-full input#search-input {
    width: 100%; background: transparent; border: none; border-bottom: 2px solid rgba(255,255,255,0.3);
    color: #ffffff; font-size: 36px; font-weight: 700; padding: 15px 0; outline: none; transition: 0.3s;
}
#search-modal-full input#search-input::placeholder { color: rgba(255,255,255,0.3); }
#search-modal-full input#search-input:focus { border-bottom: 2px solid #FFD166; }

/* ==========================================================================
   4. TAMPILAN RESPONSIVE MOBILE
   ========================================================================== */
.desktop-only-flex { display: flex !important; }
.mobile-only-flex { display: none !important; }

@media(max-width: 768px) {
    .desktop-only, .desktop-only-flex { display: none !important; }
    .mobile-only-flex { display: flex !important; }
    #header-portal-balaipikir .header-logo .logo-svg { height: 32px; }
    #header-portal-balaipikir .nav-scroll-area { padding-left: 20px; }
    #search-modal-full input#search-input { font-size: 24px; }
    #search-modal-full button#btn-close-search { right: 15px; top: -50px; font-size: 24px; }
}

/* ==========================================================================
   5. SIDEBAR SOCIAL MEDIA (Icon SVG)
   ========================================================================== */
.sidebar-social {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1); 
}

.social-flex {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.social-flex a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff; /* Warna dasar ikon */
    text-decoration: none;
    transition: all 0.3s ease;
}

/* Memastikan ukuran SVG pas di tengah */
.social-flex a svg {
    width: 18px;
    height: 18px;
    transition: all 0.3s ease;
}

/* Efek Hover dengan aksen kuning Balai Pikir */
.social-flex a:hover {
    background-color: #FFD166;
    color: #253A7C; /* Warna ikon berubah biru gelap saat di-hover */
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 209, 102, 0.2);
}

/* (Kode CSS Header, Sidebar, dll milik Anda sebelumnya ada di atas sini) */

/* ==========================================================================
   6. IKLAN INTERNAL MOBILE (PARALLAX REVEAL)
   ========================================================================== */
@media (min-width: 769px) {
    .mobile-only-ad { display: none !important; }
}

@media (max-width: 768px) {
    :root {
        --bp-ad-bg: #121b39;
        --bp-ad-text: rgba(255,255,255,0.8);
    }

    #bp-ad-container {
        position: relative;
        width: 100%;
        background: var(--bp-ad-bg);
        overflow: hidden; /* Tambahkan ini agar saat ditutup gambarnya terpotong rapi */
    }

    #bp-ad-fixed-wrap {
        position: relative; /* Normal scroll */
        width: 100%;
        background: var(--bp-ad-bg);
    }

    /* Bagian Header Iklan (Label & Tombol Close) */
    .bp-ad-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 15px;
        background: rgba(0, 0, 0, 0.4);
    }

    .bp-ad-label {
        font-size: 11px;
        color: var(--bp-ad-text);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 500;
    }

    button#bp-ad-close {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: #fff;
        border-radius: 50%;
        width: 24px;
        height: 24px;
        font-size: 12px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        transition: 0.2s ease;
    }

    button#bp-ad-close:hover {
        background: #FFD166;
        color: #121b39;
        border-color: #FFD166;
    }

    /* Bagian Gambar Iklan */
    .bp-ad-body {
        width: 100%;
        display: block;
    }

    .bp-ad-body img {
        width: 100%;
        height: auto;
        display: block;
        object-fit: cover;
    }

    /* Animasi saat iklan di-close */
    .bp-ad-fade-out {
        opacity: 0;
        transition: opacity 0.4s ease, visibility 0.4s;
        visibility: hidden;
    }
}