/* =================================================================
   Desa Hadiwarno — Design tokens
   Palette:
     --ink       : teks utama, hampir hitam kehijauan
     --primary   : hijau tosca tua (sawah & indigo batik)
     --primary-2 : hijau tosca lebih gelap (hover/gelap)
     --gold      : kuning gabah/padi (aksen utama, "cap emas")
     --indigo    : biru-abu batik (aksen sekunder, garis struktur)
     --paper     : krem kertas arsip desa (latar)
     --paper-2   : krem sedikit lebih gelap (kartu/section alt)
   Tipografi (diganti ke pasangan yang tegas & mudah dibaca):
     --font-display : Poppins   (judul, geometris, jelas, tidak kaku)
     --font-body    : Inter     (isi, sangat terbaca di layar & ukuran kecil)
     --font-mono    : JetBrains Mono (angka statistik, label ledger)
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --ink: #1E2621;
    --ink-soft: #4B564E;
    --primary: #24594B;
    --primary-2: #143229;
    --gold: #C9972E;
    --gold-soft: #E4C077;
    --indigo: #3E4E63;
    --paper: #F2EEE1;
    --paper-2: #E9E3D0;
    --line: #D8D0B8;
    --white: #FFFDF8;

    --font-display: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius: 8px;
    --container: 1120px;

    --shadow-sm: 0 2px 10px rgba(20, 50, 41, 0.06);
    --shadow-md: 0 10px 30px rgba(20, 50, 41, 0.1);
    --shadow-lg: 0 18px 46px rgba(20, 50, 41, 0.16);

    --ease: cubic-bezier(.22, .61, .36, 1);
    --dur-fast: .22s;
    --dur: .5s;
    --dur-slow: .8s;
}

@media (prefers-reduced-motion: reduce) {
    :root { --dur-fast: 0s; --dur: 0s; --dur-slow: 0s; }
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

a { color: inherit; text-decoration: none; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--primary-2);
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0 0 .5em;
    font-weight: 700;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; font-weight: 600; }

p { margin: 0 0 1em; color: var(--ink-soft); }

a, .btn, .card, .berita-card, .galeri-item, .struktur-list li,
.nav-links a, .ledger-item, footer a, .info-row, table tr {
    transition: background var(--dur-fast) var(--ease),
                color var(--dur-fast) var(--ease),
                border-color var(--dur-fast) var(--ease),
                transform var(--dur-fast) var(--ease),
                box-shadow var(--dur-fast) var(--ease);
}

.eyebrow {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .72rem;
    color: var(--gold);
    font-weight: 600;
    display: inline-block;
    margin-bottom: .8em;
}

/* Skip link untuk aksesibilitas keyboard */
.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--gold);
    color: var(--primary-2);
    padding: 10px 16px;
    z-index: 999;
    font-weight: 600;
}
.skip-link:focus {
    left: 16px;
    top: 16px;
}

:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* ============ TOP BAR (identitas resmi) ============ */
.topbar {
    background: var(--primary-2);
    color: var(--paper-2);
    font-family: var(--font-mono);
    font-size: .78rem;
}
.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    padding-bottom: 8px;
    flex-wrap: wrap;
    gap: 6px;
}
.topbar a { color: var(--gold-soft); }

/* ============ NAVBAR ============ */
.navbar {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: box-shadow var(--dur-fast) var(--ease);
}
.navbar.scrolled { box-shadow: var(--shadow-sm); }
.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    padding-bottom: 14px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--primary-2);
}
.brand .seal { width: 42px; height: 42px; flex-shrink: 0; object-fit: contain; transition: transform var(--dur) var(--ease); }
.brand:hover .seal { transform: rotate(8deg) scale(1.05); }
.brand small {
    display: block;
    font-family: var(--font-mono);
    font-size: .65rem;
    letter-spacing: .08em;
    color: var(--ink-soft);
    font-weight: 500;
    text-transform: uppercase;
}
.nav-links {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.nav-links a {
    padding: 8px 14px;
    font-weight: 600;
    font-size: .93rem;
    border-radius: var(--radius);
    color: var(--ink);
}
.nav-links a:hover,
.nav-links a.active {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-1px);
}
.nav-toggle {
    display: none;
    transition: background var(--dur-fast) var(--ease);
}

@media (max-width: 860px) {
    .nav-toggle {
        display: block;
        background: none;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        padding: 8px 12px;
        font-family: var(--font-mono);
        cursor: pointer;
    }
    .nav-toggle:hover { background: var(--paper-2); }
    .nav-collapse {
        display: grid;
        grid-template-rows: 0fr;
        width: 100%;
        overflow: hidden;
        transition: grid-template-rows var(--dur) var(--ease);
    }
    .nav-collapse.open {
        grid-template-rows: 1fr;
        transition: grid-template-rows var(--dur) var(--ease);
    }
    .nav-collapse > .nav-links {
        min-height: 0;
        overflow: hidden;
        flex-direction: column;
        padding-top: 10px;
    }
    .navbar .container { flex-wrap: wrap; }
}

/* ============ BATIK DIVIDER (elemen ciri khas) ============ */
.batik-divider {
    width: 100%;
    height: 22px;
    display: block;
    color: var(--gold);
}
.batik-divider.flip { transform: scaleY(-1); }
.batik-divider--dark { color: var(--paper-2); }

/* ============ HERO ============ */
@keyframes heroUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero {
    background: var(--primary-2);
    color: var(--paper);
    position: relative;
    overflow: hidden;
}
.hero::before {
    /* Gradasi lembut yang perlahan bernapas — kesan "hidup" tanpa ramai */
    content: '';
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle at 30% 20%, rgba(201,151,46,.16), transparent 55%);
    animation: heroGlow 9s ease-in-out infinite alternate;
    z-index: 1;
    pointer-events: none;
}
@keyframes heroGlow {
    from { opacity: .6; transform: scale(1); }
    to   { opacity: 1; transform: scale(1.08); }
}
.hero .container {
    padding-top: 72px;
    padding-bottom: 56px;
    text-align: center;
    position: relative;
    z-index: 2;
}
.hero .seal-big {
    width: 108px;
    height: 108px;
    object-fit: contain;
    margin: 0 auto 20px;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,.35));
    animation: heroUp var(--dur-slow) var(--ease) both;
}
.hero .eyebrow { animation: heroUp var(--dur-slow) var(--ease) both .08s; }
.hero h1 { color: var(--white); animation: heroUp var(--dur-slow) var(--ease) both .16s; }
.hero .lead {
    max-width: 640px;
    margin: 0 auto;
    color: var(--paper-2);
    font-size: 1.08rem;
    animation: heroUp var(--dur-slow) var(--ease) both .24s;
}
.hero-actions {
    margin-top: 28px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    animation: heroUp var(--dur-slow) var(--ease) both .32s;
}

/* ============ TOMBOL ============ */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: .92rem;
    border: 2px solid transparent;
    cursor: pointer;
}
.btn-gold {
    background: var(--gold);
    color: var(--primary-2);
    box-shadow: var(--shadow-sm);
}
.btn-gold:hover { background: var(--gold-soft); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-gold:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn-outline {
    border-color: var(--paper-2);
    color: var(--paper);
}
.btn-outline:hover { background: rgba(255,255,255,.08); transform: translateY(-2px); }
.btn-outline:active { transform: translateY(0); }

/* Varian outline untuk dipakai di atas latar terang (mis. tombol "kembali" di halaman berita) */
.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    background: transparent;
}
.btn-outline-primary:hover { background: var(--primary); color: var(--white); transform: translateY(-2px); }
.btn-outline-primary:active { transform: translateY(0); }

/* ============ LEDGER STRIP (buku induk desa) ============ */
.ledger {
    background: var(--primary);
    border-top: 1px solid rgba(255,255,255,.15);
}
.ledger .container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}
.ledger-item {
    padding: 20px 18px;
    border-left: 1px solid rgba(255,255,255,.15);
    text-align: center;
}
.ledger-item:first-child { border-left: none; }
.ledger-item .num {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--gold-soft);
    display: block;
}
.ledger-item:hover { background: rgba(255,255,255,.05); }
.count { font-variant-numeric: tabular-nums; }
.ledger-item .lbl {
    font-family: var(--font-mono);
    font-size: .68rem;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--paper-2);
}
@media (max-width: 720px) {
    .ledger .container { grid-template-columns: repeat(2, 1fr); }
    .ledger-item:nth-child(3) { border-left: none; }
}

/* ============ SECTION ============ */
.section { padding: 64px 0; }
.section-alt { background: var(--paper-2); }
.section-head {
    max-width: 640px;
    margin-bottom: 36px;
}
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ============ CARDS ============ */
.grid {
    display: grid;
    gap: 22px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.card .ikon {
    width: 40px;
    height: 40px;
    color: var(--primary);
    margin-bottom: 14px;
    transition: transform var(--dur) var(--ease);
}
.card:hover .ikon { transform: scale(1.12) rotate(-4deg); }

/* Varian kartu potensi dengan foto — ikon tetap tampil sebagai lencana kecil */
.card.card--with-photo { padding: 0; overflow: hidden; }
.card-photo {
    aspect-ratio: 16/10;
    background-size: cover;
    background-position: center;
    position: relative;
}
.card-icon-badge {
    position: absolute;
    bottom: -18px;
    left: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}
.card-icon-badge svg { width: 22px; height: 22px; color: var(--primary); }
.card-body { padding: 34px 26px 26px; }

/* ============ REVEAL ON SCROLL ============ */
.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.reveal.reveal-in { opacity: 1; transform: translateY(0); }
.reveal-group.reveal-in > * { transition-delay: calc(var(--stagger, 1) * 70ms); }

/* ============ SAMBUTAN KEPALA DESA ============ */
.sambutan {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 36px;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px;
}
.sambutan:hover { box-shadow: var(--shadow-md); }
.sambutan .foto-placeholder {
    aspect-ratio: 3/4;
    background: var(--paper-2);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    font-family: var(--font-mono);
    font-size: .7rem;
    text-align: center;
    padding: 10px;
}
.sambutan blockquote {
    position: relative;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.15rem;
    color: var(--ink);
    margin: 0 0 14px;
    padding-left: 20px;
    border-left: 3px solid var(--gold);
}
.sambutan .nama { font-weight: 700; color: var(--primary-2); }
.sambutan .jabatan { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-soft); }
@media (max-width: 720px) {
    .sambutan { grid-template-columns: 1fr; }
    .sambutan .foto-placeholder { max-width: 160px; margin: 0 auto; }
}

/* ============ BERITA ============ */
.berita-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.berita-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.berita-thumb {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-soft);
    overflow: hidden;
}
.berita-thumb svg { width: 36px; height: 36px; transition: transform var(--dur) var(--ease); }
.berita-card:hover .berita-thumb svg { transform: scale(1.15); }
.berita-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.berita-date {
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.berita-body h3 { margin-top: 8px; }
.berita-body .baca-lagi {
    margin-top: auto;
    padding-top: 12px;
    font-weight: 700;
    font-size: .85rem;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.berita-card:hover .baca-lagi { gap: 8px; color: var(--gold); }

/* ============ TABEL ============ */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border: 1px solid var(--line);
}
th, td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    font-size: .93rem;
}
th {
    font-family: var(--font-mono);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-soft);
    background: var(--paper-2);
}
tr:last-child td { border-bottom: none; }

/* ============ TIMELINE / STRUKTUR ============ */
.struktur-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.struktur-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    gap: 14px;
    flex-wrap: wrap;
}
.struktur-list li:last-child { border-bottom: none; }
.struktur-list li:hover { background: var(--paper-2); padding-left: 26px; }

.perangkat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.perangkat-avatar--inisial {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--white);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
}
.struktur-list .jab {
    font-family: var(--font-mono);
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gold);
}
.struktur-list .nm { font-weight: 700; color: var(--primary-2); }

/* ============ GALERI ============ */
.galeri-item {
    aspect-ratio: 4/3;
    background: linear-gradient(160deg, var(--paper-2), var(--line));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px;
    gap: 6px;
}
.galeri-item svg { width: 30px; height: 30px; color: var(--primary); transition: transform var(--dur) var(--ease); }
.galeri-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.galeri-item:hover svg { transform: scale(1.15) rotate(-6deg); }
.galeri-item .g-judul { font-weight: 700; font-size: .9rem; color: var(--primary-2); }
.galeri-item .g-ket { font-size: .78rem; color: var(--ink-soft); }

.galeri-item--foto {
    background-size: cover;
    background-position: center;
    justify-content: flex-end;
    align-items: flex-start;
    text-align: left;
    position: relative;
}
.galeri-item--foto::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(20,50,41,.85), rgba(20,50,41,0) 55%);
}
.galeri-item--foto .g-judul,
.galeri-item--foto .g-ket {
    position: relative;
    z-index: 1;
    color: var(--white);
}
.galeri-item--foto .g-ket { color: var(--paper-2); }

/* ============ KONTAK ============ */
.kontak-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}
@media (max-width: 860px) { .kontak-grid { grid-template-columns: 1fr; } }
.info-row {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.info-row:last-child { border-bottom: none; }
.info-row svg { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.info-row .lbl { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.info-row .val { font-weight: 600; color: var(--primary-2); }

.map-frame {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 320px;
}
.map-frame iframe { width: 100%; height: 100%; min-height: 320px; border: 0; }

.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
.form-field input,
.form-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: .95rem;
    background: var(--white);
}
.form-field input:focus, .form-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(36,89,75,.12);
}
.info-row:hover svg { transform: scale(1.15); color: var(--gold); }
.info-row svg { transition: transform var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
@keyframes alertIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 600;
    font-size: .9rem;
    animation: alertIn var(--dur) var(--ease) both;
}
.alert-success { background: #E4F0E6; color: var(--primary-2); border: 1px solid var(--primary); }
.alert-error { background: #F6E4E0; color: #7A2E1F; border: 1px solid #B9503A; }

/* ============ FOOTER ============ */
footer {
    background: var(--primary-2);
    color: var(--paper-2);
}
footer .container {
    padding-top: 44px;
    padding-bottom: 28px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 30px;
}
@media (max-width: 720px) { footer .container { grid-template-columns: 1fr; } }
footer h4 { color: var(--gold-soft); font-size: 1rem; }
footer a { color: var(--paper-2); display: inline-block; }
footer a:hover { color: var(--gold-soft); transform: translateX(3px); }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: 8px; font-size: .92rem; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.12);
    text-align: center;
    padding: 16px 0;
    font-family: var(--font-mono);
    font-size: .74rem;
    color: var(--paper-2);
}

/* ============ BREADCRUMB ============ */
.breadcrumb {
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--ink-soft);
    margin-bottom: 18px;
}
.breadcrumb a { color: var(--primary); font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }

/* ============ UTIL ============ */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.max-prose { max-width: 720px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.section-note { font-size: .85rem; color: var(--ink-soft); }
.visi-quote {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.2rem;
    color: var(--primary-2);
    margin: 0;
}
