: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;
    --gold-300: #f3df9b;
    --gold-400: #e8c766;
    --gold-500: #d4a93a;
}

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 ---------- */

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


/* ---------- Badge shimmer ---------- */

.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 ---------- */

.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 ---------- */

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-slider {
    height: 100vh;
    height: 100svh;
    min-height: 560px;
}

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

.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;
}

.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);
    }
}

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

.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);
    }
}

.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);
}

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

.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;
    }
    .org-card,
    .org-photo img,
    .org-photo-zoom {
        transition: none;
    }
}


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

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


/* Footer: logo tanpa kotak/latar */

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


/* =========================================================
   STRUKTUR ORGANISASI PERANGKAT DESA
   Kepala Desa → Sekretaris Desa → Kaur | Kasi | Kewilayahan
   ========================================================= */


/* ---------- Latar section ---------- */

.org-section {
    background: linear-gradient(160deg, #03130d 0%, #0a2e20 55%, #0b3a33 100%);
}

.org-bg {
    background-image: radial-gradient(circle at 15% 10%, rgba(232, 199, 102, .10), transparent 40%), radial-gradient(circle at 90% 90%, rgba(16, 185, 129, .16), transparent 45%), linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: auto, auto, 44px 44px, 44px 44px;
}

.org-gold-text {
    color: var(--gold-400);
}


/* ---------- Lambang & garis judul ---------- */

.org-emblem {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #3b2a00;
    background: linear-gradient(145deg, var(--gold-300), var(--gold-500));
    box-shadow: 0 0 0 5px rgba(232, 199, 102, .18), 0 14px 30px -10px rgba(0, 0, 0, .6);
}

.org-title-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--gold-400);
    font-size: 11px;
    max-width: 280px;
}

.org-title-rule span {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-400));
}

.org-title-rule span:last-child {
    background: linear-gradient(90deg, var(--gold-400), transparent);
}


/* ---------- Tier ---------- */

.org-chart {
    --org-line: rgba(232, 199, 102, .5);
}

.org-tier {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.org-tier-label {
    margin-bottom: 12px;
    padding: 3px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--gold-300);
    border: 1px solid rgba(232, 199, 102, .35);
    background: rgba(232, 199, 102, .08);
}

.org-level {
    display: flex;
    justify-content: center;
}

.org-spine {
    width: 2px;
    height: 34px;
    margin: 0 auto;
    background: var(--org-line);
}


/* ---------- Kartu (ukuran seragam semua anggota) ---------- */

.org-card {
    position: relative;
    width: 148px;
    padding: 14px 10px 12px;
    text-align: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .13);
    transition: transform .25s ease, background-color .25s ease, border-color .25s ease;
}

.org-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 16%;
    right: 16%;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
    opacity: .75;
}

.org-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, .12);
    border-color: rgba(232, 199, 102, .5);
}


/* Kepala Desa: hanya beda warna/bingkai, ukuran tetap sama */

.org-card--chief {
    background: linear-gradient(180deg, rgba(232, 199, 102, .20), rgba(232, 199, 102, .06));
    border-color: rgba(232, 199, 102, .65);
    box-shadow: 0 0 0 4px rgba(232, 199, 102, .08), 0 18px 36px -14px rgba(0, 0, 0, .6);
}

.org-card--chief::before {
    opacity: 1;
    height: 4px;
}

.org-card--sekdes {
    border-color: rgba(232, 199, 102, .35);
}

.org-card--vacant {
    opacity: .65;
}

.org-card--vacant:hover {
    transform: none;
}


/* ---------- Foto (bulat, bisa diklik untuk preview) ---------- */

.org-photo {
    position: relative;
    display: block;
    width: 84px;
    height: 84px;
    margin: 0 auto;
    padding: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, .55);
    box-shadow: 0 8px 18px -6px rgba(0, 0, 0, .55);
    background: rgba(255, 255, 255, .05);
    cursor: zoom-in;
}

.org-card--chief .org-photo,
.org-card--sekdes .org-photo {
    border-color: var(--gold-400);
}

.org-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.org-photo:hover img {
    transform: scale(1.12);
}

.org-photo-zoom {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    background: rgba(3, 19, 13, .55);
    opacity: 0;
    transition: opacity .25s ease;
}

.org-photo:hover .org-photo-zoom,
.org-photo:focus-visible .org-photo-zoom {
    opacity: 1;
}

.org-photo--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(255, 255, 255, .3);
    cursor: default;
}

.org-label {
    margin-top: 10px;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .02em;
    color: var(--gold-300);
}

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


/* ---------- Kelompok bawahan Sekretaris ---------- */

.org-groups {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.org-group {
    position: relative;
    flex: 1 1 200px;
    /* flex-grow diatur inline sesuai jumlah anggota */
    min-width: 200px;
    padding: 34px 10px 0;
}


/* garis horizontal penghubung antar kelompok */

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

.org-group:first-child::before {
    left: 50%;
}

.org-group:last-child::before {
    right: 50%;
}

.org-group:only-child::before {
    display: none;
}


/* garis turun ke judul kelompok */

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

.org-group-head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 8px 14px 8px 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(232, 199, 102, .22), rgba(232, 199, 102, .08));
    border: 1px solid rgba(232, 199, 102, .45);
}

.org-group-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #3b2a00;
    background: linear-gradient(145deg, var(--gold-300), var(--gold-500));
}

.org-group-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: left;
}

.org-group-text strong {
    font-size: 13px;
    color: #fff;
    font-weight: 700;
}

.org-group-text small {
    font-size: 10.5px;
    color: rgba(255, 255, 255, .65);
}

.org-group-count {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--gold-300);
    background: rgba(0, 0, 0, .3);
}

.org-group-body {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}


/* garis dari judul kelompok ke kartu */

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


/* ---------- Mobile ---------- */

@media (max-width: 767px) {
    .org-groups {
        flex-direction: column;
        align-items: stretch;
    }
    .org-group {
        min-width: 0;
        flex: none !important;
        padding: 34px 0 0;
    }
    .org-group::before {
        display: none;
    }
    .org-group-head {
        width: 100%;
    }
    .org-group-text {
        flex: 1;
    }
    .org-group-body {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .org-group-body .org-card {
        width: 100%;
    }
    .org-card {
        width: 160px;
    }
    .org-photo {
        width: 76px;
        height: 76px;
    }
}

@media (min-width: 480px) and (max-width: 767px) {
    .org-group-body {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}