/* =====================================================================
   BAITUL MAQDIS ACADEMY — Stylesheet utama
   Palet: hijau zaitun (identitas Palestina), hitam, merah aksen, krem.
   ===================================================================== */

:root {
    --green-900: #0a3d2c;
    --green-800: #0d5240;
    --green-700: #116b52;
    --green-600: #16866a;
    --green-100: #e3f2ec;
    --green-050: #f2f8f5;

    --red-600:   #c0392b;
    --red-100:   #fdecea;

    --gold-600:  #b8860b;
    --gold-100:  #fdf5e2;

    --ink-900:   #14181b;
    --ink-700:   #3c4449;
    --ink-500:   #6b757c;
    --ink-300:   #aeb6bb;
    --ink-200:   #d8dee1;
    --ink-100:   #eef1f3;
    --paper:     #f7f8f7;
    --white:     #ffffff;

    --radius-sm: 6px;
    --radius:    12px;
    --radius-lg: 18px;

    --shadow-sm: 0 1px 2px rgba(20, 24, 27, .06);
    --shadow:    0 4px 16px rgba(20, 24, 27, .08);
    --shadow-lg: 0 12px 32px rgba(20, 24, 27, .12);

    --max: 1280px;
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --serif: "Georgia", "Times New Roman", serif;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink-900);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-800); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.18; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.022em; }
h1 { font-size: clamp(1.85rem, 3.2vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 2.1vw, 1.85rem); }
h3 { font-size: 1.16rem; }
p  { margin: 0 0 1em; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 0 20px; }

.section { padding: clamp(56px, 7vw, 96px) 0; }
.section-tight { padding: clamp(32px, 4vw, 56px) 0; }

.section-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 30px; flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-size: clamp(1.4rem, 2.3vw, 2rem); }
.section-head .eyebrow {
    display: block; font-size: .74rem; font-weight: 700; letter-spacing: .2em;
    text-transform: uppercase; color: var(--green-600); margin-bottom: 8px;
}
.section-head a { font-size: .875rem; font-weight: 600; white-space: nowrap; }

.muted { color: var(--ink-500); }
.small { font-size: .875rem; }
.tiny  { font-size: .78rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }

/* ---------------------------------------------------------------- Header */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--ink-100);
    position: sticky; top: 0; z-index: 50;
}
.header-inner {
    display: flex; align-items: center; gap: 20px;
    height: 74px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--green-900); }
.brand:hover { text-decoration: none; }
.brand-mark {
    height: 40px; width: auto; flex: none;
    object-fit: contain;
    display: block;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: .95rem; letter-spacing: -.01em; }
.brand-text span { font-size: .68rem; color: var(--ink-500); font-weight: 500; }

.main-nav { display: flex; gap: 4px; margin-left: 8px; }
.main-nav a {
    padding: 9px 14px; border-radius: 999px;
    font-size: .9rem; font-weight: 600; color: var(--ink-700);
}
.main-nav a:hover { background: var(--green-050); color: var(--green-800); text-decoration: none; }
.main-nav a.is-active { background: var(--green-100); color: var(--green-800); }

.header-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-mobile-only { display: none; }

.search-mini { position: relative; }
/* Ditulis dengan selector yang lebih kuat agar tidak tertimpa aturan
   input[type="search"] global di bagian Form — jarak teks ke ikon kaca
   pembesar harus tetap lega. */
.search-mini input[type="search"] {
    width: 240px; padding: 9px 18px 9px 46px;
    border: 1px solid var(--ink-200); border-radius: 999px;
    font-size: .85rem; font-family: inherit; background: var(--paper);
}
.search-mini input:focus { outline: 2px solid var(--green-600); outline-offset: -1px; background: #fff; }
.search-mini::before {
    content: "";
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%236b757c" stroke-width="2.2" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="M20 20l-3.6-3.6"/></svg>') center / contain no-repeat;
    opacity: .75;
    pointer-events: none;
}

.avatar-chip {
    display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px;
    border: 1px solid var(--ink-200); border-radius: 999px; background: #fff;
    font-size: .85rem; font-weight: 600; color: var(--ink-900);
}
.avatar-chip:hover { border-color: var(--green-600); text-decoration: none; }
.avatar {
    width: 28px; height: 28px; border-radius: 50%; flex: none;
    background: var(--green-100); color: var(--green-800);
    display: grid; place-items: center; font-size: .72rem; font-weight: 700;
    object-fit: cover;
}
.avatar-lg { width: 72px; height: 72px; font-size: 1.4rem; }

.nav-toggle {
    display: none; background: none; border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm); padding: 7px 10px; cursor: pointer; font-size: 1.1rem;
}

/* ---------------------------------------------------------------- Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border-radius: 999px;
    font-size: .9rem; font-weight: 700; font-family: inherit;
    border: 1px solid transparent; cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
    text-align: center;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--green-800); color: #fff; }
.btn-primary:hover { background: var(--green-900); color: #fff; }
.btn-outline { background: #fff; color: var(--green-800); border-color: var(--ink-200); }
.btn-outline:hover { border-color: var(--green-600); color: var(--green-900); }
.btn-ghost { background: transparent; color: var(--ink-700); }
.btn-ghost:hover { background: var(--ink-100); color: var(--ink-900); }
.btn-danger { background: var(--red-600); color: #fff; }
.btn-danger:hover { background: #a5301f; color: #fff; }
.btn-light { background: #fff; color: var(--green-900); }
.btn-sm { padding: 8px 16px; font-size: .8rem; }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

/* ---------------------------------------------------------------- Hero
   Carousel geser. Gambar tampil penuh tanpa diredupkan; hanya sisi teks
   yang diberi peredam gradien agar judul tetap terbaca.
   ------------------------------------------------------------------- */
.hero {
    position: relative;
    background: var(--green-900);
    color: #fff;
    overflow: hidden;
}

.hero-viewport { overflow: hidden; }

.hero-track {
    display: flex;
    transition: transform .85s cubic-bezier(.22, .61, .36, 1);
    will-change: transform;
}

.hero-slide {
    position: relative;
    flex: 0 0 100%;
    min-width: 100%;
    height: clamp(440px, 62vh, 660px);
}

.hero-media { position: absolute; inset: 0; background: var(--green-900); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

/* Peredam hanya di sisi kiri — sisi kanan gambar tetap jernih. */
.hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg,
            rgba(8, 40, 30, .92) 0%,
            rgba(8, 40, 30, .78) 26%,
            rgba(8, 40, 30, .38) 50%,
            rgba(8, 40, 30, .04) 70%,
            transparent 84%);
}

.hero-inner {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.hero-content { max-width: 580px; padding: 32px 0 72px; }

.hero-kicker {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .78);
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gold-600);
}

.hero h1 {
    font-size: clamp(1.9rem, 3.9vw, 3.1rem);
    line-height: 1.08;
    letter-spacing: -.025em;
    color: #fff;
    margin-bottom: 16px;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .3);
}

.hero p {
    font-size: clamp(.98rem, 1.2vw, 1.12rem);
    color: rgba(255, 255, 255, .9);
    max-width: 480px;
    margin-bottom: 26px;
    text-shadow: 0 1px 12px rgba(0, 0, 0, .35);
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-hero-ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, .55);
}
.btn-hero-ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; border-color: #fff; }

.hero-controls {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.hero-dots { display: flex; gap: 10px; }
.hero-dots button {
    width: 44px; height: 3px;
    border: 0; padding: 0; border-radius: 3px;
    background: rgba(255, 255, 255, .34);
    cursor: pointer;
    transition: background .25s ease;
}
.hero-dots button:hover { background: rgba(255, 255, 255, .6); }

/* Titik aktif terisi perlahan selama slide ditampilkan, sehingga terlihat
   jelas bahwa hero berpindah sendiri dan kapan pergantian berikutnya. */
.hero-dots button { position: relative; overflow: hidden; }
.hero-dots button::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 0;
    background: #fff;
    border-radius: 3px;
}
.hero-dots button.is-active::after {
    animation: hero-progress var(--hero-duration, 10s) linear forwards;
}

@keyframes hero-progress {
    from { width: 0; }
    to   { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-dots button.is-active::after { animation: none; width: 100%; }
}

.hero-arrows { display: flex; gap: 8px; }
.hero-arrows button {
    width: 42px; height: 42px;
    border: 1px solid rgba(255, 255, 255, .4);
    background: rgba(0, 0, 0, .16);
    color: #fff;
    border-radius: 50%;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .2s ease, border-color .2s ease;
}
.hero-arrows button:hover { background: rgba(255, 255, 255, .22); border-color: #fff; }

@media (max-width: 760px) {
    .hero-slide { height: clamp(420px, 76vh, 560px); }
    .hero-media::after {
        background: linear-gradient(180deg,
            rgba(8, 40, 30, .55) 0%, rgba(8, 40, 30, .72) 45%, rgba(8, 40, 30, .93) 100%);
    }
    .hero-inner { align-items: flex-end; }
    .hero-content { padding-bottom: 84px; }
    .hero-arrows { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-track { transition: none; }
}

/* ---------------------------------------------------------------- Cards */
.grid { display: grid; gap: clamp(18px, 2vw, 28px); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: #fff; border: 0; border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 0 0 1px rgba(20, 24, 27, .06);
    transition: box-shadow .28s ease, transform .28s ease;
}
.card:hover { box-shadow: 0 14px 38px rgba(20, 24, 27, .14); transform: translateY(-3px); }
.card .card-media img { transition: transform .6s cubic-bezier(.22,.61,.36,1); }
.card:hover .card-media img { transform: scale(1.05); }
.card-media { position: relative; aspect-ratio: 16 / 10; background: var(--green-050); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
/* Poster kajian berorientasi potret, beri ruang lebih tinggi. */
.card-media.is-poster { aspect-ratio: 3 / 4; }
.card-media .placeholder {
    width: 100%; height: 100%; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--green-100), var(--green-050));
    color: var(--green-700); font-size: .8rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; text-align: center; padding: 12px;
}
.card-body { padding: 20px 22px 22px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 1.08rem; margin-bottom: 8px; line-height: 1.3; }
.card-body h3 a { color: var(--ink-900); }
.card-body h3 a:hover { color: var(--green-800); text-decoration: none; }
.card-meta {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    font-size: .78rem; color: var(--ink-500); margin-top: auto; padding-top: 12px;
}
.card-excerpt { font-size: .88rem; color: var(--ink-700); margin-bottom: 10px; }

.tag {
    display: inline-block; padding: 3px 9px; border-radius: 999px;
    font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    background: var(--green-100); color: var(--green-800);
}
.tag-red   { background: var(--red-100);   color: var(--red-600); }
.tag-gold  { background: var(--gold-100);  color: var(--gold-600); }
.tag-grey  { background: var(--ink-100);   color: var(--ink-700); }
.tag-float { position: absolute; top: 10px; left: 10px; z-index: 2; background: rgba(255,255,255,.94); }

/* ---------------------------------------------------------------- Progress */
.progress-bar { height: 7px; border-radius: 99px; background: var(--ink-100); overflow: hidden; }
.progress-bar span {
    display: block; height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, var(--green-700), var(--green-600));
    transition: width .4s ease;
}
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress-row .progress-bar { flex: 1; }
.progress-value { font-size: .8rem; font-weight: 700; color: var(--green-800); min-width: 38px; text-align: right; }

.continue-card {
    background: linear-gradient(120deg, var(--green-900), var(--green-700));
    color: #fff; border-radius: var(--radius); padding: 22px 24px;
    display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
}
.continue-card h3 { color: #fff; margin-bottom: 4px; }
.continue-card .progress-bar { background: rgba(255,255,255,.22); }
.continue-card .progress-bar span { background: #fff; }
.continue-card .progress-value { color: #fff; }
.continue-card .continue-info { flex: 1; min-width: 240px; }

/* ---------------------------------------------------------------- Segment & level */
.segment-card {
    background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius);
    padding: 24px 22px; text-align: center; transition: .18s ease;
}
.segment-card:hover { border-color: var(--green-600); box-shadow: var(--shadow); transform: translateY(-2px); }
.segment-icon {
    width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 50%;
    background: var(--green-050); display: grid; place-items: center; font-size: 1.6rem;
}
.segment-card h3 { margin-bottom: 4px; font-size: 1.05rem; }

.level-track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.level-step {
    background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius);
    padding: 20px; position: relative;
}
.level-step.is-locked { background: var(--ink-100); color: var(--ink-500); }
.level-step .step-no {
    width: 30px; height: 30px; border-radius: 50%; background: var(--green-800); color: #fff;
    display: grid; place-items: center; font-size: .82rem; font-weight: 700; margin-bottom: 10px;
}
.level-step.is-locked .step-no { background: var(--ink-300); }

/* ---------------------------------------------------------------- Lists */
.event-row {
    display: flex; gap: 18px; align-items: flex-start;
    background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius);
    padding: 18px 20px; transition: .15s ease;
}
.event-row:hover { border-color: var(--green-600); box-shadow: var(--shadow-sm); }
.event-date {
    flex: none; min-width: 62px; text-align: center;
    border-right: 1px solid var(--ink-100); padding-right: 14px;
    white-space: nowrap;
}
.event-date strong {
    display: block; font-size: 1.5rem; line-height: 1;
    color: var(--green-800); white-space: nowrap;
}
.event-date span { font-size: .7rem; font-weight: 700; letter-spacing: .08em; color: var(--ink-500); }
/* Cuplikan flyer kajian — bisa diklik langsung ke halaman detail. */
.event-thumb {
    flex: none; width: 78px; height: 96px; border-radius: var(--radius-sm);
    overflow: hidden; background: var(--paper); display: block;
}
/* contain, bukan cover: flyer kajian ada yang potret dan ada yang lanskap —
   keduanya harus tampil utuh, tidak terpotong. */
.event-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .35s ease; }
.event-thumb:hover img { transform: scale(1.06); }
@media (max-width: 560px) { .event-thumb { width: 60px; height: 74px; } }

.event-body { flex: 1; min-width: 0; }
.event-body h3 { font-size: 1.02rem; margin-bottom: 3px; }
.event-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stat-box {
    background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius);
    padding: 22px; text-align: center;
}
.stat-box strong { display: block; font-size: 1.9rem; color: var(--green-800); line-height: 1.15; }
.stat-box span { font-size: .82rem; color: var(--ink-500); font-weight: 600; }

/* ---------------------------------------------------------------- Lesson page */
.lesson-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.video-frame {
    position: relative; aspect-ratio: 16 / 9; background: #000;
    border-radius: var(--radius); overflow: hidden;
}
.video-frame iframe, .video-frame video { width: 100%; height: 100%; border: 0; display: block; }
.video-empty { width: 100%; height: 100%; display: grid; place-items: center; color: #7d878d; font-size: .9rem; }

.breadcrumb { font-size: .82rem; color: var(--ink-500); margin-bottom: 10px; }
.breadcrumb a { color: var(--ink-500); }
.breadcrumb a:hover { color: var(--green-700); }

.chapter-label {
    font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
    color: var(--green-600); margin-bottom: 4px;
}

.interaction-bar {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    padding: 14px 0; border-bottom: 1px solid var(--ink-100); margin-bottom: 22px;
}
.like-btn {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 15px;
    border: 1px solid var(--ink-200); border-radius: 999px; background: #fff;
    font-size: .85rem; font-weight: 700; font-family: inherit; color: var(--ink-700); cursor: pointer;
    transition: .15s ease;
}
.like-btn:hover { border-color: var(--red-600); color: var(--red-600); }
.like-btn.is-liked { background: var(--red-100); border-color: var(--red-600); color: var(--red-600); }

.content-body { font-size: 1.02rem; line-height: 1.8; color: var(--ink-900); }
.content-body h2 { font-size: 1.3rem; margin-top: 1.6em; }
.content-body h3 { font-size: 1.1rem; margin-top: 1.4em; }
.content-body img { border-radius: var(--radius); margin: 1.4em 0; }
.content-body blockquote {
    margin: 1.5em 0; padding: 4px 0 4px 20px;
    border-left: 3px solid var(--green-600); color: var(--ink-700); font-style: italic;
}
.content-body ul, .content-body ol { padding-left: 22px; }
.content-body li { margin-bottom: .4em; }
.content-body table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .92rem; }
.content-body th, .content-body td { border: 1px solid var(--ink-200); padding: 9px 12px; text-align: left; }
.content-body th { background: var(--green-050); }

.asset-item {
    display: flex; align-items: center; gap: 14px;
    background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius);
    padding: 14px 16px; margin-bottom: 10px;
}
.asset-icon {
    width: 42px; height: 42px; border-radius: 10px; flex: none;
    background: var(--green-050); color: var(--green-700);
    display: grid; place-items: center; font-size: 1.15rem;
}
.asset-item .asset-info { flex: 1; min-width: 0; }
.asset-item h4 { margin: 0 0 2px; font-size: .93rem; }

.lesson-nav { display: flex; justify-content: space-between; gap: 14px; margin: 32px 0; flex-wrap: wrap; }
.lesson-nav a {
    flex: 1; min-width: 200px; padding: 14px 18px; background: #fff;
    border: 1px solid var(--ink-100); border-radius: var(--radius);
}
.lesson-nav a:hover { border-color: var(--green-600); text-decoration: none; }
.lesson-nav .dir { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-500); }
.lesson-nav .ttl { font-size: .92rem; font-weight: 600; color: var(--ink-900); }
.lesson-nav .next { text-align: right; }

/* Sidebar kurikulum */
.curriculum {
    background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius);
    overflow: hidden; position: sticky; top: 94px;
}
.curriculum-head { padding: 16px 18px; border-bottom: 1px solid var(--ink-100); background: var(--green-050); }
.curriculum-head h3 { margin: 0 0 8px; font-size: .95rem; }
.curriculum-body { max-height: 62vh; overflow-y: auto; }
.chapter-group { border-bottom: 1px solid var(--ink-100); }
.chapter-group:last-child { border-bottom: 0; }
.chapter-title {
    padding: 12px 18px 6px; font-size: .74rem; font-weight: 800;
    letter-spacing: .1em; text-transform: uppercase; color: var(--ink-500);
}
.lesson-link {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 9px 18px; font-size: .87rem; color: var(--ink-700); line-height: 1.4;
}
.lesson-link:hover { background: var(--green-050); text-decoration: none; color: var(--green-800); }
.lesson-link.is-current { background: var(--green-100); color: var(--green-900); font-weight: 700; }
.lesson-state { flex: none; width: 18px; text-align: center; font-size: .85rem; }
.state-done { color: var(--green-600); }
.state-active { color: var(--green-800); }
.state-todo { color: var(--ink-300); }

/* ---------------------------------------------------------------- Comments */
.comment-form textarea {
    width: 100%; min-height: 96px; padding: 12px 14px; font-family: inherit; font-size: .93rem;
    border: 1px solid var(--ink-200); border-radius: var(--radius-sm); resize: vertical;
}
.comment-form textarea:focus { outline: 2px solid var(--green-600); outline-offset: -1px; }

.comment { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--ink-100); }
.comment:last-child { border-bottom: 0; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.comment-head strong { font-size: .92rem; }
.comment-text { font-size: .93rem; color: var(--ink-700); margin-bottom: 8px; white-space: pre-line; }
.comment-actions { display: flex; gap: 14px; font-size: .8rem; }
.comment-actions button {
    background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
    font-size: .8rem; font-weight: 600; color: var(--ink-500);
}
.comment-actions button:hover { color: var(--green-700); }
.comment-replies { margin-top: 14px; padding-left: 18px; border-left: 2px solid var(--ink-100); }
.reply-form { margin-top: 12px; display: none; }
.reply-form.is-open { display: block; }

/* ---------------------------------------------------------------- Forms */
.form-group { margin-bottom: 18px; }
.form-group > label {
    display: block; font-size: .85rem; font-weight: 700; margin-bottom: 6px; color: var(--ink-900);
}
.form-control, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], input[type="date"], input[type="time"],
input[type="search"], select, textarea {
    width: 100%; padding: 11px 13px; font-family: inherit; font-size: .93rem;
    border: 1px solid var(--ink-200); border-radius: var(--radius-sm);
    background: #fff; color: var(--ink-900);
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-500) 50%), linear-gradient(135deg, var(--ink-500) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.form-control:focus, input:focus, select:focus, textarea:focus { outline: 2px solid var(--green-600); outline-offset: -1px; }
textarea { min-height: 110px; resize: vertical; }
.form-help { font-size: .78rem; color: var(--ink-500); margin-top: 5px; }
.form-error { font-size: .8rem; color: var(--red-600); margin-top: 5px; font-weight: 600; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-row input { width: 17px; height: 17px; margin-top: 2px; flex: none; accent-color: var(--green-700); }
.checkbox-row label { font-size: .88rem; font-weight: 500; color: var(--ink-700); margin: 0; }
.required { color: var(--red-600); }

.auth-wrap { min-height: calc(100vh - 74px); display: grid; place-items: center; padding: 40px 20px; }
.auth-card {
    width: 100%; max-width: 430px; background: #fff; border: 1px solid var(--ink-100);
    border-radius: var(--radius-lg); padding: 34px 32px; box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 4px; }

/* ---------------------------------------------------------------- Alerts */
.alert {
    padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 14px;
    font-size: .9rem; font-weight: 500; border: 1px solid transparent;
}
.alert-success { background: var(--green-050); border-color: #bfe3d3; color: var(--green-900); }
.alert-error   { background: var(--red-100);  border-color: #f3c3bd; color: #8c2318; }
.alert-warning { background: var(--gold-100); border-color: #eddaa6; color: #7a5a06; }
.alert-info    { background: #eaf2fb; border-color: #c4dcf5; color: #1c4a75; }

/* ---------------------------------------------------------------- Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 32px 0 8px; flex-wrap: wrap; }
.pagination a {
    padding: 8px 14px; border: 1px solid var(--ink-200); border-radius: var(--radius-sm);
    background: #fff; font-size: .87rem; font-weight: 600; color: var(--ink-700);
}
.pagination a:hover { border-color: var(--green-600); color: var(--green-800); text-decoration: none; }
.pagination a.is-active { background: var(--green-800); border-color: var(--green-800); color: #fff; }

/* ---------------------------------------------------------------- Empty */
.empty-state {
    background: #fff; border: 1px dashed var(--ink-200); border-radius: var(--radius);
    padding: 48px 24px; text-align: center; color: var(--ink-500);
}
.empty-state h3 { color: var(--ink-700); font-size: 1.05rem; }

/* ---------------------------------------------------------------- Footer */
.site-footer { background: var(--green-900); color: rgba(255,255,255,.78); margin-top: 56px; padding: 44px 0 26px; }
.site-footer h4 { color: #fff; font-size: .88rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px; }
.site-footer a { color: rgba(255,255,255,.78); font-size: .89rem; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.footer-links { display: flex; flex-direction: column; gap: 7px; }
.footer-bottom {
    margin-top: 32px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.14);
    font-size: .8rem; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}

/* ---------------------------------------------------------------- Program detail */
.program-hero { background: var(--green-900); color: #fff; padding: 40px 0; }
.program-hero h1 { color: #fff; }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 24px 0; }
.fact-box { background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius); padding: 16px 18px; }
.fact-box span { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-500); margin-bottom: 4px; }
.fact-box strong { font-size: 1.12rem; color: var(--green-900); }

.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery-grid img { border-radius: var(--radius-sm); aspect-ratio: 1; object-fit: cover; width: 100%; }

.distribution-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.distribution-item {
    background: var(--green-050); border-radius: var(--radius); padding: 18px; text-align: center;
    font-weight: 700; color: var(--green-900);
}

/* ---------------------------------------------------------------- Article */
.article-hero { max-width: 760px; margin: 0 auto; }
.author-line { display: flex; align-items: center; gap: 12px; margin: 18px 0 26px; }
.author-line .avatar { width: 44px; height: 44px; font-size: .9rem; }
.author-line strong { display: block; font-size: .93rem; }
.author-line span { font-size: .8rem; color: var(--ink-500); }

/* ---------------------------------------------------------------- Product */
.product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }
.product-image { border-radius: var(--radius); overflow: hidden; background: var(--green-050); aspect-ratio: 1; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.price { font-size: 1.9rem; font-weight: 800; color: var(--green-800); }
.rating { color: var(--gold-600); font-size: .9rem; letter-spacing: .1em; }

/* =====================================================================
   ADMIN
   ===================================================================== */
.admin-body { background: var(--paper); }
.admin-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.admin-sidebar {
    background: var(--green-900); color: rgba(255,255,255,.8);
    padding: 20px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-brand { padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 14px; }
.admin-brand strong { display: block; color: #fff; font-size: .92rem; line-height: 1.3; }
.admin-brand span { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.admin-nav-group { padding: 14px 20px 6px; font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.42); }
.admin-nav a {
    display: flex; align-items: center; gap: 10px; padding: 9px 20px;
    font-size: .88rem; color: rgba(255,255,255,.82); font-weight: 500;
}
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.admin-nav a.is-active { background: rgba(255,255,255,.14); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 #fff; }
.admin-nav .badge-count {
    margin-left: auto; background: var(--red-600); color: #fff; border-radius: 999px;
    padding: 1px 7px; font-size: .68rem; font-weight: 700;
}

.admin-main { min-width: 0; }
.admin-topbar {
    background: #fff; border-bottom: 1px solid var(--ink-100);
    padding: 14px 28px; display: flex; align-items: center; gap: 16px;
    position: sticky; top: 0; z-index: 20;
}
.admin-topbar h1 { margin: 0; font-size: 1.15rem; }
.admin-topbar .spacer { margin-left: auto; }

/* Tombol kembali di kepala halaman admin. */
.admin-back {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px 7px 11px; border-radius: 999px;
    background: var(--paper); color: var(--ink-700);
    font-size: .82rem; font-weight: 600; text-decoration: none;
    border: 1px solid var(--ink-100); white-space: nowrap;
    transition: background .18s ease, color .18s ease;
}
.admin-back span[aria-hidden] { font-size: 1.05rem; line-height: 1; transition: transform .2s ease; }
.admin-back:hover { background: var(--green-700); color: #fff; border-color: transparent; }
.admin-back:hover span[aria-hidden] { transform: translateX(-3px); }
@media (max-width: 700px) {
    .admin-back-text { display: none; }
    .admin-back { padding: 7px 11px; }
}
.admin-content { padding: 26px 28px 60px; }

.admin-card { background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius); }
.admin-card-head {
    padding: 16px 20px; border-bottom: 1px solid var(--ink-100);
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.admin-card-head h2 { margin: 0; font-size: 1rem; }
.admin-card-head .spacer { margin-left: auto; }
.admin-card-body { padding: 20px; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th {
    text-align: left; padding: 11px 16px; background: var(--green-050);
    font-size: .74rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-700);
    border-bottom: 1px solid var(--ink-100); white-space: nowrap;
}
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--ink-100); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #fbfcfb; }
table.data .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
table.data .cell-main { font-weight: 600; color: var(--ink-900); }

.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: .72rem; font-weight: 700; text-transform: capitalize;
    background: var(--ink-100); color: var(--ink-700);
}
.badge-published, .badge-active, .badge-approved, .badge-available, .badge-upcoming { background: var(--green-100); color: var(--green-800); }
.badge-draft, .badge-pending, .badge-preorder, .badge-inactive { background: var(--gold-100); color: var(--gold-600); }
.badge-rejected, .badge-spam, .badge-banned, .badge-cancelled, .badge-out_of_stock { background: var(--red-100); color: var(--red-600); }
.badge-review, .badge-ongoing { background: #eaf2fb; color: #1c4a75; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.metric {
    background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius); padding: 18px 20px;
}
.metric span { font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-500); }
.metric strong { display: block; font-size: 1.7rem; color: var(--green-800); line-height: 1.2; margin-top: 4px; }
.metric.is-alert strong { color: var(--red-600); }

.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-bar select, .filter-bar input { width: auto; min-width: 180px; }

.inline-form { display: inline; }

.admin-form-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; align-items: start; }
.thumb-preview {
    max-width: 220px; border-radius: var(--radius-sm); border: 1px solid var(--ink-200); margin-bottom: 8px;
}

.subnav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.subnav a {
    padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--ink-200);
    font-size: .84rem; font-weight: 600; color: var(--ink-700);
}
.subnav a.is-active { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.subnav a:hover { text-decoration: none; border-color: var(--green-600); }

/* ---------------------------------------------------------------- Responsive */
/* Header beralih ke menu ringkas lebih awal daripada tata letak isi,
   karena baris brand + navigasi + pencarian + tombol sudah tidak muat
   pada lebar tablet. */
@media (max-width: 940px) {
    .main-nav {
        display: none; position: absolute; top: 74px; left: 0; right: 0;
        background: #fff; flex-direction: column; padding: 12px;
        border-bottom: 1px solid var(--ink-100); box-shadow: var(--shadow);
        gap: 2px;
    }
    .main-nav.is-open { display: flex; }
    .main-nav a { padding: 13px 16px; font-size: .95rem; }
    .nav-toggle { display: block; order: 3; }

    /* Baris header dijaga tetap ringkas: pencarian dan tombol akun
       dipindahkan ke dalam menu agar tidak mendorong halaman melebar. */
    .search-mini { display: none; }
    .header-tools > .btn { display: none; }
    .brand-text span { display: none; }
    .nav-mobile-only { display: block; }
    .nav-cta {
        margin-top: 6px; background: var(--green-800); color: #fff;
        text-align: center; font-weight: 700;
    }
    .nav-cta:hover { background: var(--green-900); color: #fff; }
}

@media (max-width: 980px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .lesson-layout { grid-template-columns: 1fr; }
    .curriculum { position: static; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; height: auto; }
    .admin-form-grid { grid-template-columns: 1fr; }
    .fact-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .product-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .level-track, .stat-grid, .distribution-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.9rem; }
    .hero-content { padding: 48px 0 54px; }
    .footer-grid { grid-template-columns: 1fr; }
    .admin-content, .admin-topbar { padding-left: 16px; padding-right: 16px; }
}

@media print {
    .site-header, .site-footer, .admin-sidebar, .btn, .interaction-bar { display: none !important; }
}

/* =====================================================================
   KOLASE BERGERAK
   Mosaik cross-fade (halaman detail) + strip berjalan (beranda) + lightbox
   ===================================================================== */

/* ---------------------------------------------------------- Mosaik */
.collage {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, minmax(110px, 1fr));
    gap: 10px;
    aspect-ratio: 16 / 8;
}

.collage-cell {
    position: relative;
    overflow: hidden;
    border: 0;
    padding: 0;
    margin: 0;
    border-radius: var(--radius-sm);
    background: var(--green-050);
    cursor: zoom-in;
    font: inherit;
    display: block;
}
.collage-cell-lg { grid-column: span 2; grid-row: span 2; border-radius: var(--radius); }

.collage-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .85s ease;
}
.collage-layer.is-active { opacity: 1; }

.collage-cell::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(10, 61, 44, .35));
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}
.collage-cell:hover::after,
.collage-cell:focus-visible::after { opacity: 1; }
.collage-cell:focus-visible { outline: 3px solid var(--green-600); outline-offset: 2px; }

.collage-note { margin: 10px 0 0; }

/* ---------------------------------------------------------- Strip berjalan */
.marquee {
    position: relative;
    overflow: hidden;
    padding: 4px 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.marquee-track {
    display: flex;
    gap: 14px;
    width: max-content;
    animation: marquee-scroll var(--marquee-duration, 44s) linear infinite;
}
.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track { animation-play-state: paused; }

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.marquee-item {
    position: relative;
    flex: none;
    width: 300px;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--green-050);
    display: block;
    text-decoration: none;
}
.marquee-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.marquee-item:hover img { transform: scale(1.06); }
.marquee-item:hover { text-decoration: none; }

.marquee-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 26px 13px 11px;
    background: linear-gradient(180deg, transparent, rgba(10, 61, 44, .9));
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.35;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------------------------------------------------------- Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(10, 18, 15, .93);
    display: grid;
    grid-template-rows: 1fr auto;
    place-items: center;
    padding: 24px 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox img {
    max-width: min(1100px, 94vw);
    max-height: 78vh;
    border-radius: var(--radius);
    object-fit: contain;
}
.lightbox-caption {
    color: rgba(255, 255, 255, .85);
    font-size: .9rem;
    text-align: center;
    max-width: 620px;
    margin: 16px auto 0;
    line-height: 1.5;
}
.lightbox-counter {
    display: block;
    font-size: .75rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .5);
    margin-bottom: 6px;
}
.lightbox button {
    position: absolute;
    background: rgba(255, 255, 255, .12);
    border: 0;
    color: #fff;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .18s ease;
}
.lightbox button:hover { background: rgba(255, 255, 255, .26); }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev  { left: 20px;  top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 20px; top: 50%; transform: translateY(-50%); }

@media (max-width: 760px) {
    .collage {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, minmax(96px, 1fr));
        aspect-ratio: 3 / 3.2;
    }
    .collage-cell-lg { grid-column: span 2; grid-row: span 1; }
    .marquee-item { width: 210px; }
    .lightbox-prev, .lightbox-next { top: auto; bottom: 22px; transform: none; }
    .lightbox-prev { left: 24px; }
    .lightbox-next { right: 24px; }
}

/* Hormati preferensi pengguna yang menonaktifkan animasi. */
@media (prefers-reduced-motion: reduce) {
    .marquee-track { animation: none; }
    .collage-cell img { transition: none; transform: none; }
    .lightbox { transition: none; }
}

.event-date-to { font-size: 1.5rem; font-weight: 700; color: var(--green-600); }

/* =====================================================================
   PENYELARASAN AKHIR
   Ruang bernapas, fokus keyboard yang jelas, dan detail kecil yang
   membuat halaman terasa tenang saat dibaca.
   ===================================================================== */

/* Fokus keyboard terlihat di seluruh elemen interaktif. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--green-600);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Judul bagian dengan garis tipis pemisah, seperti katalog cetak. */
.section-head { border-bottom: 1px solid var(--ink-100); padding-bottom: 16px; }
.section-head.is-plain { border-bottom: 0; padding-bottom: 0; }

/* Tautan "lihat semua" dengan panah yang bergeser saat disentuh kursor. */
.section-head a { display: inline-flex; align-items: center; gap: 6px; }
.section-head a::after { content: "→"; transition: transform .25s ease; }
.section-head a:hover { text-decoration: none; }
.section-head a:hover::after { transform: translateX(4px); }

/* Kartu: judul naik sedikit saat kursor di atas kartu. */
.card-body h3 a { transition: color .2s ease; }

/* Penanda bagian yang berlatar putih agar batasnya lembut. */
.section + .section { border-top: 1px solid rgba(20, 24, 27, .05); }

/* Gambar tidak pernah melompat sebelum dimuat. */
.card-media, .collage-cell, .marquee-item, .product-image { background-color: var(--green-050); }

/* Teks panjang lebih nyaman dibaca. */
.content-body { max-width: 68ch; }
.content-body p { margin-bottom: 1.15em; }

/* Baris fakta program lebih tenang. */
.fact-box { box-shadow: 0 0 0 1px rgba(20, 24, 27, .06); border: 0; }
.stat-box { box-shadow: 0 0 0 1px rgba(20, 24, 27, .06); border: 0; }
.stat-box strong { font-size: clamp(1.7rem, 2.6vw, 2.3rem); letter-spacing: -.03em; }

/* Baris kajian. */
.event-row { border: 0; box-shadow: 0 0 0 1px rgba(20, 24, 27, .06); }
.event-row:hover { box-shadow: 0 8px 26px rgba(20, 24, 27, .1); }

/* Kartu segmentasi. */
.segment-card { border: 0; box-shadow: 0 0 0 1px rgba(20, 24, 27, .06); }
.segment-card:hover { box-shadow: 0 12px 32px rgba(20, 24, 27, .12); }

/* Level. */
.level-step { border: 0; box-shadow: 0 0 0 1px rgba(20, 24, 27, .06); }

/* Panel admin. */
.admin-card { border: 0; box-shadow: 0 0 0 1px rgba(20, 24, 27, .07); }
.admin-content { padding: 28px clamp(16px, 3vw, 34px) 72px; }

/* Lewati ke konten untuk pengguna keyboard dan pembaca layar. */
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 300;
    background: var(--green-800); color: #fff;
    padding: 12px 20px; border-radius: 0 0 var(--radius-sm) 0;
    font-weight: 700; font-size: .9rem;
}
.skip-link:focus { left: 0; text-decoration: none; }

/* Kotak penanda lokasi folder pada halaman Cek Berkas. */
.admin-path {
    display: inline-block;
    margin-top: 14px;
    padding: 10px 16px;
    background: var(--green-050);
    border-left: 3px solid var(--green-600);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .88rem;
    font-weight: 600;
    color: var(--green-900);
}
table.data code, .admin-card code {
    background: var(--ink-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Kartu foto pada pengelolaan galeri di admin. */
.gallery-manage { position: relative; }
.gallery-manage img { border-radius: var(--radius-sm); aspect-ratio: 1; object-fit: cover; width: 100%; }
.gallery-manage-delete { position: absolute; top: 6px; right: 6px; }
.gallery-manage-caption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 18px 10px 8px;
    background: linear-gradient(180deg, transparent, rgba(10, 61, 44, .9));
    color: #fff; font-size: .72rem; line-height: 1.3;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------------------------------------------------------- Galeri produk */
.product-gallery { position: relative; }
.product-image { cursor: zoom-in; }
.product-image img { transition: opacity .3s ease; }

.product-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.product-thumb {
    position: relative;
    padding: 0;
    border: 0;
    background: var(--green-050);
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(20, 24, 27, .08);
    transition: box-shadow .2s ease, transform .2s ease;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-thumb:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--green-600); }
.product-thumb.is-active { box-shadow: 0 0 0 2px var(--green-800); }

.product-photo-caption { margin: 10px 0 0; min-height: 1.2em; }

/* ---------------------------------------------------------- Identitas */
.footer-logo {
    width: 190px; height: auto; margin-bottom: 16px;
    /* logo berlatar terang, dibuat putih agar kontras di footer hijau */
    filter: brightness(0) invert(1);
    opacity: .94;
}

.admin-brand img { margin-bottom: 10px; }

/* ---------------------------------------------------------- Tombol kembali */
.back-bar { padding: 20px 0 0; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px 9px 14px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(20, 24, 27, .1);
    font-size: .88rem;
    font-weight: 600;
    color: var(--ink-700);
    transition: box-shadow .2s ease, color .2s ease, transform .2s ease;
}
.back-link:hover {
    text-decoration: none;
    color: var(--green-800);
    box-shadow: 0 0 0 1px var(--green-600);
}
.back-link .back-arrow { transition: transform .2s ease; font-size: 1.1rem; line-height: 1; }
.back-link:hover .back-arrow { transform: translateX(-3px); }

/* Versi terang untuk halaman berlatar gelap. */
.back-link.is-light {
    background: rgba(255, 255, 255, .14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .34);
    color: #fff;
}
.back-link.is-light:hover { background: rgba(255, 255, 255, .24); color: #fff; box-shadow: inset 0 0 0 1px #fff; }

/* ---------------------------------------------------------- Kartu yang bisa diklik */
.card-media-link { display: block; position: relative; height: 100%; }
.card-media-link::after {
    content: "";
    position: absolute; inset: 0;
    background: rgba(10, 61, 44, 0);
    transition: background .25s ease;
}
.card:hover .card-media-link::after { background: rgba(10, 61, 44, .08); }

/* ---------------------------------------------------------- Panah galeri produk */
.product-image { position: relative; }

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px; height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--green-900);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 12px rgba(20, 24, 27, .18);
    /* Selalu terlihat supaya jelas bahwa foto bisa digeser. */
    opacity: .82;
    transition: opacity .22s ease, background .2s ease, transform .2s ease;
    z-index: 2;
}
.product-gallery:hover .gallery-nav,
.gallery-nav:focus-visible { opacity: 1; }
.gallery-nav:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.gallery-nav-prev { left: 12px; }
.gallery-nav-next { right: 12px; }

.gallery-counter {
    position: absolute;
    right: 12px; bottom: 12px;
    background: rgba(10, 61, 44, .82);
    color: #fff;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
    z-index: 2;
}

/* Di layar sentuh panah selalu terlihat — tidak ada kursor untuk memunculkannya. */
@media (hover: none) {
    .gallery-nav { opacity: 1; }
}

/* =====================================================================
   UJIAN, SERTIFIKAT & KOMUNITAS
   ===================================================================== */

/* Garis waktu empat tahap kelulusan. */
.stage-track {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.stage-item {
    display: flex; align-items: flex-start; gap: 12px;
    background: #fff; border-radius: var(--radius); padding: 16px 18px;
    box-shadow: 0 0 0 1px rgba(20, 24, 27, .06);
}
.stage-dot {
    flex: none; width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center; font-size: .85rem; font-weight: 800;
    background: var(--ink-100); color: var(--ink-500);
}
.stage-body { display: flex; flex-direction: column; min-width: 0; }
.stage-body strong { font-size: .92rem; line-height: 1.3; }
.stage-item.is-done .stage-dot { background: var(--green-700); color: #fff; }
.stage-item.is-current { box-shadow: 0 0 0 2px var(--green-600); }
.stage-item.is-current .stage-dot { background: var(--green-100); color: var(--green-800); }
.stage-item.is-locked { opacity: .62; }

/* Baris ujian pada roadmap. */
.exam-row {
    display: flex; align-items: center; gap: 16px;
    background: #fff; border-radius: var(--radius); padding: 18px 20px;
    box-shadow: 0 0 0 1px rgba(20, 24, 27, .06);
    transition: box-shadow .18s ease;
}
.exam-row:hover { box-shadow: 0 8px 26px rgba(20, 24, 27, .1); }
.exam-row-icon {
    flex: none; width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center; font-size: 1rem;
    background: var(--green-050); color: var(--green-700);
}
.exam-row.is-passed .exam-row-icon { background: var(--green-700); color: #fff; }
.exam-row.is-locked { opacity: .66; }
.exam-row.is-locked .exam-row-icon { background: var(--ink-100); color: var(--ink-500); }
.exam-row-body { flex: 1; min-width: 0; }
.exam-row-body h3 { font-size: 1rem; margin-bottom: 3px; }
.exam-row-action { flex: none; }

/* ------------------------------------------------------------ Lembar ujian */
.site-header.is-focus { position: static; }
.exam-shell { padding-bottom: 60px; }

.exam-bar {
    position: sticky; top: 0; z-index: 40;
    background: #fff; border-bottom: 1px solid var(--ink-100);
}
.exam-bar-inner {
    max-width: 820px; margin: 0 auto; padding: 14px clamp(16px, 4vw, 24px);
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.exam-bar-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.exam-bar-title strong { font-size: .98rem; }
.exam-bar-meta { display: flex; align-items: center; gap: 14px; }
.exam-answered { font-size: .82rem; font-weight: 600; color: var(--ink-700); white-space: nowrap; }
.exam-timer {
    font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.05rem;
    background: var(--green-050); color: var(--green-800);
    padding: 6px 14px; border-radius: 999px; white-space: nowrap;
}
.exam-timer.is-urgent { background: var(--red-100); color: var(--red-600); }
.exam-progress { height: 3px; background: var(--ink-100); }
.exam-progress span { display: block; height: 100%; width: 0; background: var(--green-600); transition: width .3s ease; }

.exam-body { max-width: 820px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 24px) 0; }

.exam-question {
    background: #fff; border-radius: var(--radius); padding: 22px 24px;
    box-shadow: 0 0 0 1px rgba(20, 24, 27, .06); margin-bottom: 16px;
}
.exam-question.is-answered { box-shadow: 0 0 0 1px rgba(17, 107, 82, .35); }
.exam-question-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.exam-number {
    flex: none; width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center; font-size: .8rem; font-weight: 800;
    background: var(--green-100); color: var(--green-800);
}
.exam-prompt { font-size: 1rem; font-weight: 600; line-height: 1.5; color: var(--ink-900); }
.exam-image { border-radius: var(--radius-sm); margin-bottom: 14px; }

.exam-options { display: flex; flex-direction: column; gap: 8px; }
.exam-option {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--ink-200); cursor: pointer;
    font-size: .93rem; line-height: 1.5;
    transition: border-color .15s ease, background .15s ease;
}
.exam-option:hover { border-color: var(--green-600); background: var(--green-050); }
.exam-option.is-selected { border-color: var(--green-700); background: var(--green-050); font-weight: 600; }
.exam-option input { margin-top: 4px; flex: none; width: auto; }

.exam-essay { width: 100%; min-height: 140px; }

.exam-footer {
    max-width: 820px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 24px) 0;
}

/* ------------------------------------------------------------ Hasil ujian */
.result-card {
    background: #fff; border-radius: var(--radius-lg); padding: 36px 32px;
    text-align: center; box-shadow: 0 0 0 1px rgba(20, 24, 27, .06);
}
.result-eyebrow {
    display: block; font-size: .74rem; font-weight: 700; letter-spacing: .16em;
    text-transform: uppercase; color: var(--ink-500); margin-bottom: 14px;
}
.result-score { font-size: 3.4rem; font-weight: 800; line-height: 1; margin-bottom: 10px; }
.result-card.is-passed  { background: linear-gradient(180deg, var(--green-050), #fff); }
.result-card.is-passed .result-score  { color: var(--green-700); }
.result-card.is-failed .result-score  { color: var(--red-600); }
.result-card.is-pending .result-score { color: var(--gold-600); }
.result-card h1 { font-size: 1.5rem; margin-bottom: 8px; }

.review-item {
    background: #fff; border-radius: var(--radius); padding: 20px 22px;
    box-shadow: 0 0 0 1px rgba(20, 24, 27, .06); margin-bottom: 14px;
    border-left: 4px solid var(--ink-200);
}
.review-item.is-correct { border-left-color: var(--green-600); }
.review-item.is-wrong   { border-left-color: var(--red-600); }
.review-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.review-head .exam-prompt { flex: 1; }

.review-options { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.review-options li {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 9px 13px; border-radius: var(--radius-sm);
    background: var(--paper); font-size: .9rem;
}
.review-options li.is-key    { background: var(--green-050); font-weight: 600; }
.review-options li.is-picked { box-shadow: inset 0 0 0 1px var(--ink-200); }
.review-options li.is-picked:not(.is-key) { background: var(--red-100); }
.review-mark { flex: none; width: 18px; font-weight: 800; color: var(--green-700); }
.review-options li.is-picked:not(.is-key) .review-mark { color: var(--red-600); }
.review-options em { margin-left: auto; font-style: normal; white-space: nowrap; }

.review-essay {
    background: var(--paper); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px;
}
.review-explain {
    margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--ink-200);
}

@media (max-width: 900px) {
    .stage-track { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
    .stage-track { grid-template-columns: 1fr; }
    .exam-row { flex-wrap: wrap; }
    .exam-row-action { width: 100%; }
    .exam-row-action .btn { width: 100%; }
    .result-score { font-size: 2.8rem; }
}

/* Kartu gabung komunitas & jadwal munaqasyah. */
.join-card, .booking-card {
    background: #fff; border-radius: var(--radius-lg); padding: 26px 28px;
    box-shadow: 0 0 0 1px rgba(20, 24, 27, .06);
}
.join-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.join-icon {
    flex: none; width: 46px; height: 46px; border-radius: 14px;
    display: grid; place-items: center; font-size: 1.3rem;
    background: var(--green-050);
}
.join-card-head strong { display: block; font-size: 1.05rem; }
.join-card-head span { display: block; }

.booking-card { text-align: center; }
.booking-card h2 { font-size: 1.45rem; margin: 6px 0 2px; color: var(--green-800); }
.booking-time { font-size: 1rem; font-weight: 600; color: var(--ink-700); margin-bottom: 6px; }

.community-progress { margin: 22px 0 6px; }
.community-progress-bar {
    height: 8px; border-radius: 999px; background: var(--ink-100);
    overflow: hidden; margin-bottom: 8px;
}
.community-progress-bar span {
    display: block; height: 100%; background: var(--green-600);
    border-radius: 999px; transition: width .4s ease;
}

/* ---------------------------------------------------------------- Jalur belajar */
.track-strip {
    display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
    background: var(--green-050); border: 1px solid var(--green-100);
    border-left: 4px solid var(--green-700);
    border-radius: var(--radius); padding: 18px 22px;
}
.track-strip .track-info { flex: 1; min-width: 260px; }
.track-strip .track-name {
    display: block; font-weight: 800; color: var(--green-900);
    font-size: 1.05rem; margin-bottom: 2px;
}
.track-strip .track-desc { color: var(--ink-700); font-size: .9rem; margin: 0; }
.track-strip .track-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.track-choice { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.track-choice .track-card {
    display: flex; flex-direction: column; gap: 10px;
    background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius);
    padding: 24px; text-decoration: none; color: inherit;
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.track-choice .track-card:hover {
    border-color: var(--green-600); transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(10, 61, 44, .08);
}
.track-choice .track-card .track-emoji { font-size: 2rem; line-height: 1; }
.track-choice .track-card h3 { margin: 0; color: var(--green-900); }
.track-choice .track-card p { margin: 0; font-size: .9rem; color: var(--ink-700); }
.track-choice .track-card ul {
    margin: 4px 0 0; padding-left: 18px; font-size: .85rem; color: var(--ink-700);
}
.track-choice .track-card li { margin-bottom: 3px; }
.track-choice .track-card .track-go { margin-top: auto; font-weight: 700; color: var(--green-700); }

.track-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 6px; }
.track-pick label {
    display: block; border: 1px solid var(--ink-200); border-radius: var(--radius);
    padding: 14px 16px; cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.track-pick label:hover { border-color: var(--green-600); }
.track-pick input { position: absolute; opacity: 0; pointer-events: none; }
.track-pick input:checked + span { color: var(--green-900); }
.track-pick label:has(input:checked) { border-color: var(--green-700); background: var(--green-050); box-shadow: inset 0 0 0 1px var(--green-700); }
.track-pick .pick-name { display: block; font-weight: 700; margin-bottom: 2px; }
.track-pick .pick-desc { display: block; font-size: .8rem; color: var(--ink-500); line-height: 1.45; }

@media (max-width: 720px) {
    .track-choice, .track-pick { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- Pembaca E-Book */
.reader-head {
    display: flex; gap: 20px; align-items: flex-start;
    flex-wrap: wrap; justify-content: space-between;
}
.reader-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-outline-light {
    border: 1px solid rgba(255,255,255,.5); color: #fff; background: transparent;
}
.btn-outline-light:hover { background: rgba(255,255,255,.12); border-color: #fff; }

.reader-frame {
    position: relative; width: 100%; height: 78vh; min-height: 460px;
    border: 1px solid var(--ink-200); border-radius: var(--radius);
    overflow: hidden; background: var(--ink-100);
}
.reader-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

@media (max-width: 720px) {
    .reader-frame { height: 68vh; min-height: 380px; }
    .reader-head { flex-direction: column; }
}

/* Tombol pada daftar materi pendukung boleh berjajar */
.asset-item .asset-actions { display: flex; gap: 8px; flex-wrap: wrap; }
