/* ==========================================================
   PT Fathoza Teknologi Edukasi - mode terang
   Tema: buku tulis (garis kertas) dan rapor pencapaian
   ========================================================== */

:root {
    --paper: #FAFCFD;
    --sheet: #FFFFFF;
    --ink: #14233B;
    --muted: #4B5B73;
    --line: #D8E1EA;
    --tint: #F0F5FA;
    --blue: #2255C4;
    --blue-dark: #173F94;
    --blue-soft: #E8EFFC;
    --yellow: #FFCB3D;
    --margin-red: rgba(220, 70, 70, .38);

    --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
    --font-body: "Figtree", "Segoe UI", system-ui, sans-serif;

    --radius: 12px;
    --container: 1160px;
    --header-h: 72px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

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

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-dark); }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }

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

.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 100;
    background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

/* ---------- Tipografi ---------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.12; letter-spacing: -.015em; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.2rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.04; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.35rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }

/* ---------- Tombol ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: .8rem 1.4rem; border-radius: 10px; font-weight: 600; font-size: 1rem;
    text-decoration: none; border: 2px solid transparent; cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s;
}
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(250, 252, 253, .96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(6px);
}
.header-bar { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 16px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; }
.brand-sub { font-size: .8rem; color: var(--muted); font-weight: 500; }

.nav-toggle {
    display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--sheet); cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px;
    transition: transform .2s, opacity .2s;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

.nav-list { display: flex; align-items: center; gap: 4px; }
.nav-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 16px; border-radius: 10px; border: 0; background: none;
    font: inherit; font-weight: 600; color: var(--ink); text-decoration: none; cursor: pointer;
}
.nav-link:hover { background: var(--blue-soft); }
.nav-link.is-active { color: var(--blue-dark); box-shadow: inset 0 -3px 0 var(--yellow); border-radius: 10px 10px 0 0; }

.has-sub { position: relative; }
.caret { transition: transform .2s; }
.has-sub.open .caret { transform: rotate(180deg); }

.submenu {
    position: absolute; top: 100%; right: 0; min-width: 240px; padding: 8px;
    background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 12px 28px rgba(20, 35, 59, .12);
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity .15s, transform .15s, visibility .15s;
}
.submenu a {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
    color: var(--ink); text-decoration: none; font-weight: 500;
}
.submenu a:hover, .submenu a[aria-current="page"] { background: var(--tint); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

@media (hover: hover) and (min-width: 900px) {
    .has-sub:hover > .submenu { opacity: 1; visibility: visible; transform: none; }
    .has-sub:hover .caret { transform: rotate(180deg); }
    /* jembatan agar menu tidak menutup saat kursor bergerak */
    .has-sub::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px; }
}
.has-sub:focus-within > .submenu,
.has-sub.open > .submenu { opacity: 1; visibility: visible; transform: none; }

/* ---------- Seksi umum ---------- */
.section { padding: 80px 0; }
.section--tint { background: var(--tint); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 40px; display: grid; gap: 12px; }

/* ---------- Hero buku tulis ---------- */
.hero {
    position: relative; overflow: hidden; padding: 72px 0 88px;
    background-color: var(--paper);
    background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 35px, rgba(34, 85, 196, .11) 35px, rgba(34, 85, 196, .11) 36px);
    border-bottom: 1px solid var(--line);
}
.hero::before {
    content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--margin-red);
    left: max(10px, calc((100vw - var(--container)) / 2 - 8px));
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero-copy { display: grid; gap: 24px; justify-items: start; }
.hero-copy h1 { max-width: 14ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-photos { position: relative; aspect-ratio: 1 / .92; }
.hp {
    position: absolute; object-fit: cover; border: 6px solid var(--sheet); border-radius: 6px;
    box-shadow: 0 10px 24px rgba(20, 35, 59, .16);
}
.hp-1 { width: 66%; aspect-ratio: 4 / 5; left: 0; top: 4%; transform: rotate(-3deg); }
.hp-2 { width: 54%; aspect-ratio: 3 / 2; right: 0; top: 0; transform: rotate(2.500deg); }
.hp-3 { width: 54%; aspect-ratio: 3 / 2; right: 4%; bottom: 2%; transform: rotate(-1.500deg); }

/* ---------- Hero halaman dalam ---------- */
.page-hero {
    padding: 64px 0 56px;
    background-color: var(--paper);
    background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 35px, rgba(34, 85, 196, .08) 35px, rgba(34, 85, 196, .08) 36px);
    border-bottom: 1px solid var(--line);
}
.page-hero .container { display: grid; gap: 16px; justify-items: start; }
.page-hero--program { border-bottom: 6px solid var(--tab); }
.program-badge {
    background: var(--tab-soft); color: var(--ink); font-weight: 600; font-size: .95rem;
    padding: 4px 12px; border-radius: 999px; border: 1px solid var(--tab);
}

/* ---------- Daftar program (tab pembatas) ---------- */
.program-list { display: grid; gap: 16px; }
.program-row {
    display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
    padding: 28px 32px; background: var(--sheet);
    border: 1px solid var(--line); border-left: 12px solid var(--tab);
    border-radius: 4px var(--radius) var(--radius) 4px;
}
.program-row-main { display: grid; gap: 8px; max-width: 70ch; }
.program-row-tag { font-weight: 600; color: var(--ink); }
.program-row-main p:last-child { color: var(--muted); }
.program-row-link {
    padding: .7rem 1.2rem; border-radius: 10px; background: var(--tab-soft); color: var(--ink);
    font-weight: 600; text-decoration: none; border: 1px solid var(--tab); white-space: nowrap;
}
.program-row-link:hover { background: var(--tab); color: #fff; }

/* ---------- Rapor pencapaian ---------- */
.section--stats { background: var(--tint); border-block: 1px solid var(--line); }
.rapor { background: var(--sheet); border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; }
.rapor-top {
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 12px 24px; background: var(--ink); color: #fff; font-weight: 600; font-size: .95rem;
}
.rapor-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.rapor-cell { padding: 32px 24px; border-left: 1px solid var(--line); display: grid; gap: 4px; align-content: start; }
.rapor-cell:first-child { border-left: 0; }
.rapor-number { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.4rem, 4.4vw, 3.4rem); line-height: 1; letter-spacing: -.03em; color: var(--blue-dark); }
.rapor-suffix { color: var(--ink); }
.rapor-label { font-weight: 600; margin-top: 8px; }
.rapor-note { color: var(--muted); font-size: .95rem; line-height: 1.45; }

/* ---------- Galeri ---------- */
.gallery-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 230px; grid-auto-flow: dense; gap: 16px;
}
.gallery-item.g-tall { grid-row: span 2; }
.gallery-item.g-wide { grid-column: span 2; }
.gallery-grid--even { grid-auto-rows: 240px; }

.gallery-btn {
    position: relative; display: block; width: 100%; height: 100%; padding: 0; margin: 0;
    border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: zoom-in; background: var(--tint);
}
.gallery-btn img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.gallery-btn:hover img { transform: scale(1.04); }
.gallery-caption {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 14px 12px; text-align: left;
    font: 500 .95rem/1.4 var(--font-body); color: #fff;
    background: linear-gradient(to top, rgba(20, 35, 59, .85), rgba(20, 35, 59, 0));
    display: grid; gap: 6px; justify-items: start;
}
.gallery-tag {
    background: var(--sheet); color: var(--ink); font-size: .8rem; font-weight: 600;
    padding: 1px 9px; border-radius: 999px; border-left: 6px solid var(--tab);
}

/* ---------- Lightbox ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1000px, 94vw); width: 100%; color: #fff; }
.lightbox::backdrop { background: rgba(20, 35, 59, .86); }
.lightbox-figure { display: grid; gap: 12px; }
.lightbox-img { width: 100%; max-height: 74vh; object-fit: contain; border-radius: 8px; background: #fff; }
.lightbox-caption { text-align: center; }
.lightbox-actions { display: flex; justify-content: center; gap: 12px; margin-top: 16px; }
.lightbox-btn {
    min-width: 48px; height: 48px; padding: 0 18px; border-radius: 10px; border: 2px solid #fff;
    background: transparent; color: #fff; font: 600 1rem var(--font-body); cursor: pointer;
}
.lightbox-btn:hover { background: #fff; color: var(--ink); }
.lightbox-btn:focus-visible { outline-color: var(--yellow); }

/* ---------- Konten teks ---------- */
.two-col { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; align-items: start; }
.prose { display: grid; gap: 16px; max-width: 68ch; }
.prose h3 { margin-top: 12px; }
.check-list { display: grid; gap: 10px; }
.check-list li { position: relative; padding-left: 30px; }
.check-list li::before {
    content: ""; position: absolute; left: 0; top: .5em; width: 14px; height: 14px; border-radius: 3px;
    background: var(--tab, var(--blue));
}

.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.values > div { border-top: 3px solid var(--ink); padding-top: 16px; display: grid; gap: 8px; align-content: start; }
.values dt { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; }
.values dd { color: var(--muted); }

.inline-links { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Ajakan akhir ---------- */
.section--cta { padding-top: 24px; }
.cta-box {
    display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
    padding-block: 40px; padding-inline: 40px; max-width: var(--container);
    background: var(--blue-soft); border: 1px solid #C7D7F6; border-radius: 16px;
}
.cta-box > div { display: grid; gap: 10px; max-width: 60ch; }

/* ---------- Footer ---------- */
.site-footer { background: #EAF1F7; border-top: 1px solid var(--line); margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: 40px; padding-block: 56px 40px; }
.footer-brand { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; margin-bottom: 10px; }
.footer-text { color: var(--muted); max-width: 40ch; }
.footer-title { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 14px; }
.footer-list { display: grid; gap: 8px; color: var(--muted); }
.footer-list a { color: var(--ink); text-decoration: none; }
.footer-list a:hover { text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--line); padding-block: 18px; color: var(--muted); font-size: .95rem; }

/* ---------- Responsif ---------- */
@media (max-width: 1000px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-photos { max-width: 560px; width: 100%; }
    .rapor-grid { grid-template-columns: repeat(2, 1fr); }
    .rapor-cell:nth-child(3) { border-left: 0; }
    .rapor-cell:nth-child(n+3) { border-top: 1px solid var(--line); }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 899px) {
    .nav-toggle { display: inline-flex; }
    .main-nav {
        position: absolute; left: 0; right: 0; top: 100%;
        background: var(--sheet); border-bottom: 1px solid var(--line);
        box-shadow: 0 14px 24px rgba(20, 35, 59, .1);
        max-height: calc(100vh - var(--header-h)); overflow-y: auto;
        display: none;
    }
    .main-nav.open { display: block; }
    .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding: 12px 20px 20px; }
    .nav-link { width: 100%; justify-content: space-between; padding: 14px 12px; border-radius: 8px; }
    .nav-link.is-active { box-shadow: inset 4px 0 0 var(--yellow); border-radius: 8px; }
    .submenu {
        position: static; opacity: 1; visibility: visible; transform: none;
        display: none; box-shadow: none; border: 0; border-left: 2px solid var(--line);
        border-radius: 0; margin: 0 0 8px 12px; min-width: 0;
    }
    .has-sub.open > .submenu { display: block; }
    .has-sub:focus-within > .submenu { opacity: 1; visibility: visible; }
}

@media (max-width: 700px) {
    body { font-size: 1rem; }
    .section { padding: 56px 0; }
    .hero { padding: 48px 0 56px; }
    .two-col { grid-template-columns: 1fr; gap: 20px; }
    .values { grid-template-columns: 1fr; }
    .program-row { grid-template-columns: 1fr; padding: 22px 20px; gap: 16px; }
    .program-row-link { justify-self: start; }
    .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: 220px; }
    .gallery-item.g-tall, .gallery-item.g-wide { grid-row: auto; grid-column: auto; }
    .rapor-cell { padding: 22px 16px; }
    .cta-box { padding: 28px 22px; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .brand-sub { display: none; }
}

@media (max-width: 420px) {
    .rapor-grid { grid-template-columns: 1fr; }
    .rapor-cell { border-left: 0; border-top: 1px solid var(--line); }
    .rapor-cell:first-child { border-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
