﻿/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-900: #0d2137;
  --blue-800: #132d4a;
  --blue-700: #1a3d63;
  --blue-600: #1e4d7c;
  --blue-500: #256b9e;
  --blue-400: #3b8cc7;
  --blue-100: #d6e9f8;
  --blue-50: #edf4fa;
  --green-600: #1e7e34;
  --green-500: #28a745;
  --green-100: #d4edda;
  --green-50: #eaf7ec;
  --gold-500: #d4a017;
  --gold-100: #fef3cd;
  --red-500: #dc3545;
  --red-100: #fce4e8;
  --gray-900: #212529;
  --gray-800: #343a40;
  --gray-700: #495057;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-300: #dee2e6;
  --gray-200: #e9ecef;
  --gray-100: #f1f3f5;
  --gray-50: #f8f9fa;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-w: 1200px;
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-500); text-decoration: none; transition: color .2s; }
a:hover { color: var(--blue-700); }

/* ===== Utility ===== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ===== Header ===== */
.site-header {
  background: linear-gradient(135deg, var(--blue-800), var(--blue-700));
  color: var(--white);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-top {
  background: var(--blue-900);
  padding: 6px 0; font-size: .8rem;
}
.header-top .container { display: flex; justify-content: space-between; align-items: center; }
.header-top a { color: rgba(255,255,255,.85); font-size: .8rem; }
.header-top a:hover { color: var(--white); }

.header-main { padding: 14px 0; }
.header-main .container { display: flex; align-items: center; gap: 14px; }

.logo {
  width: 56px; height: 56px; background: rgba(255,255,255,.15);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 1.5rem; font-weight: 700;
}

.brand h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.brand p { font-size: .78rem; opacity: .85; }

.nav { background: rgba(0,0,0,.12); }
.nav .container { display: flex; }
.nav a {
  color: rgba(255,255,255,.9); padding: 12px 18px; font-size: .9rem;
  font-weight: 500; display: block; transition: all .2s; border-bottom: 3px solid transparent;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,.1); border-bottom-color: var(--gold-500); color: var(--white); }

.mobile-toggle { display: none; background: none; border: none; color: var(--white); font-size: 1.5rem; cursor: pointer; padding: 8px 12px; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--blue-800) 0%, var(--blue-600) 50%, var(--blue-500) 100%);
  color: var(--white); padding: 110px 0; text-align: center; position: relative; overflow: hidden;
}
.hero-video {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.hero-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(180deg, rgba(11,32,58,.55) 0%, rgba(11,32,58,.35) 50%, rgba(11,32,58,.65) 100%);
  z-index: 0;
}
.hero::before {
  content: ''; position: absolute; top: -50%; right: -20%; width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 70%); z-index: 0;
}
.hero .container { position: relative; z-index: 1; }
.hero h2 { font-size: 2rem; font-weight: 800; margin-bottom: 12px; letter-spacing: -.01em; text-shadow: 0 2px 10px rgba(0,0,0,.45); }
.hero p { font-size: 1.1rem; opacity: .95; max-width: 640px; margin: 0 auto 28px; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 24px; border-radius: 999px; font-weight: 700; font-size: .92rem;
  letter-spacing: .2px; cursor: pointer; line-height: 1.4;
  border: none; text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, filter .15s ease, background .2s ease;
  will-change: transform;
}
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary {
  background: linear-gradient(135deg, #f3c64b 0%, var(--gold-500) 50%, #a97c0b 100%);
  color: var(--blue-900);
  box-shadow: 0 4px 14px rgba(212,160,23,.35);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(212,160,23,.55); color: var(--blue-900); }
.btn-outline {
  background: rgba(255,255,255,.1); color: var(--white);
  border: 2px solid rgba(255,255,255,.6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.btn-outline:hover { background: rgba(255,255,255,.22); border-color: var(--white); transform: translateY(-2px); color: var(--white); }
.btn-sm { padding: 7px 16px; font-size: .82rem; gap: 6px; }

/* ===== Varian tombol gradien + glow ===== */
.btn-green {
  background: linear-gradient(135deg, #41dd87 0%, var(--green-500) 55%, var(--green-600) 100%);
  color: var(--white); box-shadow: 0 4px 14px rgba(40,167,69,.35);
}
.btn-green:hover { filter: brightness(1.07); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(40,167,69,.55); color: var(--white); }
.btn-navy {
  background: linear-gradient(135deg, var(--blue-400) 0%, var(--blue-700) 55%, var(--blue-900) 100%);
  color: var(--white); box-shadow: 0 4px 14px rgba(13,33,55,.4);
}
.btn-navy:hover { filter: brightness(1.12); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(37,107,158,.5); color: var(--white); }
.btn-gray {
  background: linear-gradient(135deg, #8a929c 0%, #6c757d 55%, #565e64 100%);
  color: var(--white); box-shadow: 0 2px 8px rgba(108,117,125,.25);
}
.btn-gray:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(108,117,125,.4); color: var(--white); }

/* ===== Glow pulse halus untuk tombol ajakan utama ===== */
@keyframes glowGold {
  0%, 100% { box-shadow: 0 4px 14px rgba(212,160,23,.35); }
  50% { box-shadow: 0 4px 26px rgba(212,160,23,.8); }
}
@keyframes glowGreen {
  0%, 100% { box-shadow: 0 4px 14px rgba(40,167,69,.35); }
  50% { box-shadow: 0 4px 26px rgba(40,167,69,.85); }
}
.glow-gold { animation: glowGold 2.4s ease-in-out infinite; }
.glow-green { animation: glowGreen 2.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .glow-gold, .glow-green { animation: none; } }

/* ===== Chip Cetak PDF (buka dialog print) ===== */
.print-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px;
  border-radius: 999px; color: var(--white); text-decoration: none;
  font-size: .84rem; font-weight: 600; line-height: 1.4;
  background: linear-gradient(135deg, #3b8cc7 0%, #0d6efd 60%, #0a58ca 100%);
  box-shadow: 0 3px 10px rgba(13,110,253,.3);
  transition: transform .15s ease, box-shadow .2s ease, filter .15s ease;
}
.print-chip:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(13,110,253,.45); color: var(--white); }
.print-chip.purple {
  background: linear-gradient(135deg, #a78bfa 0%, #6f42c1 60%, #5a32a3 100%);
  box-shadow: 0 3px 10px rgba(111,66,193,.3);
}
.print-chip.purple:hover { box-shadow: 0 6px 16px rgba(111,66,193,.5); }

/* ===== Quick Stats ===== */
.quick-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-top: -32px; position: relative; z-index: 2;
}
.stat-card {
  background: var(--white); border-radius: var(--radius-md); padding: 20px;
  text-align: center; box-shadow: var(--shadow-md);
}
.stat-card .stat-icon { font-size: 1.8rem; margin-bottom: 6px; }
.stat-card .stat-num { font-size: 1.5rem; font-weight: 800; color: var(--blue-700); }
.stat-card .stat-label { font-size: .82rem; color: var(--gray-600); }

/* ===== Sections ===== */
.section { padding: 56px 0; }
.section-alt { background: var(--white); }
.section-title { display: flex; align-items: center; justify-content: center; gap: 8px; }
.section-title .title-logo { height: 1.1em; width: auto; flex: 0 0 auto; }
.section-title {
  font-size: 1.55rem; font-weight: 700; color: var(--blue-800);
  margin-bottom: 6px; letter-spacing: -.01em;
}
.section-subtitle { color: var(--gray-600); margin-bottom: 32px; }
.section-header { text-align: center; margin-bottom: 8px; }
.divider { width: 60px; height: 4px; background: var(--gold-500); margin: 12px auto 0; border-radius: 2px; }

/* ===== Cards ===== */
.card {
  background: var(--white); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); overflow: hidden; transition: all .25s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-img { width: 100%; height: 180px; object-fit: cover; background: var(--gray-300); }
.card-body { padding: 18px; }
.card-body h3 { font-size: 1.05rem; margin-bottom: 6px; color: var(--blue-800); }
.card-body p { font-size: .88rem; color: var(--gray-600); line-height: 1.5; }
.card-meta { font-size: .78rem; color: var(--gray-500); margin-top: 8px; }

/* ===== Services Grid ===== */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.service-card {
  background: var(--white); border-radius: var(--radius-md); padding: 28px 20px;
  text-align: center; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200);
  transition: all .25s; cursor: default;
}
.service-card:hover { border-color: var(--blue-400); box-shadow: var(--shadow-md); }
.service-card .svc-icon {
  width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.svc-icon-blue { background: var(--blue-50); color: var(--blue-600); }
.svc-icon-green { background: var(--green-50); color: var(--green-600); }
.svc-icon-gold { background: var(--gold-100); color: #b8860b; }
.service-card h4 { font-size: 1rem; margin-bottom: 6px; color: var(--gray-900); }
.service-card p { font-size: .84rem; color: var(--gray-600); }

/* ===== News Grid ===== */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.news-card .card-badge {
  position: absolute; top: 12px; left: 12px; background: var(--blue-600);
  color: var(--white); padding: 3px 10px; border-radius: 20px; font-size: .72rem; font-weight: 600;
}
.news-card .card-img-wrap { position: relative; }

/* ===== Structure / Org Chart ===== */
.org-chart { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.org-top { text-align: center; }
.org-badge {
  display: inline-block; background: var(--blue-600); color: var(--white);
  padding: 10px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem;
}
.org-row { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.org-item {
  background: var(--white); border: 1px solid var(--gray-300); border-radius: var(--radius-md);
  padding: 14px 18px; text-align: center; min-width: 160px; box-shadow: var(--shadow-sm);
}
.org-item .org-name { font-weight: 600; font-size: .9rem; color: var(--gray-900); }
.org-item .org-role { font-size: .78rem; color: var(--gray-600); }
.org-connector { width: 2px; height: 20px; background: var(--gray-400); margin: 0 auto; }

/* Kartu orang (struktur organisasi dinamis) */
.org-person {
  background: var(--white); border: 1px solid var(--gray-300); border-radius: var(--radius-md);
  padding: 18px 22px; text-align: center; min-width: 190px; box-shadow: var(--shadow-sm);
}
.org-person .org-photo {
  width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 10px; overflow: hidden;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 30px; font-weight: 700; border: 3px solid var(--gold-500);
}
.org-person .org-photo img { width: 100%; height: 100%; object-fit: cover; display: none; }
.org-person .org-photo .init { display: block; }
.org-item .org-photo-sm {
  width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 8px; overflow: hidden;
  background: linear-gradient(135deg, var(--blue-400), var(--blue-600));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; font-weight: 700; border: 2px solid var(--gold-500);
}
.org-person .org-photo-sm {
  width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 8px; overflow: hidden;
  background: linear-gradient(135deg, var(--blue-400), var(--blue-600));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; font-weight: 700; border: 2px solid var(--gold-500);
}
.org-item .org-photo-sm img { width: 100%; height: 100%; object-fit: cover; display: none; }
.org-item .org-photo-sm .init { display: block; }
.org-person.org-lead { min-width: 230px; }

/* ===== Announcements ===== */
.announce-list { display: flex; flex-direction: column; gap: 12px; max-width: 800px; margin: 0 auto; }
.announce-item {
  display: flex; gap: 16px; align-items: flex-start; background: var(--white);
  padding: 16px 20px; border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--blue-500); transition: all .2s;
}
.announce-item:hover { box-shadow: var(--shadow-md); }
.announce-date {
  background: var(--blue-50); color: var(--blue-700); padding: 6px 10px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: .78rem; text-align: center;
  white-space: nowrap; min-width: 60px;
}
.announce-text h4 { font-size: .95rem; margin-bottom: 2px; color: var(--gray-900); }
.announce-text p { font-size: .84rem; color: var(--gray-600); }

/* ===== Gallery ===== */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery-item {
  border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 4/3;
  background: var(--gray-300); position: relative; cursor: pointer;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-caption {
  position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,.7));
  color: var(--white); padding: 24px 12px 10px; font-size: .8rem; font-weight: 500;
}

/* ===== Contact ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.contact-info { display: flex; flex-direction: column; gap: 16px; }
.contact-info-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px;
  background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.contact-icon {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; font-size: 1.2rem;
  background: var(--blue-50); color: var(--blue-600);
}
.contact-text h5 { font-size: .9rem; margin-bottom: 2px; color: var(--gray-900); }
.contact-text p { font-size: .82rem; color: var(--gray-600); }
.contact-sosmed { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sosmed-link { display: inline-flex; align-items: center; gap: 5px; color: var(--gray-700); text-decoration: none; font-weight: 500; }
.sosmed-link:hover { color: var(--blue-600); text-decoration: underline; }
.sosmed-icon { width: 18px; height: 18px; border-radius: 4px; object-fit: contain; }
.sosmed-sep { color: var(--gray-400); }
.contact-map {
  background: var(--gray-200); border-radius: var(--radius-lg); height: 360px;
  overflow: hidden;
}
.contact-map iframe { width: 100%; height: 100%; border: 0; }

/* ===== Peta Wilayah RT/RW (overlay GeoJSON) ===== */
.peta-rw-wrap { margin: 0 0 24px; }
.peta-rt-map {
  position: relative; z-index: 0; height: 640px;
  background: #e8edf3; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.peta-rt-map .leaflet-container { font-family: inherit; }
.peta-legend {
  background: rgba(255,255,255,.95); border-radius: 10px; box-shadow: 0 1px 4px rgba(15,23,42,.18);
  padding: 8px 10px; font-size: .72rem; color: #374151; line-height: 1.8; min-width: 118px;
  border: 1px solid #e5e7eb;
}
.peta-legend-title {
  font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  font-size: .66rem; color: #111827; margin-bottom: 2px;
}
.peta-legend-item { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.peta-legend-swatch {
  width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0;
  border: 1px solid rgba(15,23,42,.15);
}
.peta-rt-loading {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: #6b7280; font-size: .9rem;
}
@media (max-width: 640px) {
  .peta-rt-map { height: 480px; }
}

.contact-form { display: flex; flex-direction: column; gap: 14px; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm); font-family: var(--font-sans); font-size: .9rem;
  transition: border-color .2s; background: var(--white);
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--blue-400); box-shadow: 0 0 0 3px rgba(37,107,158,.15);
}
.contact-form textarea { resize: vertical; min-height: 110px; }
.contact-form button { align-self: flex-start; }

/* ===== Footer ===== */
.site-footer {
  background: #0f172a; color: #cbd5e1; padding: 60px 0 0;
}
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 40px; }
.footer-col h4 {
  color: #ffffff; font-size: .82rem; margin-bottom: 20px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
}

/* Brand col */
.footer-brand { display: flex; flex-direction: column; gap: 16px; }
.footer-logo-row { display: flex; align-items: center; gap: 12px; }
.footer-logo-icon {
  width: 40px; height: 40px; background: #10b981; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.footer-logo-icon svg { width: 22px; height: 22px; }
.footer-logo-img { background: transparent; }
.footer-logo-img img { width: 40px; height: 40px; object-fit: contain; display: block; }
.footer-brand-name h3 { font-size: 1.15rem; font-weight: 700; color: #ffffff; line-height: 1.2; }
.footer-brand-name span { font-size: .88rem; font-weight: 500; color: #10b981; }
.footer-brand p { font-size: .84rem; line-height: 1.7; color: #cbd5e1; max-width: 280px; }

/* Contact / Info cols with icons */
.footer-info-list { display: flex; flex-direction: column; gap: 14px; }
.footer-info-item { display: flex; gap: 12px; align-items: flex-start; }
.footer-info-icon { color: #10b981; flex-shrink: 0; margin-top: 1px; }
.footer-info-icon svg { width: 18px; height: 18px; }
.footer-info-text { font-size: .84rem; color: #e2e8f0; line-height: 1.5; }

/* Schedule */
.footer-schedule { display: flex; flex-direction: column; gap: 12px; }
.footer-schedule-row { display: flex; gap: 12px; align-items: flex-start; }
.footer-schedule-time { font-size: .84rem; color: #cbd5e1; }
.footer-schedule-label { font-weight: 600; color: #f1f5f9; font-size: .84rem; }
.footer-closed-badge {
  display: inline-block; background: #334155; color: #ef4444;
  padding: 6px 14px; border-radius: 20px; font-size: .78rem; font-weight: 600;
  margin-top: 4px;
}
.footer-info-icon-red { color: #ef4444; flex-shrink: 0; margin-top: 1px; }
.footer-info-icon-red svg { width: 18px; height: 18px; }

/* Tautan links */
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-links li { display: flex; gap: 10px; align-items: center; }
.footer-links .link-icon .favicon-img { width: 16px; height: 16px; object-fit: contain; display: block; }
.link-icon { color: #64748b; flex-shrink: 0; }
.footer-links .link-icon svg { width: 14px; height: 14px; }
.footer-links a { color: #e2e8f0; font-size: .84rem; transition: color .2s; }
.footer-links a:hover { color: #ffffff; text-decoration: underline; }

/* Bottom bar */
.footer-bottom {
  border-top: 1px solid #1e293b; padding: 20px 0;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
}
.footer-bottom p { font-size: .8rem; color: #64748b; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: all .3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
  background: var(--white); border-radius: var(--radius-lg); max-width: 600px;
  width: 100%; padding: 32px; position: relative; max-height: 90vh; overflow-y: auto;
}
.modal-close {
  position: absolute; top: 12px; right: 16px; background: none; border: none;
  font-size: 1.5rem; cursor: pointer; color: var(--gray-600); padding: 4px 8px;
}
.modal-content h3 { font-size: 1.25rem; margin-bottom: 16px; color: var(--blue-800); }
.modal-content p { font-size: .9rem; color: var(--gray-700); margin-bottom: 12px; }
.modal-content ul { padding-left: 20px; margin-bottom: 12px; }
.modal-content li { font-size: .9rem; color: var(--gray-700); margin-bottom: 4px; }

/* ===== Page Banner (inner pages) ===== */
.page-banner {
  background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
  color: var(--white); padding: 40px 0; text-align: center;
}
.page-banner h2 { font-size: 1.6rem; font-weight: 700; }

/* ===== Demographics Table ===== */
.data-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.data-table th { background: var(--blue-700); color: var(--white); padding: 12px 16px; text-align: left; font-size: .85rem; font-weight: 600; }
.data-table td { padding: 10px 16px; border-bottom: 1px solid var(--gray-200); font-size: .88rem; }
.data-table tr:hover td { background: var(--blue-50); }
.data-table .num { text-align: right; font-weight: 600; }

/* ===== Visi Misi ===== */
.vision-card {
  background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
  color: var(--white); border-radius: var(--radius-lg); padding: 36px;
  text-align: center; margin-bottom: 28px;
}
.vision-card h3 { font-size: 1.3rem; margin-bottom: 8px; }
.vision-card p { font-size: 1.05rem; opacity: .9; }

/* ===== Profile Document Layout ===== */
.profile-doc {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 36px 40px; box-shadow: var(--shadow-sm);
  max-width: 900px; margin: 0 auto;
}
.profile-block { padding: 8px 0; }
.profile-block h3 {
  font-size: 1.1rem; font-weight: 700; color: #1a1a1a; margin-bottom: 12px;
}
.profile-block h4 {
  font-size: .95rem; font-weight: 700; color: #1a1a1a; margin: 16px 0 8px;
}
.profile-block p { font-size: .9rem; color: #333; line-height: 1.7; margin-bottom: 10px; }
.profile-block ul {
  list-style: disc; padding-left: 24px; margin-bottom: 0;
}
.profile-block li { font-size: .9rem; color: #333; line-height: 1.7; margin-bottom: 6px; }
.profile-block li strong { color: #1a1a1a; }
.profile-doc hr {
  border: none; border-top: 1px solid #e0e0e0; margin: 20px 0;
}

.mission-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mission-item {
  display: flex; gap: 12px; align-items: flex-start; background: var(--white);
  padding: 18px 20px; border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.mission-num {
  width: 36px; height: 36px; background: var(--blue-600); color: var(--white);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0; font-size: .9rem;
}
.mission-item p { font-size: .88rem; color: var(--gray-700); }

/* ===== Wilayah RT/RW ===== */
.wilayah-hero { background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff; border-radius: var(--radius-lg); padding: 16px 22px; text-align: center; margin-bottom: 0; position: relative; z-index: 1; }
.wilayah-hero .wilayah-label { display: inline-block; background: rgba(255,255,255,.2); padding: 3px 14px; border-radius: 20px; font-size: .68rem; font-weight: 600; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.wilayah-hero h2 { font-size: 1.15rem; margin-bottom: 4px; }
.wilayah-hero p { font-size: .82rem; opacity: .85; margin: 0; }
.wilayah-hint {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #78350f;
  font-weight: 700; font-size: .78rem; letter-spacing: .2px;
  padding: 6px 16px; border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.45);
}
.wilayah-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; position: relative; z-index: 2; }
.wstat-card { background: #fff; border-radius: var(--radius-md); padding: 10px 8px; text-align: center; box-shadow: var(--shadow-md); }
.wstat-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 6px; font-size: 1rem; }
.wstat-blue { background: #dbeafe; }
.wstat-green { background: #d1fae5; }
.wstat-yellow { background: #fef3c7; }
.wstat-red { background: #fce4e8; }
.wstat-num { font-size: 1.1rem; font-weight: 800; color: #1a1a1a; }
.wstat-label { font-size: .72rem; color: #4b5563; }
.rw-list { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.rw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.rw-card { background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.rw-header { display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; user-select: none; transition: background .15s; }
.rw-header:hover { background: #f9fafb; }
.rw-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.rw-avatar { width: 44px; height: 44px; border-radius: 10px; background: #d1fae5; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #059669; font-size: 1.1rem; flex-shrink: 0; }
.rw-av-blue { background: #dbeafe; color: #2563eb; }
.rw-av-grn { background: #d1fae5; color: #059669; }
.rw-title { font-weight: 700; font-size: 1rem; color: #1a1a1a; }
.rw-role { font-size: .75rem; color: #4b5563; }
.rw-badges { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.rw-badge { background: #ccfbf1; color: #0d9488; padding: 4px 12px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.rw-count { font-size: .82rem; font-weight: 600; color: #374151; }
.rw-chevron { font-size: .7rem; color: #64748b; transition: transform .25s; }
.rw-card.expanded .rw-chevron { transform: rotate(180deg); }
.rw-body { display: none; padding: 0 18px 18px; }
.rw-card.expanded .rw-body { display: block; }
.rt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rt-card { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: var(--radius-md); padding: 16px; }
.rt-num { font-weight: 700; color: #059669; font-size: .95rem; margin-bottom: 6px; }
.rt-blue { color: #2563eb; }
.rt-loc { font-size: .78rem; color: #4b5563; margin-bottom: 4px; }
.rt-status { display: inline-block; background: #fee2e2; color: #dc2626; padding: 2px 10px; border-radius: 12px; font-size: .7rem; font-weight: 600; margin-bottom: 6px; }
.rt-nik { font-size: .72rem; color: #d1d5db; margin-bottom: 8px; }
.rt-stats { display: flex; gap: 10px; font-size: .78rem; }
.rt-ks { background: #d1fae5; color: #065f46; padding: 3px 10px; border-radius: 6px; font-weight: 600; }
.rt-js { background: #fef3c7; color: #92400e; padding: 3px 10px; border-radius: 6px; font-weight: 600; }
.rw-avatar { border-radius: 50%; overflow: hidden; }
.rw-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rt-avatar { width: 56px; height: 56px; border-radius: 50%; background: #d1fae5; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #059669; font-size: 1.05rem; margin-bottom: 10px; overflow: hidden; }
.rt-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rt-name { font-weight: 700; color: #1a1a1a; font-size: .92rem; margin-bottom: 2px; }
@media (max-width: 640px) {
  .rt-grid { grid-template-columns: 1fr; }
  .rw-badges { display: none; }
}

/* ===== Aparatur ===== */
.aparatur-hero { background: linear-gradient(135deg, #ec4899, #f472b6); color: #fff; border-radius: var(--radius-lg); padding: 16px 22px; text-align: center; margin-bottom: 0; position: relative; z-index: 1; }
.aparatur-hero .aparatur-label { display: inline-block; background: rgba(255,255,255,.2); padding: 3px 14px; border-radius: 20px; font-size: .68rem; font-weight: 600; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.aparatur-hero h2 { font-size: 1.15rem; margin-bottom: 4px; }
.aparatur-hero p { font-size: .82rem; opacity: .85; margin: 0; }
.aparatur-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; position: relative; z-index: 2; }
.astat-card { flex: 0 0 calc((100% - 50px) / 6); background: #fff; border-radius: var(--radius-md); padding: 10px 6px; text-align: center; box-shadow: var(--shadow-md); }
.astat-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; margin: 0 auto 6px; }
.astat-icon img { width: 26px; height: 26px; object-fit: contain; }
.astat-num { font-size: 1.05rem; font-weight: 800; color: #1a1a1a; }
.astat-label { font-size: .7rem; color: #4b5563; }
.aparatur-tabs { display: flex; gap: 8px; margin-top: 24px; flex-wrap: wrap; justify-content: center; }
.atab { padding: 8px 16px; border: 1px solid #d1d5db; border-radius: 20px; background: #fff; font-size: .8rem; font-weight: 600; color: #374151; cursor: pointer; transition: all .15s; font-family: inherit; display: flex; align-items: center; gap: 6px; }
.atab:hover { background: #f3f4f6; }
.atab.active { background: #db2777; color: #fff; border-color: #db2777; }
.atab.active .atab-count { background: rgba(255,255,255,.25); }
.atab-count { display: inline-block; background: #f3f4f6; padding: 1px 8px; border-radius: 12px; font-size: .72rem; }
.aparatur-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.staff-card { background: #fff; border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow-sm); display: flex; gap: 12px; align-items: flex-start; }
.staff-card[data-cat].hidden { display: none; }
.staff-av { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: .9rem; flex-shrink: 0; }
.staff-name { font-weight: 700; color: #1a1a1a; font-size: .88rem; }
.staff-role-badge { display: inline-block; background: #fee2e2; color: #dc2626; padding: 2px 10px; border-radius: 12px; font-size: .7rem; font-weight: 600; margin: 4px 0; }
.staff-meta { font-size: .76rem; color: #4b5563; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .quick-stats, .wilayah-stats { grid-template-columns: repeat(2, 1fr); }
  .aparatur-stats .astat-card { flex-basis: calc((100% - 24px) / 3); }
  .aparatur-grid, .rw-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid, .news-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .mission-list { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .hero h2 { font-size: 1.4rem; }
  .hero p { font-size: .95rem; }
  .quick-stats { grid-template-columns: 1fr 1fr; margin-top: -20px; }
  .quick-stats .stat-card { padding: 14px 10px; }
  .quick-stats .stat-num { font-size: 1.2rem; }
  .services-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .header-main .container { flex-wrap: wrap; }
  .nav .container { flex-direction: column; display: none; }
  .nav .container.open { display: flex; }
  .mobile-toggle { display: block; }
  .org-row { flex-direction: column; align-items: center; }
  .section { padding: 40px 0; }
  .profile-doc { padding: 24px 20px; border-radius: 0; }
  .wilayah-stats { grid-template-columns: repeat(2, 1fr); }
  .aparatur-stats .astat-card { flex-basis: calc((100% - 12px) / 2); }
  .aparatur-grid, .rw-grid { grid-template-columns: 1fr; }
  .aparatur-tabs { justify-content: center; }
  .rt-grid { grid-template-columns: 1fr; }
}

/* ===== Lightbox (zoom foto) ===== */
.lb-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.86); display: none; align-items: center; justify-content: center; z-index: 99999; padding: 24px; }
.lb-overlay.active { display: flex; }
.lb-box { position: relative; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; }
.lb-img { max-width: 92vw; max-height: 82vh; object-fit: contain; border-radius: 10px; box-shadow: 0 12px 48px rgba(0,0,0,.6); background: #fff; }
.lb-caption { color: #fff; margin-top: 12px; font-size: .95rem; text-align: center; }
.lb-close { position: fixed; top: 18px; right: 24px; width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255,255,255,.18); color: #fff; font-size: 1.3rem; cursor: pointer; transition: background .15s; }
.lb-close:hover { background: rgba(255,255,255,.35); }
.org-photo img, .org-photo-sm img, .rw-avatar img, .rt-avatar img, .staff-av img { cursor: zoom-in; }

/* ===== Popup PDF (Peta Administrasi) ===== */
.pdf-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.86); display: none; align-items: center; justify-content: center; z-index: 99998; padding: 24px; }
.pdf-overlay.active { display: flex; }
.pdf-window { background: #fff; border-radius: 12px; width: min(960px, 94vw); height: 90vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.45); }
.pdf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; background: #132742; color: #fff; flex-shrink: 0; }
.pdf-close { background: rgba(255,255,255,.15); border: none; color: #fff; width: 34px; height: 34px; border-radius: 50%; font-size: 1.3rem; line-height: 1; cursor: pointer; flex-shrink: 0; }
.pdf-close:hover { background: rgba(255,255,255,.3); }
.pdf-body { flex: 1; min-height: 0; position: relative; }
.pdf-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pdf-tool { background: rgba(255,255,255,.15); border: none; color: #fff; width: 34px; height: 34px; border-radius: 8px; font-size: 1.05rem; line-height: 1; cursor: pointer; flex-shrink: 0; }
.pdf-tool:hover { background: rgba(255,255,255,.3); }
.pdf-zoom-label { min-width: 52px; text-align: center; font-size: .8rem; color: #cfd8e3; }
.pdf-scroll { position: absolute; inset: 0; overflow: auto; background: #d9dde3; }
.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 20px; min-height: 100%; box-sizing: border-box; }
.pdf-page { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.25); flex-shrink: 0; overflow: hidden; }
.pdf-page canvas { display: block; }
.pdf-loading { color: #555; padding: 40px; text-align: center; font-size: .95rem; }
.pdf-body #pdfFallback { position: absolute; inset: 0; background: #fff; z-index: 2; box-sizing: border-box; }
@media (max-width: 640px) {
  .pdf-overlay { padding: 10px; }
  .pdf-window { width: 100%; height: 92vh; }
}

/* ===== Galeri Kategori (3 kotak) ===== */
.gallery-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.gallery-cat { background: #fff; border: 1px solid var(--gray-200); border-radius: 14px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease; }
.gallery-cat:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.gallery-cat-cover { height: 190px; overflow: hidden; background: var(--gray-100); }
.gallery-cat-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.gallery-cat:hover .gallery-cat-cover img { transform: scale(1.05); }
.gallery-cat-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.gallery-cat-body { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 60px; }
.gallery-cat-title { font-weight: 700; color: var(--gray-800); font-size: .82rem; line-height: 1.3; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery-cat-count { font-size: .78rem; color: var(--gray-600); background: var(--gray-100); padding: 3px 10px; border-radius: 99px; flex-shrink: 0; }
/* Modal Galeri */
.galeri-modal { position: fixed; inset: 0; background: rgba(15,23,42,.72); z-index: 9990; display: none; align-items: center; justify-content: center; padding: 20px; }
.galeri-modal.open { display: flex; }
.galeri-modal-box { background: #fff; border-radius: 16px; max-width: 880px; width: 100%; max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; }
.galeri-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--gray-200); }
.galeri-modal-title { font-weight: 700; color: var(--gray-800); }
.galeri-modal-close { border: none; background: var(--gray-100); width: 32px; height: 32px; border-radius: 50%; font-size: 1.15rem; cursor: pointer; color: var(--gray-700); line-height: 1; }
.galeri-modal-close:hover { background: var(--gray-200); }
.galeri-modal-grid { padding: 18px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.galeri-modal-item { border-radius: 10px; overflow: hidden; border: 1px solid var(--gray-200); background: #fff; }
.galeri-modal-item img { width: 100%; height: 160px; object-fit: cover; cursor: zoom-in; }
.galeri-modal-cap { padding: 8px 10px; font-size: .78rem; color: var(--gray-700); }
.galeri-slide { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #0f172a; }
.galeri-slide-stage { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.galeri-slide-stage img { max-width: 100%; max-height: 56vh; object-fit: contain; border-radius: 8px; background: #fff; cursor: zoom-in; }
.galeri-slide-cap { color: #fff; font-size: .82rem; text-align: center; min-height: 18px; }
.galeri-nav { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255,255,255,.16); color: #fff; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.galeri-nav:hover { background: rgba(255,255,255,.34); }
.galeri-slide-foot { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 14px; flex-wrap: wrap; }
.galeri-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.galeri-dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; cursor: pointer; transition: all .15s; }
.galeri-dot.active { background: #2563eb; width: 22px; border-radius: 5px; }
.galeri-counter { font-size: .78rem; color: var(--gray-600); }
@media (max-width: 640px) {
  .gallery-cats { grid-template-columns: 1fr; }
}
