:root {
    --forest-950: #03130d;
    --forest-900: #0a2e20;
    --emerald-600: #059669;
    --emerald-700: #047857;
    --teal-600: #0d9488;
    --lime-400: #a3e635;
    --lime-500: #84cc16;
    --lime-600: #65a30d;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}


/* ---------- Scrollbar ---------- */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f0fdf4;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--emerald-600), var(--teal-600));
    border-radius: 999px;
    border: 2px solid #f0fdf4;
}

.welcome-message-container::-webkit-scrollbar {
    width: 6px;
}

.welcome-message-container::-webkit-scrollbar-thumb {
    background: var(--lime-500);
    border-radius: 999px;
}


/* ---------- Selection ---------- */

::selection {
    background: var(--lime-400);
    color: var(--forest-950);
}


/* ---------- Loading screen fade-out ---------- */

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}


/* ---------- Card lift utility ---------- */

.card-hover {
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(4, 47, 34, .18);
}


/* ---------- Gradient text helper ---------- */

.text-gradient-green {
    background-image: linear-gradient(90deg, #a3e635, #22c55e, #0d9488);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}


/* ---------- Section divider dot pattern (subtle premium texture) ---------- */

.pattern-dots {
    background-image: radial-gradient(rgba(5, 150, 105, .15) 1px, transparent 1px);
    background-size: 20px 20px;
}


/* ---------- Badge shimmer for "Resmi/Terverifikasi" style badges ---------- */

.badge-shimmer {
    position: relative;
    overflow: hidden;
}

.badge-shimmer::after {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .55), transparent);
    animation: shimmer 3.2s infinite;
}

@keyframes shimmer {
    0% {
        left: -150%;
    }
    60% {
        left: 150%;
    }
    100% {
        left: 150%;
    }
}


/* ---------- Swiper pagination / nav recolor (used on inner pages / carousel) ---------- */

.swiper-pagination-bullet {
    background: #cbd5e1 !important;
    opacity: 1 !important;
}

.swiper-pagination-bullet-active {
    background: var(--lime-500) !important;
    width: 22px !important;
    border-radius: 999px !important;
}


/* ---------- Prose (welcome message) tuning ---------- */

.prose :where(p):not(:first-child) {
    margin-top: 1em;
}


/* ---------- Table styling upgrade for data-heavy pages (statistik, apbdes, dst) ---------- */

table.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

table.table-modern thead th {
    background: linear-gradient(90deg, var(--emerald-700), var(--teal-600));
    color: #fff;
    font-weight: 600;
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    letter-spacing: .03em;
    text-transform: uppercase;
}

table.table-modern thead th:first-child {
    border-top-left-radius: 14px;
}

table.table-modern thead th:last-child {
    border-top-right-radius: 14px;
}

table.table-modern tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #d1fae5;
    font-size: 0.9rem;
    color: #334155;
}

table.table-modern tbody tr:hover td {
    background: #f0fdf4;
}


/* ---------- Buttons ---------- */

.btn-brand {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: linear-gradient(90deg, var(--emerald-600), var(--teal-600));
    color: #fff;
    font-weight: 600;
    padding: .7rem 1.4rem;
    border-radius: 14px;
    box-shadow: 0 10px 20px -8px rgba(5, 150, 105, .5);
    transition: all .25s ease;
}

.btn-brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px -8px rgba(5, 150, 105, .6);
}

.btn-gold {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: linear-gradient(90deg, var(--lime-400), var(--lime-600));
    color: var(--forest-950);
    font-weight: 700;
    padding: .7rem 1.4rem;
    border-radius: 14px;
    box-shadow: 0 10px 20px -8px rgba(132, 204, 22, .45);
    transition: all .25s ease;
}

.btn-gold:hover {
    transform: translateY(-2px);
}


/* ---------- Focus ring (accessibility) ---------- */

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--lime-500);
    outline-offset: 2px;
}


/* ---------- Layar pendek: hero tetap proporsional ---------- */

@media (max-height: 640px) {
    .hero-slider {
        min-height: 480px;
    }
}


/* =========================================================
   THEME 7 — HERO SLIDER FULLSCREEN + NAVBAR GLASS
   ========================================================= */


/* ---------- Hero container: benar-benar 1 layar penuh ---------- */

.hero-slider {
    height: 100vh;
    height: 100svh;
    /* aman dari address-bar mobile */
    min-height: 560px;
}

@media (max-width: 640px) {
    .hero-slider {
        min-height: 520px;
    }
}


/* ---------- Slide: crossfade halus ---------- */

.hero-slide {
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.1s cubic-bezier(.4, 0, .2, 1), visibility 0s linear 1.1s;
    will-change: opacity;
}

.hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity 1.1s cubic-bezier(.4, 0, .2, 1), visibility 0s;
    z-index: 1;
}


/* ---------- Gambar setajam mungkin + efek Ken Burns ---------- */

.hero-img {
    transform: scale(1.06);
    image-rendering: -webkit-optimize-contrast;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-origin: center center;
    filter: saturate(1.08) contrast(1.05);
}

.hero-slide.is-active .hero-img {
    animation: heroKenBurns 8.5s ease-out forwards;
}

@keyframes heroKenBurns {
    from {
        transform: scale(1.14);
    }
    to {
        transform: scale(1.0);
    }
}


/* ---------- Tekstur film halus ---------- */

.hero-grain {
    background-image: radial-gradient(rgba(255, 255, 255, .65) .6px, transparent .6px);
    background-size: 3px 3px;
}


/* ---------- Animasi masuk teks hero ---------- */

.hero-rise {
    opacity: 0;
    transform: translateY(28px);
    animation: heroRise .95s cubic-bezier(.2, .8, .2, 1) forwards;
}

.hero-d1 {
    animation-delay: .15s;
}

.hero-d2 {
    animation-delay: .30s;
}

.hero-d3 {
    animation-delay: .45s;
}

.hero-d4 {
    animation-delay: .60s;
}

@keyframes heroRise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ---------- Dots ---------- */

.hero-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .45);
    transition: all .35s cubic-bezier(.2, .8, .2, 1);
}

.hero-dot:hover {
    background: rgba(255, 255, 255, .8);
}

.hero-dot.is-active {
    width: 30px;
    background: linear-gradient(90deg, #a3e635, #34d399);
    box-shadow: 0 0 16px rgba(163, 230, 53, .6);
}


/* ---------- Progress bar ---------- */

#heroProgress {
    transition: width .1s linear;
}


/* ---------- Indikator scroll ---------- */

.hero-mouse {
    animation: heroMouse 1.7s ease-in-out infinite;
}

@keyframes heroMouse {
    0%,
    100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(9px);
        opacity: .35;
    }
}


/* =========================================================
   NAVBAR — transparan saat di atas hero, solid saat discroll
   ========================================================= */

#mainNavbar {
    transition: background-color .4s ease, box-shadow .4s ease, border-color .4s ease, padding .3s ease;
}

#mainNavbar.is-top {
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#mainNavbar.is-top .nav-link {
    color: #ffffff !important;
}

#mainNavbar.is-top .nav-link:hover {
    background-color: rgba(255, 255, 255, .16) !important;
    color: #ffffff !important;
}

#mainNavbar.is-top .nav-title {
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}

#mainNavbar.is-top .nav-sub {
    color: rgba(255, 255, 255, .78) !important;
}

#mainNavbar.is-top .nav-burger {
    color: #ffffff !important;
}

#mainNavbar.is-top .nav-logo {
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, .5));
}


/* Menu mobile terbuka tetap terbaca (latar putih) */

@media (max-width: 767px) {
    #mainNavbar.is-top #navbar-default .nav-link {
        color: #334155 !important;
    }
}


/* Logo tampil bersih tanpa kotak/latar hijau */

.nav-logo {
    background: transparent !important;
    border-radius: 0;
    padding: 0;
}

#mainNavbar:not(.is-top) .nav-logo {
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, .9)) drop-shadow(0 0 1px rgba(0, 0, 0, .9)) drop-shadow(0 1px 2px rgba(0, 0, 0, .6));
}


/* ---------- Hormati preferensi kurangi animasi ---------- */

@media (prefers-reduced-motion: reduce) {
    .hero-slide.is-active .hero-img {
        animation: none;
        transform: scale(1);
    }
    .hero-rise {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .hero-mouse {
        animation: none;
    }
}


/* ---------- Anchor bantu setelah hero ---------- */

#heroEnd {
    display: block;
    height: 0;
    scroll-margin-top: 96px;
}


/* =========================================================
   PERANGKAT DESA — timeline berurutan, ukuran mengecil per level
   ========================================================= */


/* "Rel" berlebar tetap sebagai acuan garis, dot di dalamnya
   (ukurannya beda-beda per level) selalu otomatis center */

.perangkat-rail {
    width: 44px;
    height: 44px;
}

@media (min-width: 768px) {
    .perangkat-rail {
        width: 52px;
        height: 52px;
    }
}

.perangkat-line {
    left: 22px;
    /* = lebar rel mobile / 2 */
    width: 2px;
    background: linear-gradient(180deg, rgba(163, 230, 53, .85) 0%, rgba(16, 185, 129, .55) 45%, rgba(255, 255, 255, .12) 100%);
}

@media (min-width: 768px) {
    .perangkat-line {
        left: 26px;
    }
    /* = lebar rel desktop / 2 */
}


/* Footer: logo tanpa kotak/latar */

.footer-logo {
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
}


/* =========================================================
   BAGAN ORGANISASI PERANGKAT DESA (org-chart)
   Kepala Desa -> garis -> Sekretaris
   cabang bawah: Kasi (kiri, di bawah Kepala Desa)
                 Kaur (kanan, di bawah Sekretaris)
   ========================================================= */

.org-chart {
    --org-line: rgba(190, 242, 100, .45);
}


/* ---------- Kartu dasar ---------- */

.org-card {
    text-align: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    padding: 14px 12px;
    transition: transform .25s ease, background-color .25s ease, box-shadow .25s ease;
}

.org-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, .13);
}

.org-card--chief {
    width: 190px;
    background: rgba(255, 255, 255, .16);
    border-color: rgba(190, 242, 100, .35);
    box-shadow: 0 14px 32px -12px rgba(0, 0, 0, .35);
}

.org-card--secretary {
    width: 170px;
    background: rgba(255, 255, 255, .11);
}

.org-card--staff {
    width: 128px;
    padding: 10px 8px;
}

.org-card--other {
    width: 128px;
}

.org-label {
    margin-top: 10px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #bef264;
    /* lime-300 */
    line-height: 1.3;
}

.org-label--staff {
    font-size: 9.5px;
}

.org-name {
    margin-top: 2px;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    line-height: 1.25;
    word-break: break-word;
}

.org-name--sm {
    font-size: 13px;
}

.org-name--xs {
    font-size: 12px;
}


/* ---------- Baris atas: Kepala Desa — garis — Sekretaris ---------- */

.org-top-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.org-top-connector {
    width: 64px;
    height: 2px;
    background: var(--org-line);
    align-self: center;
}


/* ---------- Cabang bawah ---------- */

.org-branches {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 3rem;
    margin-top: 28px;
}

.org-branch {
    flex: 1 1 0;
    max-width: 480px;
    position: relative;
    padding-top: 26px;
}

.org-branch::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 26px;
    background: var(--org-line);
    transform: translateX(-50%);
}

.org-branch.invisible {
    visibility: hidden;
}


/* .org-row shrinks to its content (inline-flex) so the horizontal
   bar drawn via ::before spans exactly from the first to the last card */

.org-row {
    display: inline-flex;
    gap: 14px;
    position: relative;
    padding-top: 22px;
}

.org-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--org-line);
}


/* single-child row: no visible bar needed since it's a straight drop */

.org-row:has(> .org-leaf:only-child)::before {
    display: none;
}

.org-leaf {
    position: relative;
    padding-top: 20px;
}

.org-leaf::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 20px;
    background: var(--org-line);
    transform: translateX(-50%);
}


/* ---------- Kelompok "Lainnya" (posisi yang tak terklasifikasi) ---------- */

.org-others {
    margin-top: 32px;
    padding-top: 24px;
    position: relative;
}

.org-others-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 320px;
    height: 1px;
    background: rgba(255, 255, 255, .15);
}


/* ---------- Versi mobile: kartu sedikit lebih lega ---------- */

.org-card--mobile {
    width: 100%;
}

.org-group-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: rgba(190, 242, 100, .85);
    margin-bottom: 12px;
}


/* ---------- Guard: browser lama tanpa dukungan :has() ---------- */

@supports not (selector(:has(*))) {
    .org-row::before {
        display: block;
    }
}