/* ==========================================================================
   DESIGN TOKENS
   ========================================================================== */

:root {
    --primary: #dc2626;
    --primary-hover: #b91c1c;
    --primary-light: #f87171;
    --primary-dark: #991b1b;
    --primary-soft: rgba(220, 38, 38, 0.08);
    --primary-alpha: rgba(220, 38, 38, 0.08);
    --primary-glow: rgba(220, 38, 38, 0.25);
    --primary-glow-strong: rgba(220, 38, 38, 0.45);

    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-soft: #f1f5f9;
    --bg-overlay: rgba(10, 15, 30, 0.5);
    --card-bg: #ffffff;

    --text: #0a0f1e;
    --text-color: #0a0f1e;
    --text-muted: #64748b;
    --text-soft: #94a3b8;
    --text-invert: #ffffff;

    --border: #e2e8f0;
    --border-color: #e2e8f0;
    --border-soft: #f1f5f9;

    --shadow-xs: 0 1px 2px rgba(10, 15, 30, 0.04);
    --shadow-sm: 0 2px 8px rgba(10, 15, 30, 0.06);
    --shadow: 0 8px 24px rgba(10, 15, 30, 0.08);
    --shadow-lg: 0 24px 48px -16px rgba(10, 15, 30, 0.15);
    --shadow-glow: 0 8px 32px -8px var(--primary-glow);

    --r-xs: 4px;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 24px;
    --r-full: 999px;

    --sp-xs: 8px;
    --sp-sm: 12px;
    --sp-md: 16px;
    --sp-lg: 24px;
    --sp-xl: 32px;
    --sp-2xl: 48px;
    --sp-3xl: 64px;

    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --t-fast: 0.2s;
    --t-base: 0.3s;
    --t-slow: 0.5s;

    --z-dropdown: 100;
    --z-header: 1000;
    --z-sidebar: 1100;
    --z-overlay: 1050;
    --z-modal: 2000;

    --container-max: 1440px;
    --header-h: 64px;
}

@media (min-width: 769px) {
    :root {
        --header-h: 72px;
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a0f1e;
        --bg-alt: #111827;
        --bg-soft: #1a2234;
        --card-bg: #151b2d;
        --bg-overlay: rgba(0, 0, 0, 0.7);

        --text: #f8fafc;
        --text-color: #f8fafc;
        --text-muted: #94a3b8;
        --text-soft: #64748b;

        --border: #1e293b;
        --border-color: #1e293b;
        --border-soft: #1e293b;

        --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
        --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
        --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, 0.7);
    }
}


/* ==========================================================================
   RESET
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

html, body {
    overflow-x: clip;
    width: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease);
}

@media (min-width: 769px) {
    body {
        font-size: 16px;
        line-height: 1.65;
    }
}

#content-router,
main {
    flex: 1 0 auto;
    position: relative;
    z-index: 1;
    min-height: 50vh;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

::selection {
    background-color: var(--primary);
    color: #ffffff;
}


/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
}

h1 { font-size: clamp(1.75rem, 6vw, 4rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.4rem, 4.5vw, 2.5rem); font-weight: 800; letter-spacing: -0.025em; }
h3 { font-size: clamp(1.1rem, 3vw, 1.5rem); font-weight: 700; }
h4 { font-size: clamp(1rem, 2.5vw, 1.15rem); font-weight: 700; }

p {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.btn, button, .section-number,
.artikel-card-date, .artikel-card-list-date {
    text-align: initial;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--t-fast) var(--ease);
}

img { max-width: 100%; height: auto; display: block; }

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input, textarea, select { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }


/* Section heading */
.section-heading {
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
    margin-bottom: var(--sp-xl);
    width: 100%;
}

@media (min-width: 769px) {
    .section-heading {
        gap: var(--sp-md);
        margin-bottom: var(--sp-2xl);
        max-width: 900px;
    }
}

.section-number {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--primary);
}

.section-number::before {
    content: "";
    width: 24px;
    height: 2px;
    background: var(--primary);
    border-radius: var(--r-full);
    flex-shrink: 0;
}

@media (min-width: 769px) {
    .section-number { font-size: 0.85rem; gap: var(--sp-sm); }
    .section-number::before { width: 32px; }
}

.section-title {
    font-size: clamp(1.5rem, 5vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    margin: 0;
}

.section-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
    text-align: justify;
}

@media (min-width: 769px) {
    .section-desc { font-size: 1.05rem; max-width: 640px; }
}


/* ==========================================================================
   CONTAINER & SECTION BLOCK
   ========================================================================== */

.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--sp-md);
}

@media (min-width: 641px) {
    .container { padding: 0 var(--sp-lg); }
}

@media (min-width: 1025px) {
    .container { max-width: var(--container-max); padding: 0 clamp(32px, 4vw, 64px); }
}

.section-block { padding: var(--sp-2xl) 0; }

@media (min-width: 769px) {
    .section-block { padding: var(--sp-3xl) 0; }
}

.section-block.alt { background: var(--bg-alt); }

.section-block + .section-block.alt,
.section-block.alt + .section-block {
    border-top: 1px solid var(--border);
}


/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-xs);
    padding: 12px 22px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    border-radius: var(--r-full);
    border: none;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: all var(--t-base) var(--ease);
    isolation: isolate;
}

@media (min-width: 769px) {
    .btn { padding: 14px 28px; font-size: 0.95rem; }
}

.btn i { font-size: 1.05em; }

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 8px 24px -6px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px -8px var(--primary-glow-strong);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -8px var(--primary-glow);
}

.btn-ghost {
    background: var(--bg-alt);
    color: var(--text);
}

.btn-ghost:hover {
    background: var(--primary);
    color: #ffffff;
    transform: translateY(-2px);
}

.btn-lg { padding: 14px 28px; font-size: 0.95rem; }

@media (min-width: 769px) {
    .btn-lg { padding: 18px 36px; font-size: 1rem; }
}


/* ==========================================================================
   UTILITY
   ========================================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.gap-xs { gap: var(--sp-xs); }
.gap-sm { gap: var(--sp-sm); }
.gap-md { gap: var(--sp-md); }
.gap-lg { gap: var(--sp-lg); }
.gap-xl { gap: var(--sp-xl); }

.hidden { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.divider {
    width: 100%;
    height: 1px;
    background: var(--border);
    margin: var(--sp-xl) 0;
}

.empty-state {
    padding: var(--sp-2xl) var(--sp-md);
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-alt);
    border-radius: var(--r-md);
    border: 1px dashed var(--border);
    font-size: 0.9rem;
}

.empty-text {
    color: var(--text-muted);
    font-style: italic;
    padding: var(--sp-md) 0;
    text-align: center;
    margin: 0;
    font-size: 0.9rem;
}


/* ==========================================================================
   SCROLL PROGRESS & BACK TO TOP
   ========================================================================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    z-index: 9998;
    transition: width 0.1s linear;
    box-shadow: 0 0 12px var(--primary-glow);
    pointer-events: none;
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #ffffff;
    border-radius: 50%;
    font-size: 1.1rem;
    box-shadow: 0 10px 24px -6px var(--primary-glow-strong);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--t-base) var(--ease-out);
    cursor: pointer;
    border: none;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.back-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-4px) scale(1.08);
}

@media (min-width: 769px) {
    .back-to-top {
        bottom: 24px;
        right: 24px;
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--header-h);
    z-index: var(--z-header);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-soft);
    transition: background var(--t-base) var(--ease),
                border-color var(--t-base) var(--ease),
                box-shadow var(--t-base) var(--ease);
    isolation: isolate;
}

@media (prefers-color-scheme: dark) {
    .main-header {
        background: rgba(10, 15, 30, 0.9);
    }
}

.main-header.scrolled {
    box-shadow: 0 4px 24px rgba(10, 15, 30, 0.08);
}

@media (prefers-color-scheme: dark) {
    .main-header.scrolled {
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    }
}


/* ==========================================================================
   HEADER INNER — layout
   Mobile: logo (kiri) + nama (tengah) + hamburger (kanan)
   Desktop: logo + nama | search | hamburger
   ========================================================================== */

.header-inner {
    position: relative;
    max-width: 100%;
    height: 100%;
    padding: 0 var(--sp-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-sm);
}

@media (min-width: 769px) {
    .header-inner {
        padding: 0 var(--sp-lg);
        gap: var(--sp-lg);
    }
}


/* ==========================================================================
   BRAND WRAPPER — logo + info
   ========================================================================== */

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-width: 0;
    transition: transform var(--t-base) var(--ease);
}

.brand-wrapper:hover {
    transform: scale(1.02);
}


/* ==========================================================================
   LOGO
   ========================================================================== */

.logo-circle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 4;
}

@media (min-width: 769px) {
    .logo-circle {
        width: 42px;
        height: 42px;
    }
}

.logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform var(--t-base) var(--ease-spring);
}

.brand-wrapper:hover .logo-circle img {
    transform: rotate(-6deg);
}


/* ==========================================================================
   BRAND INFO — nama + tagline
   Mobile: absolute di tengah header
   Desktop: static, di samping logo
   ========================================================================== */

.brand-info {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

/* MOBILE — posisikan absolute di tengah */
@media (max-width: 768px) {
    .brand-info {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        max-width: 55vw;
        pointer-events: none;
        gap: 1px;
        z-index: 3;
    }
}

/* DESKTOP — static seperti biasa */
@media (min-width: 769px) {
    .brand-info {
        position: static;
        transform: none;
        align-items: flex-start;
        text-align: left;
        max-width: 220px;
        pointer-events: auto;
    }
}


/* ==========================================================================
   NAMA SEKOLAH
   ========================================================================== */

.brand-name,
.nama-sekolah {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

@media (min-width: 769px) {
    .brand-name,
    .nama-sekolah {
        font-size: 0.95rem;
        max-width: 200px;
    }
}

@media (min-width: 1025px) {
    .brand-name,
    .nama-sekolah {
        font-size: 1rem;
        max-width: 240px;
    }
}


/* ==========================================================================
   TAGLINE
   ========================================================================== */

.brand-tagline {
    font-family: var(--font-body);
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

@media (min-width: 769px) {
    .brand-tagline {
        font-size: 0.62rem;
        max-width: 200px;
    }
}


/* ==========================================================================
   HAMBURGER — di kanan header
   ========================================================================== */

.hamburger-menu,
.hamburger {
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    border-radius: var(--r-sm);
    transition: background var(--t-fast);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 4;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-menu:hover,
.hamburger:hover {
    background: var(--bg-alt);
}

.hamburger-menu span,
.hamburger span {
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: var(--r-full);
    transition: all 0.35s var(--ease-out);
    transform-origin: center;
}

.hamburger-menu.active span:nth-child(1),
.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2),
.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-menu.active span:nth-child(3),
.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* ==========================================================================
   TABLET — padding lebih lega
   ========================================================================== */

@media (min-width: 641px) {
    .header-inner {
        padding: 0 var(--sp-lg);
    }
}

/* ==========================================================================
   SEARCH WRAPPER — DESKTOP (di dalam header)
   ========================================================================== */

.search-wrapper {
    position: relative;
    display: none;
}

@media (min-width: 769px) {
    .search-wrapper {
        display: block;
        flex: 1 1 100%;
        max-width: 520px;
        min-width: 0;
        margin: 0 auto;
        z-index: 100;
    }
}


/* ==========================================================================
   SEARCH WRAPPER — MOBILE (bar terpisah di bawah header)
   ========================================================================== */

.search-wrapper-mobile {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    padding: 8px var(--sp-md);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-soft);
    z-index: calc(var(--z-header) - 1);
    transition: background var(--t-base) var(--ease),
                border-color var(--t-base) var(--ease);
}

@media (prefers-color-scheme: dark) {
    .search-wrapper-mobile {
        background: rgba(10, 15, 30, 0.9);
    }
}

@media (min-width: 769px) {
    .search-wrapper-mobile {
        display: none;
    }
}


/* ==========================================================================
   SEARCH BOX — container input + ikon + clear button
   ========================================================================== */

.search-box {
    position: relative;
    width: 100%;
    display: block;
}


/* ==========================================================================
   IKON SEARCH
   ========================================================================== */

.icon-search {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    font-size: 0.92rem;
    line-height: 1;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--t-base) var(--ease);
    z-index: 3;
}

@media (min-width: 769px) {
    .icon-search {
        left: 18px;
        font-size: 0.95rem;
    }
}

.search-box:focus-within .icon-search {
    color: var(--primary);
}


/* ==========================================================================
   INPUT FIELD — desktop + mobile
   ========================================================================== */

#global-search,
#global-search-mobile {
    display: block;
    width: 100%;
    padding: 10px 40px 10px 42px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    line-height: 1.4;
    color: var(--text);
    background: var(--bg-alt);
    border: 1.5px solid transparent;
    border-radius: var(--r-full);
    outline: none;
    position: relative;
    z-index: 2;
    -webkit-appearance: none;
    appearance: none;
    transition: background var(--t-base) var(--ease),
                border-color var(--t-base) var(--ease),
                box-shadow var(--t-base) var(--ease);
}

@media (min-width: 769px) {
    #global-search {
        padding: 11px 44px 11px 46px;
        font-size: 0.92rem;
    }
}

#global-search::placeholder,
#global-search-mobile::placeholder {
    color: transparent;
}

#global-search:focus,
#global-search-mobile:focus {
    background: var(--card-bg);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}


/* ==========================================================================
   FAKE PLACEHOLDER — rotasi otomatis dari JS
   ========================================================================== */

.fake-placeholder {
    position: absolute;
    top: 50%;
    left: 42px;
    right: 42px;
    transform: translateY(-50%);
    font-family: var(--font-body);
    font-size: 0.88rem;
    line-height: 1.4;
    color: var(--text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    z-index: 3;
    transition: opacity 0.35s var(--ease);
    will-change: opacity;
}

@media (min-width: 769px) {
    .fake-placeholder {
        left: 47px;
        right: 46px;
        font-size: 0.92rem;
    }
}


/* ==========================================================================
   TOMBOL CLEAR (×)
   ========================================================================== */

.btn-clear {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-soft);
    color: var(--text-muted);
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    transition: background var(--t-fast) var(--ease),
                color var(--t-fast) var(--ease),
                transform var(--t-fast) var(--ease);
}

@media (min-width: 769px) {
    .btn-clear {
        right: 12px;
        width: 24px;
        height: 24px;
        font-size: 1.1rem;
    }
}

.btn-clear:hover {
    background: var(--primary);
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

/* ==========================================================================
   SEARCH RESULTS — dropdown hasil pencarian
   Semua hasil dirender, container yang scroll.
   ========================================================================== */

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    padding: 6px;
    animation: dropdownIn 0.25s var(--ease-out);
}

@media (min-width: 769px) {
    .search-results {
        top: calc(100% + 12px);
        max-height: 480px;
        border-radius: var(--r-lg);
        padding: 8px;
    }
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Scrollbar tipis di dalam dropdown */
.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--r-full);
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}


/* ==========================================================================
   HEADER DI DALAM DROPDOWN — sticky, kasih tahu jumlah hasil
   ========================================================================== */

.search-results-header {
    padding: 10px 12px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 4px;
    position: sticky;
    top: -6px;
    background: var(--card-bg);
    z-index: 2;
    border-top-left-radius: var(--r-md);
    border-top-right-radius: var(--r-md);
}

@media (min-width: 769px) {
    .search-results-header {
        padding: 12px 16px;
        font-size: 0.72rem;
        top: -8px;
        border-top-left-radius: var(--r-lg);
        border-top-right-radius: var(--r-lg);
    }
}


/* ==========================================================================
   ITEM HASIL — layout flex: icon + body + badge
   ========================================================================== */

.search-result-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background var(--t-fast) var(--ease);
    content-visibility: auto;
    contain-intrinsic-size: 60px;
    -webkit-tap-highlight-color: transparent;
}

@media (min-width: 769px) {
    .search-result-item {
        gap: 12px;
        padding: 10px 12px;
    }
}

.search-result-item:hover,
.search-result-item.is-active {
    background: var(--bg-alt);
}


/* ==========================================================================
   ICON HASIL
   ========================================================================== */

.search-result-icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.9rem;
}

@media (min-width: 769px) {
    .search-result-icon {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }
}


/* ==========================================================================
   BODY — judul + excerpt
   ========================================================================== */

.search-result-body {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

@media (min-width: 769px) {
    .search-result-title {
        font-size: 0.9rem;
    }
}

/* Highlight keyword di judul — pakai <mark> */
.search-result-title mark {
    background: transparent;
    color: var(--primary);
    font-weight: 800;
    padding: 0;
}

.search-result-excerpt {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

@media (min-width: 769px) {
    .search-result-excerpt {
        font-size: 0.78rem;
    }
}


/* ==========================================================================
   BADGE — label tipe (ARTIKEL / GURU / FASILITAS / dll)
   ========================================================================== */

.search-result-badge {
    flex-shrink: 0;
    padding: 2px 7px;
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: var(--r-full);
    align-self: flex-start;
    margin-top: 2px;
    white-space: nowrap;
}

@media (min-width: 769px) {
    .search-result-badge {
        padding: 3px 9px;
        font-size: 0.62rem;
    }
}


/* ==========================================================================
   KALAU TIDAK ADA HASIL
   ========================================================================== */

.search-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.search-empty i {
    display: block;
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-soft);
}

.search-empty p {
    margin: 0;
    text-align: center;
}


/* ==========================================================================
   HIGHLIGHT TARGET — animasi pulse saat scroll dari search
   ========================================================================== */

.search-target-highlight {
    animation: searchTargetPulse 1.4s var(--ease-out) 2;
    border-color: var(--primary) !important;
    box-shadow:
        0 0 0 4px var(--primary-soft),
        0 20px 48px -16px var(--primary-glow-strong) !important;
    transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

@keyframes searchTargetPulse {
    0% {
        box-shadow:
            0 0 0 0 var(--primary-glow-strong),
            0 20px 48px -16px var(--primary-glow);
    }
    50% {
        box-shadow:
            0 0 0 12px var(--primary-soft),
            0 20px 48px -16px var(--primary-glow-strong);
    }
    100% {
        box-shadow:
            0 0 0 0 var(--primary-glow-strong),
            0 20px 48px -16px var(--primary-glow);
    }
}


/* ==========================================================================
   MARK — highlight keyword di dalam konten target
   ========================================================================== */

mark.search-mark {
    background: linear-gradient(180deg, transparent 55%, var(--primary-soft) 55%);
    color: var(--primary);
    font-weight: 700;
    padding: 0 2px;
    border-radius: 2px;
    transition: background 0.3s var(--ease);
}

/* ==========================================================================
   SIDEBAR — menu geser dari kanan
   Mobile-first. Tinggi pakai dvh biar pas di mobile.
   ========================================================================== */

.sidebar-nav,
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 88vw;
    height: 100vh;
    height: 100dvh;
    background: var(--card-bg);
    border-left: 1px solid var(--border);
    box-shadow: -20px 0 60px rgba(10, 15, 30, 0.2);
    z-index: var(--z-sidebar);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease-out);
    will-change: transform;
    overflow-y: auto;
    overscroll-behavior: contain;
}

@media (min-width: 769px) {
    .sidebar-nav,
    .sidebar {
        width: 340px;
        max-width: 85vw;
        box-shadow: -20px 0 60px rgba(10, 15, 30, 0.15);
    }
}

@media (prefers-color-scheme: dark) {
    .sidebar-nav,
    .sidebar {
        box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
    }
}

.sidebar-nav.open,
.sidebar.open {
    transform: translateX(0);
}


/* ==========================================================================
   HEADER DI DALAM SIDEBAR
   ========================================================================== */

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px var(--sp-md) var(--sp-md);
    border-bottom: 1px solid var(--border-soft);
    flex-shrink: 0;
}

@media (min-width: 769px) {
    .sidebar-header {
        padding: 24px var(--sp-lg) var(--sp-lg);
    }
}

.sidebar-header-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--r-md);
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

@media (min-width: 769px) {
    .sidebar-header-icon {
        width: 40px;
        height: 40px;
        font-size: 1.15rem;
    }
}

.sidebar-header-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    flex: 1;
    min-width: 0;
}

.sidebar-header-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    opacity: 1;
}

.sidebar-header-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}


/* ==========================================================================
   TOMBOL TUTUP X DI HEADER SIDEBAR
   ========================================================================== */

.sidebar-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text-muted);
    border-radius: var(--r-sm);
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    transition: all var(--t-fast) var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.sidebar-close:hover {
    background: var(--bg-alt);
    color: var(--primary);
    transform: rotate(90deg);
}

.sidebar-close i {
    pointer-events: none;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 769px) {
    .sidebar-close {
        width: 34px;
        height: 34px;
        font-size: 1.5rem;
    }

    .sidebar-close i {
        font-size: 1.1rem;
    }
}


/* ==========================================================================
   KONTAINER LINK MENU
   ========================================================================== */

.sidebar-links,
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--sp-md) var(--sp-sm);
    flex: 1;
    overflow-y: auto;
}

@media (min-width: 769px) {
    .sidebar-links,
    .sidebar-menu {
        padding: var(--sp-lg) var(--sp-md);
    }
}


/* ==========================================================================
   MENU ITEM — warna teks solid, ukuran tap-friendly
   ========================================================================== */

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 14px;
    border-radius: var(--r-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    transition: all var(--t-base) var(--ease);
    position: relative;
    overflow: hidden;
    background: transparent;
    opacity: 1;
    line-height: 1.3;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

@media (min-width: 769px) {
    .menu-item {
        padding: 14px 16px;
        font-size: 0.98rem;
    }
}

.menu-item i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: color var(--t-base) var(--ease),
                transform var(--t-base) var(--ease-spring);
}

/* Garis kecil di kiri menu aktif */
.menu-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 0;
    background: var(--primary);
    border-radius: 0 var(--r-full) var(--r-full) 0;
    transform: translateY(-50%);
    transition: height var(--t-base) var(--ease-out);
}

.menu-item:hover {
    background: var(--bg-alt);
    color: var(--primary);
}

.menu-item:hover i {
    color: var(--primary);
    transform: scale(1.12);
}

.menu-item.active-menu {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
}

.menu-item.active-menu::before {
    height: 60%;
}

.menu-item.active-menu i {
    color: var(--primary);
}

/* Teks di dalam menu */
.menu-item > span {
    display: inline-block;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
    font-weight: inherit;
}


/* ==========================================================================
   FOOTER KECIL DI DALAM SIDEBAR
   ========================================================================== */

.sidebar-footer {
    padding: var(--sp-md) var(--sp-md) var(--sp-lg);
    border-top: 1px solid var(--border-soft);
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.sidebar-footer p {
    margin: 0;
    text-align: center;
}


/* ==========================================================================
   OVERLAY GELAP saat sidebar buka
   ========================================================================== */

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: calc(var(--z-sidebar) - 1);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t-base) var(--ease),
                visibility var(--t-base) var(--ease);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   MAIN CONTENT — area utama di bawah header
   ========================================================================== */

#content-router {
    margin-top: var(--header-h);
    min-height: calc(100vh - var(--header-h));
    position: relative;
    z-index: 1;
    animation: pageIn 0.4s var(--ease-out);
}

/* Mobile — search bar mobile nempel di bawah header, kasih jarak ekstra */
@media (max-width: 768px) {
    #content-router {
        margin-top: calc(var(--header-h) + 56px);
        min-height: calc(100vh - var(--header-h) - 56px);
    }
}

.page-wrapper {
    width: 100%;
    animation: pageIn 0.4s var(--ease-out);
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}


/* ==========================================================================
   HERO — override supaya nggak ketutup layer lain
   ========================================================================== */

.hero-cyber,
.hero-banner {
    position: relative;
    z-index: 0;
    isolation: auto;
}

.hero-cyber-bg,
.hero-cyber-overlay,
.hero-cyber-grid,
.hero-cyber-scanline,
.hero-cyber-glow,
.hero-cyber-noise,
.hero-cyber-hud,
.hero-cyber-fade {
    pointer-events: none;
}


/* ==========================================================================
   CARD PREMIUM — card dengan efek glow mengikuti kursor
   ========================================================================== */

.card-premium {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition:
        transform 0.4s var(--ease-out),
        border-color 0.3s var(--ease),
        box-shadow 0.4s var(--ease-out);
}

.card-premium::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        var(--primary-soft),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 0;
}

.card-premium:hover::before {
    opacity: 1;
}

.card-premium:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-premium > * {
    position: relative;
    z-index: 1;
}

@media (hover: none) {
    .card-premium:hover {
        transform: none;
    }
}


/* ==========================================================================
   KEYFRAMES UMUM
   ========================================================================== */

.floating {
    animation: floating 4s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

.pulse-glow {
    animation: pulseGlow 2.5s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 var(--primary-glow); }
    50%      { box-shadow: 0 0 0 12px transparent; }
}

.shimmer {
    background: linear-gradient(90deg, var(--bg-alt) 0%, var(--bg-soft) 50%, var(--bg-alt) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* ==========================================================================
   UTILITAS VISUAL — gradien teks, overlay gambar
   ========================================================================== */

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.img-overlay {
    position: relative;
    overflow: hidden;
}

.img-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s var(--ease);
    pointer-events: none;
}

.img-overlay:hover::after {
    opacity: 1;
}

.img-overlay img {
    transition: transform 0.7s var(--ease-out);
}

.img-overlay:hover img {
    transform: scale(1.06);
}

@media (hover: none) {
    .img-overlay:hover::after {
        opacity: 0;
    }
    .img-overlay:hover img {
        transform: none;
    }
}

/* ==========================================================================
   REVEAL ANIMATION — fade + slide kiri/kanan bergantian
   JS yang tentukan arah: item genap ke kiri, item ganjil ke kanan.
   ========================================================================== */

.reveal-init {
    opacity: 0;
    transform: translateX(var(--reveal-dir, -40px));
    transition:
        opacity 0.8s var(--ease-out),
        transform 0.9s var(--ease-out);
    will-change: opacity, transform;
}

.reveal-init.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* Arah kiri — dipakai item genap */
.reveal-left {
    --reveal-dir: -40px;
}

/* Arah kanan — dipakai item ganjil */
.reveal-right {
    --reveal-dir: 40px;
}

@media (min-width: 769px) {
    .reveal-left {
        --reveal-dir: -60px;
    }

    .reveal-right {
        --reveal-dir: 60px;
    }
}


/* ==========================================================================
   VARIAN LAMA data-reveal — disamakan biar kompatibel
   ========================================================================== */

[data-reveal],
[data-reveal="left"],
[data-reveal="right"],
[data-reveal="up"],
[data-reveal="blur"],
[data-reveal="scale"] {
    opacity: 0;
    transform: translateX(var(--reveal-dir, -40px));
    transition:
        opacity 0.8s var(--ease-out),
        transform 0.9s var(--ease-out);
    will-change: opacity, transform;
}

[data-reveal].is-revealed,
[data-reveal="left"].is-revealed,
[data-reveal="right"].is-revealed,
[data-reveal="up"].is-revealed,
[data-reveal="blur"].is-revealed,
[data-reveal="scale"].is-revealed {
    opacity: 1;
    transform: translateX(0);
}


/* ==========================================================================
   STAGGER — anak-anak muncul bertingkat
   ========================================================================== */

[data-stagger] > * {
    opacity: 0;
    transform: translateX(var(--reveal-dir, -30px));
    transition:
        opacity 0.7s var(--ease-out),
        transform 0.8s var(--ease-out);
}

[data-stagger].is-revealed > * {
    opacity: 1;
    transform: translateX(0);
}

[data-stagger].is-revealed > *:nth-child(1) { transition-delay: 0.04s; }
[data-stagger].is-revealed > *:nth-child(2) { transition-delay: 0.08s; }
[data-stagger].is-revealed > *:nth-child(3) { transition-delay: 0.12s; }
[data-stagger].is-revealed > *:nth-child(4) { transition-delay: 0.16s; }
[data-stagger].is-revealed > *:nth-child(5) { transition-delay: 0.20s; }
[data-stagger].is-revealed > *:nth-child(6) { transition-delay: 0.24s; }
[data-stagger].is-revealed > *:nth-child(7) { transition-delay: 0.28s; }
[data-stagger].is-revealed > *:nth-child(8) { transition-delay: 0.32s; }
[data-stagger].is-revealed > *:nth-child(n+9) { transition-delay: 0.36s; }


/* ==========================================================================
   DELAY PER GRID
   ========================================================================== */

#google-grid-artikel .grid-card:nth-child(1) { transition-delay: 0.04s; }
#google-grid-artikel .grid-card:nth-child(2) { transition-delay: 0.08s; }
#google-grid-artikel .grid-card:nth-child(3) { transition-delay: 0.12s; }
#google-grid-artikel .grid-card:nth-child(4) { transition-delay: 0.16s; }
#google-grid-artikel .grid-card:nth-child(5) { transition-delay: 0.20s; }

.highlight-list .highlight-artikel-item:nth-child(1) { transition-delay: 0.04s; }
.highlight-list .highlight-artikel-item:nth-child(2) { transition-delay: 0.10s; }
.highlight-list .highlight-artikel-item:nth-child(3) { transition-delay: 0.16s; }

.guru-grid-layout .card-guru:nth-child(1) { transition-delay: 0.04s; }
.guru-grid-layout .card-guru:nth-child(2) { transition-delay: 0.08s; }
.guru-grid-layout .card-guru:nth-child(3) { transition-delay: 0.12s; }
.guru-grid-layout .card-guru:nth-child(4) { transition-delay: 0.16s; }
.guru-grid-layout .card-guru:nth-child(5) { transition-delay: 0.20s; }
.guru-grid-layout .card-guru:nth-child(6) { transition-delay: 0.24s; }
.guru-grid-layout .card-guru:nth-child(7) { transition-delay: 0.28s; }
.guru-grid-layout .card-guru:nth-child(8) { transition-delay: 0.32s; }

.sosmed-flex-row .sosmed-item-circle:nth-child(1) { transition-delay: 0.04s; }
.sosmed-flex-row .sosmed-item-circle:nth-child(2) { transition-delay: 0.10s; }
.sosmed-flex-row .sosmed-item-circle:nth-child(3) { transition-delay: 0.16s; }
.sosmed-flex-row .sosmed-item-circle:nth-child(4) { transition-delay: 0.22s; }
.sosmed-flex-row .sosmed-item-circle:nth-child(5) { transition-delay: 0.28s; }

.stat-grid .stat-item:nth-child(1) { transition-delay: 0.06s; }
.stat-grid .stat-item:nth-child(2) { transition-delay: 0.14s; }
.stat-grid .stat-item:nth-child(3) { transition-delay: 0.22s; }

.grid-fasilitas-mini .kartu-fasilitas-premium:nth-child(1) { transition-delay: 0.04s; }
.grid-fasilitas-mini .kartu-fasilitas-premium:nth-child(2) { transition-delay: 0.08s; }
.grid-fasilitas-mini .kartu-fasilitas-premium:nth-child(3) { transition-delay: 0.12s; }
.grid-fasilitas-mini .kartu-fasilitas-premium:nth-child(4) { transition-delay: 0.16s; }

.galeri-grid-responsive .box-galeri-item:nth-child(1) { transition-delay: 0.04s; }
.galeri-grid-responsive .box-galeri-item:nth-child(2) { transition-delay: 0.10s; }
.galeri-grid-responsive .box-galeri-item:nth-child(3) { transition-delay: 0.16s; }
.galeri-grid-responsive .box-galeri-item:nth-child(4) { transition-delay: 0.22s; }


/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .reveal-init,
    [data-reveal],
    [data-stagger] > * {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .floating,
    .pulse-glow,
    .shimmer {
        animation: none !important;
    }

    .card-premium:hover,
    .img-overlay:hover img {
        transform: none !important;
    }
}

/* ==========================================================================
   LOADING SCREEN — spinner bulan sabit
   ========================================================================== */

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px var(--sp-md);
    gap: var(--sp-md);
    color: var(--text-muted);
    animation: pageIn 0.4s var(--ease-out);
}

@media (min-width: 769px) {
    .loading-screen {
        padding: 120px 24px;
        gap: var(--sp-lg);
    }
}

.loading-screen p {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-align: center;
    margin: 0;
}

@media (min-width: 769px) {
    .loading-screen p {
        font-size: 0.9rem;
    }
}

.crescent-spinner {
    width: 48px;
    height: 48px;
    color: var(--primary);
    animation: spinCrescent 1.1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
    display: block;
}

@media (min-width: 769px) {
    .crescent-spinner {
        width: 60px;
        height: 60px;
    }
}

.crescent-spinner circle {
    filter: drop-shadow(0 0 12px var(--primary-glow));
}

@keyframes spinCrescent {
    to { transform: rotate(360deg); }
}


/* ==========================================================================
   SCROLL MARGIN — offset header untuk target scroll dari search
   Biar saat scroll ke elemen, header tidak menutupi konten.
   ========================================================================== */

.stat-item,
.sambutan-section,
.sejarah-section,
.card-guru,
.kartu-fasilitas-premium,
.box-galeri-item,
.misi-list li,
.kontak-info-row,
.highlight-artikel-item,
.artikel-terbaru-section,
.section-block {
    scroll-margin-top: calc(var(--header-h) + 80px);
}

#dom-sejarah-singkat,
#dom-isi-sambutan,
#dom-stat-guru,
#dom-stat-siswa,
#dom-stat-rombel,
#dom-visi-sekolah,
#dom-misi-list,
#kontak-telepon,
#kontak-email,
#kontak-kodepos,
#kontak-maps-container {
    scroll-margin-top: calc(var(--header-h) + 80px);
}

/* Mobile — search bar mobile juga nempel di bawah header,
   jadi tambah lagi jarak offsetnya */
@media (max-width: 768px) {
    .stat-item,
    .sambutan-section,
    .sejarah-section,
    .card-guru,
    .kartu-fasilitas-premium,
    .box-galeri-item,
    .misi-list li,
    .kontak-info-row,
    .highlight-artikel-item,
    .artikel-terbaru-section,
    .section-block,
    #dom-sejarah-singkat,
    #dom-isi-sambutan,
    #dom-stat-guru,
    #dom-stat-siswa,
    #dom-stat-rombel,
    #dom-visi-sekolah,
    #dom-misi-list,
    #kontak-telepon,
    #kontak-email,
    #kontak-kodepos,
    #kontak-maps-container {
        scroll-margin-top: calc(var(--header-h) + 130px);
    }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.main-footer {
    position: relative;
    z-index: 5;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    margin-top: 80px;
    padding: 48px var(--sp-md) 24px;
    transition: background var(--t-base) var(--ease),
                border-color var(--t-base) var(--ease);
}

@media (min-width: 769px) {
    .main-footer {
        margin-top: 120px;
        padding: 64px var(--sp-lg) 32px;
    }
}

@media (min-width: 1025px) {
    .main-footer {
        margin-top: 160px;
        padding: 80px 24px 32px;
    }
}

.main-footer > p {
    max-width: 1100px;
    margin: 0 auto;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.02em;
    line-height: 1.5;
}

@media (min-width: 769px) {
    .main-footer > p {
        font-size: 0.85rem;
    }
}

.main-footer a {
    color: var(--primary);
    font-weight: 600;
    transition: opacity var(--t-fast) var(--ease);
}

.main-footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* ==========================================================================
   FAB — Floating Action Button
   ========================================================================== */

.fab-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 950;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

@media (min-width: 769px) {
    .fab-container {
        bottom: 24px;
        right: 24px;
    }
}

.fab-container.is-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    pointer-events: none;
}


/* ==========================================================================
   TOMBOL UTAMA FAB
   ========================================================================== */

.fab-main {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    box-shadow:
        0 12px 32px -8px var(--primary-glow-strong),
        0 0 0 0 var(--primary-soft);
    transition:
        box-shadow 0.35s var(--ease-out),
        transform 0.2s var(--ease-out);
    outline: none;
    -webkit-tap-highlight-color: transparent;
    z-index: 2;
}

@media (min-width: 769px) {
    .fab-main {
        width: 58px;
        height: 58px;
    }
}

.fab-main:hover {
    box-shadow:
        0 16px 40px -8px var(--primary-glow-strong),
        0 0 0 8px var(--primary-soft);
}

.fab-main:active {
    transform: scale(0.94);
}


/* ==========================================================================
   IKON PLUS & CLOSE
   ========================================================================== */

.fab-icon-plus,
.fab-icon-close {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    transform: translate(-50%, -50%);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    will-change: transform, opacity;
}

@media (min-width: 769px) {
    .fab-icon-plus,
    .fab-icon-close {
        font-size: 1.5rem;
    }
}

.fab-icon-plus {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

.fab-icon-close {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-90deg) scale(0.4);
}

.fab-container.is-open .fab-icon-plus {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(90deg) scale(0.4);
}

.fab-container.is-open .fab-icon-close {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

.fab-container.is-open .fab-main {
    background: linear-gradient(135deg, var(--text), #1a2234);
}


/* ==========================================================================
   ANAK-ANAK FAB
   ========================================================================== */

.fab-children {
    position: absolute;
    bottom: 62px;
    right: 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    pointer-events: none;
}

@media (min-width: 769px) {
    .fab-children {
        bottom: 68px;
        right: 5px;
    }
}

.fab-child {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.15rem;
    text-decoration: none;
    cursor: pointer;
    pointer-events: none;
    opacity: 0;
    transform: translateY(20px) scale(0.4);
    transition:
        opacity 0.35s var(--ease-out),
        transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.25s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    will-change: transform, opacity;
}

@media (min-width: 769px) {
    .fab-child {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
}

.fab-child:nth-child(2) {
    transition-delay: 0.08s;
}

.fab-child:hover {
    box-shadow:
        0 12px 28px -8px rgba(0, 0, 0, 0.4),
        0 0 0 6px rgba(255, 255, 255, 0.15);
}

.fab-child:active {
    transform: scale(0.94);
}

.fab-child-wa {
    background: linear-gradient(135deg, #25d366, #128c7e);
    box-shadow: 0 8px 20px -6px rgba(37, 211, 102, 0.5);
}

.fab-child-email {
    background: linear-gradient(135deg, #ea4335, #c5221f);
    box-shadow: 0 8px 20px -6px rgba(234, 67, 53, 0.5);
}

.fab-container.is-open .fab-child {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}


/* ==========================================================================
   TOOLTIP FAB
   ========================================================================== */

.fab-tooltip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    padding: 8px 14px;
    background: var(--text);
    color: var(--bg);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    border-radius: var(--r-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.fab-tooltip::after {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--text);
}

@media (hover: hover) and (pointer: fine) {
    .fab-container.is-open .fab-child:hover .fab-tooltip {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

@media (hover: none) {
    .fab-tooltip {
        display: none;
    }
}


/* ==========================================================================
   MODAL NOTIFIKASI
   ========================================================================== */

.modal-notif {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    animation: modalFadeIn 0.3s var(--ease-out);
}

@media (min-width: 769px) {
    .modal-notif {
        align-items: center;
        padding: 24px;
    }
}

.modal-notif-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 30, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-notif-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding: 32px 24px 28px;
    width: 100%;
    max-width: 100%;
    text-align: center;
    box-shadow:
        0 -8px 40px -12px rgba(0, 0, 0, 0.3),
        0 0 0 1px var(--primary-soft);
    animation: modalSlideUpMobile 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
    max-height: 90vh;
    overflow-y: auto;
}

@media (min-width: 769px) {
    .modal-notif-card {
        border-radius: var(--r-xl);
        padding: 40px 32px 32px;
        max-width: 420px;
        box-shadow:
            0 24px 60px -12px rgba(0, 0, 0, 0.4),
            0 0 0 1px var(--primary-soft);
        animation: modalSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
}

@keyframes modalSlideUpMobile {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}


/* ==========================================================================
   TOMBOL TUTUP MODAL
   ========================================================================== */

.modal-notif-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text-muted);
    background: var(--bg-alt);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

@media (min-width: 769px) {
    .modal-notif-close {
        font-size: 1.5rem;
    }
}

.modal-notif-close:hover {
    background: var(--primary);
    color: #ffffff;
    transform: rotate(90deg);
}


/* ==========================================================================
   IKON MODAL
   ========================================================================== */

.modal-notif-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow:
        0 12px 32px -8px var(--primary-glow-strong),
        0 0 0 6px var(--primary-soft);
    animation: modalIconPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@media (min-width: 769px) {
    .modal-notif-icon {
        width: 80px;
        height: 80px;
        font-size: 2.4rem;
        margin-bottom: 24px;
        box-shadow:
            0 12px 32px -8px var(--primary-glow-strong),
            0 0 0 8px var(--primary-soft);
    }
}

@keyframes modalIconPop {
    from {
        opacity: 0;
        transform: scale(0.4) rotate(-45deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}


/* ==========================================================================
   JUDUL & DESKRIPSI MODAL
   ========================================================================== */

.modal-notif-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 0 0 10px;
}

@media (min-width: 769px) {
    .modal-notif-title {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }
}

.modal-notif-desc {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0 0 22px;
    text-align: center;
}

@media (min-width: 769px) {
    .modal-notif-desc {
        font-size: 0.95rem;
        margin-bottom: 28px;
    }
}


/* ==========================================================================
   TOMBOL AKSI MODAL
   ========================================================================== */

.modal-notif-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    background: var(--primary);
    border: none;
    border-radius: var(--r-full);
    cursor: pointer;
    transition: all var(--t-base) var(--ease);
    box-shadow: 0 8px 24px -6px var(--primary-glow);
    width: 100%;
    min-width: 0;
}

@media (min-width: 769px) {
    .modal-notif-btn {
        padding: 14px 32px;
        font-size: 0.95rem;
        width: auto;
        min-width: 160px;
    }
}

.modal-notif-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px -8px var(--primary-glow-strong);
}

.modal-notif-btn:active {
    transform: translateY(0);
}


/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .fab-child,
    .fab-main,
    .fab-icon-plus,
    .fab-icon-close,
    .modal-notif,
    .modal-notif-card,
    .modal-notif-icon,
    .modal-notif-close,
    .modal-notif-btn {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   PPDB FLOATING BAR — nempel di bawah layar saat PPDB aktif
   Warna otomatis mengikuti --primary dan --primary-alpha dari Sheet.
   ========================================================================== */

.ppdb-floating {
    position: fixed;
    bottom: 12px;
    right: 12px;
    left: 12px;
    z-index: 950;

    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto auto;
    align-items: center;
    gap: 8px 12px;

    padding: 12px 14px 12px 16px;

    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 14px;

    box-shadow:
        0 4px 12px rgba(10, 15, 30, 0.06),
        0 24px 48px -16px rgba(10, 15, 30, 0.15);

    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.35s var(--ease),
        transform 0.5s var(--ease-spring);
    pointer-events: none;
}

.ppdb-floating.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.ppdb-floating.is-hiding {
    opacity: 0;
    transform: translateY(30px);
    pointer-events: none;
}

@media (min-width: 769px) {
    .ppdb-floating {
        left: auto;
        right: 24px;
        bottom: 24px;
        width: 320px;
        padding: 16px 18px 14px 20px;
        border-radius: 16px;
    }
}


/* ==========================================================================
   BADGE STATUS — bulat kecil dengan dot pulse
   ========================================================================== */

.ppdb-floating-badge {
    grid-column: 1;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--primary-alpha);
    border-radius: var(--r-full);
    font-family: var(--font-body);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary);
    white-space: nowrap;
    align-self: center;
    justify-self: start;
}

@media (min-width: 769px) {
    .ppdb-floating-badge {
        font-size: 0.68rem;
    }
}

.ppdb-floating-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    animation: ppdbPulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes ppdbPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.85); }
}


/* ==========================================================================
   KONTEN — judul + meta
   ========================================================================== */

.ppdb-floating-content {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ppdb-floating-title {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 769px) {
    .ppdb-floating-title {
        font-size: 0.95rem;
    }
}

.ppdb-floating-meta {
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 769px) {
    .ppdb-floating-meta {
        font-size: 0.78rem;
    }
}


/* ==========================================================================
   TOMBOL TUTUP — X kecil di pojok kanan atas
   ========================================================================== */

.ppdb-floating-close {
    grid-column: 3;
    grid-row: 1;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-soft);
    border: none;
    border-radius: 50%;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    transition: all 0.25s var(--ease);
    align-self: center;
    justify-self: end;
    -webkit-tap-highlight-color: transparent;
}

.ppdb-floating-close:hover {
    background: var(--bg-alt);
    color: var(--text);
    transform: rotate(90deg);
}

@media (hover: none) {
    .ppdb-floating-close:hover {
        transform: none;
    }
}


/* ==========================================================================
   TOMBOL "LIHAT DETAIL"
   ========================================================================== */

.ppdb-floating-btn {
    grid-column: 1 / -1;
    grid-row: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
    padding: 10px 16px;
    background: var(--primary);
    color: #ffffff;
    border-radius: var(--r-full);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--t-base) var(--ease);
    box-shadow: 0 6px 16px -6px var(--primary-glow);
}

@media (min-width: 769px) {
    .ppdb-floating-btn {
        padding: 11px 20px;
        font-size: 0.85rem;
        margin-top: 8px;
    }
}

.ppdb-floating-btn:hover {
    filter: brightness(0.92);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -6px var(--primary-glow-strong);
}

.ppdb-floating-btn:active {
    transform: translateY(0) scale(0.98);
}

.ppdb-floating-btn i {
    font-size: 0.95em;
    transition: transform 0.3s var(--ease);
}

.ppdb-floating-btn:hover i {
    transform: translateX(3px);
}


/* ==========================================================================
   STATUS TUTUP / SELESAI
   ========================================================================== */

.ppdb-floating.is-closed {
    border-left-color: var(--text-soft);
}

.ppdb-floating.is-closed .ppdb-floating-badge {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-soft);
}

.ppdb-floating.is-closed .ppdb-floating-dot {
    animation: none;
    box-shadow: none;
}

.ppdb-floating.is-closed .ppdb-floating-btn {
    background: var(--bg-alt);
    color: var(--text);
    box-shadow: none;
    border: 1px solid var(--border);
}


/* ==========================================================================
   AUTO-HIDE SAAT SCROLL
   ========================================================================== */

.ppdb-floating.is-scrolling {
    opacity: 0.15;
    transition: opacity 0.2s var(--ease);
}

.ppdb-floating.is-scrolling .ppdb-floating-btn {
    pointer-events: none;
}


/* ==========================================================================
   PADDING BODY — biar konten terakhir tidak ketutup floating bar
   ========================================================================== */

body.has-ppdb-floating {
    padding-bottom: 150px;
}

@media (min-width: 769px) {
    body.has-ppdb-floating {
        padding-bottom: 0;
    }
}


/* ==========================================================================
   HIDE saat modal / search / sidebar terbuka
   ========================================================================== */

body.ppdb-hide-floating .ppdb-floating {
    opacity: 0;
    transform: translateY(30px);
    pointer-events: none;
}


/* ==========================================================================
   DARK MODE
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .ppdb-floating {
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.3),
            0 24px 48px -16px rgba(0, 0, 0, 0.6);
    }
}


/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .ppdb-floating,
    .ppdb-floating-close,
    .ppdb-floating-btn,
    .ppdb-floating-dot {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}


/* ==========================================================================
   PRINT STYLE
   ========================================================================== */

@media print {
    .main-header,
    .sidebar-nav,
    .sidebar,
    .sidebar-overlay,
    .search-wrapper-mobile,
    .back-to-top,
    .scroll-progress,
    .fab-container,
    .ppdb-floating,
    .modal-notif {
        display: none !important;
    }

    #content-router {
        margin-top: 0 !important;
        min-height: 0 !important;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 12pt;
    }

    h1, h2, h3, h4, h5, h6 {
        color: #000000 !important;
    }

    a {
        color: #000000 !important;
        text-decoration: underline;
    }

    .card-premium,
    .layanan-card-compact,
    .artikel-card-list,
    .artikel-card-beranda {
        box-shadow: none !important;
        border: 1px solid #cccccc !important;
    }

    .section-block {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}