/* =========================================================
   style.css
   Dinas Sosial Kota Bogor - SOLID v4
   REVISI: mobile-friendly pass + pembersihan duplikasi
   REVISI 2: label Akses Cepat selalu tampil kecil di bawah ikon
   (tidak lagi hanya muncul saat hover/tap)
   ========================================================= */

@layer base {
  html, body { margin: 0; padding: 0; }
  body { overscroll-behavior: none; overflow-x: hidden; }
  main > :first-child { margin-top: 0 !important; }
  main > :last-child { margin-bottom: 0 !important; }
}

::-webkit-scrollbar { display: none; }

/* =========================================================
   Header: transparan menimpa hero di posisi paling atas,
   berubah solid + shadow begitu halaman discroll.
   ========================================================= */
header {
  transition: background-color 0.3s ease, box-shadow 0.3s ease,
    backdrop-filter 0.3s ease;
}

header:not(.header-scrolled) {
  background-color: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
header:not(.header-scrolled) .bg-surface-container-low {
  background-color: transparent !important;
  border-bottom-color: transparent !important;
}

header:not(.header-scrolled) .h-9,
header:not(.header-scrolled) .h-9 * {
  color: #ffffff !important;
}
header:not(.header-scrolled) .nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
}
header:not(.header-scrolled) .nav-link:hover,
header:not(.header-scrolled) .nav-link.active {
  color: #ffffff !important;
}
header:not(.header-scrolled) .nav-link .material-symbols-outlined {
  color: rgba(255, 255, 255, 0.85) !important;
}

header:not(.header-scrolled) .text-primary,
header:not(.header-scrolled) .text-secondary {
  color: #ffffff !important;
}

header:not(.header-scrolled) #nav-search-toggle,
header:not(.header-scrolled) .mobile-menu-toggle {
  color: #ffffff !important;
}
header:not(.header-scrolled) #nav-search-toggle:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}
header:not(.header-scrolled) #nav-search {
  border-left-color: rgba(255, 255, 255, 0.3) !important;
}

header.header-scrolled {
  background-color: rgba(247, 249, 255, 0.95) !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}
header.header-scrolled .bg-surface-container-low {
  background-color: #edf4ff !important;
  border-bottom-color: rgba(194, 199, 207, 0.2) !important;
}

/* Navbar — cegah teks menu wrap di layar 1280-1535px */
@media (min-width: 1280px) and (max-width: 1535px) {
  header nav.xl\:flex .nav-link {
    font-size: 13px;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
  }
  header nav.xl\:flex #nav-search {
    padding-left: 0.5rem;
    margin-left: 0.25rem;
  }
  header nav.xl\:flex .nav-search-input {
    display: none;
  }
  header nav.xl\:flex #nav-search-toggle {
    width: 2rem;
    height: 2rem;
  }
}

/* Navbar — underline tumbuh dari tengah untuk item aktif/hover */
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 0;
  height: 2px;
  border-radius: 999px;
  transform: translateX(-50%);
  transition: width 0.25s ease;
  background: #0f4c75; /* default: warna saat header solid */
}
.nav-link:hover::after,
.nav-link.active::after {
  width: calc(100% - 16px);
}
/* Di atas carousel (header transparan) garis jadi putih */
header:not(.header-scrolled) .nav-link::after {
  background: #ffffff;
}
/* Setelah discroll (header solid) garis jadi biru */
header.header-scrolled .nav-link::after {
  background: #0f4c75;
}

/* Navbar — search yang expand saat diklik.
   Saat "open", seluruh grup (input + tombol icon) dibungkus jadi
   satu pill menyatu dengan header, bukan kotak putih lepas yang
   melayang di atas hero. */
#nav-search {
  position: relative;
  border-radius: 9999px;
  transition: background-color 0.25s ease, padding 0.25s ease, box-shadow 0.25s ease;
}
#nav-search.open {
  padding-left: 0.25rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}
/* Header transparan (di atas hero): pill jadi kaca buram gelap */
header:not(.header-scrolled) #nav-search.open {
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
}
/* Header solid (sudah discroll): pill jadi abu muda senada surface */
header.header-scrolled #nav-search.open {
  background: #edf4ff;
}

.nav-search-input {
  width: 0;
  height: 2.25rem;
  opacity: 0;
  padding: 0;
  margin: 0;
  border: none;
  outline: none;
  background: transparent;
  border-radius: 9999px;
  font-size: 14px;
  color: #121d26;
  transition: width 0.3s ease, opacity 0.2s ease, padding 0.3s ease, margin 0.3s ease;
}
.nav-search-input::placeholder { color: #72777f; }
#nav-search.open .nav-search-input {
  width: 200px;
  opacity: 1;
  padding: 0 0.75rem;
  margin-right: 0.25rem;
}
/* Di atas hero (transparan): teks & placeholder putih supaya kebaca
   di atas kaca buram, bukan teks gelap di background gelap */
header:not(.header-scrolled) #nav-search.open .nav-search-input {
  color: #ffffff;
}
header:not(.header-scrolled) #nav-search.open .nav-search-input::placeholder {
  color: rgba(255, 255, 255, 0.75);
}
/* Ikon search saat pill terbuka: beri sedikit latar bulat supaya
   tetap terlihat sebagai "tombol", bukan ikon nyasar */
#nav-search.open #nav-search-toggle {
  background: rgba(255, 255, 255, 0.25);
}
header.header-scrolled #nav-search.open #nav-search-toggle {
  background: rgba(0, 59, 98, 0.1);
}

/* Akses Cepat — bulatan ikon dengan label muncul saat hover (desktop) */
.quick-action-circle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 64px;
  text-decoration: none;
}
.quick-action-circle-icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 9999px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  border: 2px solid rgba(255,255,255,0.6);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.quick-action-circle-icon .material-symbols-outlined { font-size: 20px; }
.quick-action-circle:hover .quick-action-circle-icon {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 8px 20px rgba(0,0,0,0.22);
  background: #003b62;
  color: #ffffff !important;
}
.quick-action-circle-label {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 50%;
  width: 140px;
  padding: 0.4rem 0.65rem;
  border-radius: 0.5rem;
  background: #003b62;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  text-align: center;
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  color: #ffffff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 30;
}
.quick-action-circle-label::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #003b62;
}
.quick-action-circle:hover .quick-action-circle-label {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* =========================================================
   AKSES CEPAT LAYANAN — 6 ikon di dalam hero carousel
   ========================================================= */
.fab-radial {
  position: absolute;
  left: 6rem;
  bottom: 6.5rem;
  z-index: 30;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1rem;
  transition: left 0.2s ease, bottom 0.2s ease, gap 0.2s ease;
}
.fab-radial-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  text-decoration: none;
  flex-shrink: 0;
}
.fab-radial-item-icon {
  width: 4.75rem;
  height: 4.75rem;
  border-radius: 9999px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, width 0.2s ease, height 0.2s ease;
}
.fab-radial-item-icon img {
  width: 2.9rem;
  height: 2.9rem;
  object-fit: contain;
  transition: width 0.2s ease, height 0.2s ease;
}
.fab-radial-item:hover .fab-radial-item-icon,
.fab-radial-item:focus-visible .fab-radial-item-icon {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}
.fab-radial-item:active .fab-radial-item-icon {
  transform: scale(0.95);
}

/* Label kecil di bawah ikon — SELALU TAMPIL (bukan lagi tooltip
   yang cuma muncul saat hover / tap di HP). */
.fab-radial-item-label {
  position: static;
  width: 5.5rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  font-size: 11px;
  line-height: 13px;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  transform: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  z-index: auto;
}
.fab-radial-item-label::after {
  display: none;
}

/* Tablet */
@media (max-width: 1024px) {
  .fab-radial {
    left: 2rem;
    bottom: 4.5rem;
    gap: 0.85rem;
  }
  .fab-radial-item-icon {
    width: 4.25rem;
    height: 4.25rem;
  }
  .fab-radial-item-icon img {
    width: 2.6rem;
    height: 2.6rem;
  }
}

/* Mobile: baris ikon jadi scrollable horizontal, label kecil
   tetap tampil di bawah tiap ikon (ukuran disesuaikan) */
@media (max-width: 640px) {
  .fab-radial {
    left: 0;
    right: 0;
    bottom: 2.75rem;
    width: 100%;
    padding: 0 1rem;
    gap: 0.65rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  .fab-radial::-webkit-scrollbar { display: none; }

  .fab-radial-item-icon {
    width: 3.75rem;
    height: 3.75rem;
  }
  .fab-radial-item-icon img {
    width: 2.3rem;
    height: 2.3rem;
  }
  .fab-radial-item-label {
    width: 4.5rem;
    font-size: 10px;
    line-height: 12px;
  }
}

/* =========================================================
   Hero Carousel
   ========================================================= */
.hero-indicator {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 9999px;
  border: none;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: background 0.25s ease, width 0.25s ease, opacity 0.25s ease;
  opacity: 0.9;
  position: relative;
  z-index: 20;
}
.hero-indicator:hover { background: rgba(255, 255, 255, 0.85); }
.hero-indicator.is-active {
  background: #ffffff;
  width: 2.25rem;
  height: 0.6rem;
  opacity: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* Mobile: tinggi hero ditambah + teks didorong ke atas supaya
   judul, deskripsi, tombol CTA, dan baris ikon Akses Cepat di
   bawahnya tidak saling tumpuk */
@media (max-width: 640px) {
  #hero-carousel .relative.w-full.h-\[500px\] {
    height: 620px !important;
  }
  #hero-carousel h1 {
    font-size: 26px !important;
    line-height: 32px !important;
  }
  #hero-carousel p#hero-desc {
    font-size: 14px !important;
    line-height: 20px !important;
  }
  #hero-carousel .relative.z-10.max-w-\[1400px\] {
    padding-top: 6.5rem !important;
    padding-bottom: 10.5rem !important;
    justify-content: flex-start !important;
  }
}

/* =========================================================
   Sambutan Kepala Dinas — mobile
   ========================================================= */
@media (max-width: 640px) {
  #hero-carousel + section .p-space-xl,
  #hero-carousel + section .md\:p-space-2xl {
    padding: 1.25rem !important;
  }
  #hero-carousel + section .w-64.h-80 {
    width: 100% !important;
    max-width: 260px;
    height: 320px !important;
  }
}

/* =========================================================
   Berita — kartu grid ala kategori
   ========================================================= */
.berita-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  text-decoration: none;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.berita-card:hover {
  box-shadow: 0 8px 22px rgba(0,0,0,0.12);
  transform: translateY(-3px);
}
.berita-card-img {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e4effd;
}
.berita-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.berita-card:hover .berita-card-img img { transform: scale(1.05); }
.berita-card-date {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(0,59,98,0.85);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 0.35rem;
  backdrop-filter: blur(4px);
}
.berita-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.berita-card-tag {
  font-size: 12px;
  font-weight: 700;
  color: #136299;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.berita-card-title {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
  color: #121d26;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}
.berita-card:hover .berita-card-title { color: #136299; }

/* Mobile sangat sempit: 1 kolom penuh supaya judul tidak sesak */
@media (max-width: 480px) {
  #berita .grid.sm\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }
}

/* =========================================================
   Kolaborasi & Integrasi — carousel logo mitra
   ========================================================= */
.mitra-carousel { position: relative; width: 100%; overflow: hidden; }
.mitra-track {
  display: flex;
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.mitra-slide {
  flex: 0 0 100%;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 0.5rem 0;
}
.mitra-logo {
  width: 150px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}
.mitra-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.55;
  transition: filter 0.3s ease, opacity 0.3s ease;
}
.mitra-logo:hover { transform: translateY(-2px); }
.mitra-logo:hover img { filter: grayscale(0%); opacity: 1; }
.mitra-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  border: none;
  background: #c2c7cf;
  cursor: pointer;
  transition: background 0.25s ease, width 0.25s ease;
}
.mitra-dot.is-active { background: #003b62; width: 1.5rem; border-radius: 9999px; }

@media (max-width: 640px) {
  .mitra-logo { width: 100px; height: 60px; }
  .mitra-slide { gap: 1rem; }
}

/* =========================================================
   Floating Social Media Bar
   ========================================================= */
.social-fab {
  position: fixed; top: 50%; right: 0; z-index: 58;
  transform: translateY(-50%);
  pointer-events: none;
}
.social-fab > * { pointer-events: auto; }

.social-fab-icons {
  position: fixed; top: 50%; right: 0;
  transform: translateY(-50%) translateX(0);
  display: flex; flex-direction: column;
  gap: 0.75rem;
  background: #ffffff;
  padding: 0.75rem 0.6rem;
  border-radius: 1rem 0 0 1rem;
  box-shadow: -2px 4px 18px rgba(0,0,0,0.18);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  z-index: 58;
}
.social-fab.closed .social-fab-icons { transform: translateY(-50%) translateX(100%); }

.social-icon {
  width: 2.75rem; height: 2.75rem;
  border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  color: #ffffff; background: #003b62; flex-shrink: 0;
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,59,98,0.25);
}
.social-icon:hover { transform: scale(1.08); box-shadow: 0 4px 14px rgba(0,59,98,0.35); }
.social-icon.fb:hover,
.social-icon.ig:hover,
.social-icon.tiktok:hover,
.social-icon.web:hover { background: #136299; }

.social-fab-toggle {
  position: fixed; top: 50%; right: 4.6rem;
  transform: translateY(-50%);
  width: 1.85rem; height: 3.25rem;
  border: none; border-radius: 0.6rem;
  background: #136299; color: #ffffff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: right 0.3s cubic-bezier(0.4,0,0.2,1), background 0.25s ease;
  z-index: 59;
}
.social-fab-toggle:hover { background: #003b62; }
.social-fab-toggle span { transition: transform 0.25s ease; }
.social-fab.closed .social-fab-toggle { right: 0.5rem; }
.social-fab.closed .social-fab-toggle span { transform: rotate(180deg); }

.social-icon svg { width: 20px; height: 20px; fill: currentColor; }

@media (max-width: 640px) {
  .social-fab-icons { padding: 0.6rem 0.5rem; gap: 0.6rem; }
  .social-icon { width: 2.4rem; height: 2.4rem; }
  .social-fab-toggle { width: 1.6rem; height: 2.75rem; right: 3.9rem; }
  .social-fab.closed .social-fab-toggle { right: 0.4rem; }
}

/* Floating WhatsApp Button */
.wa-fab {
  position: fixed; right: 1rem;
  bottom: calc(1rem + 1.5rem + 0.75rem + 3.25rem + 0.75rem);
  z-index: 57; width: 3.25rem; height: 3.25rem;
  border-radius: 9999px; background: #25d366; color: #ffffff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  transition: transform 0.2s ease, background 0.2s ease;
}
.wa-fab:hover { background: #1ebe5b; transform: scale(1.05); }
.wa-fab svg { width: 26px; height: 26px; fill: #ffffff; }

/* Floating accessibility button */
.a11y-fab { position: fixed; right: 1rem; bottom: calc(1rem + 1.5rem + 0.75rem); z-index: 60; }
.a11y-fab-panel { display: none; position: absolute; right: 0; bottom: 4.75rem; }
.a11y-fab.open .a11y-fab-panel { display: block; }
#a11y-fab-toggle { width: 3.25rem; height: 3.25rem; }
#a11y-fab-toggle .material-symbols-outlined { font-size: 26px !important; }

/* Back to top button */
.back-to-top {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 55;
  width: 1.5rem; height: 1.5rem; border-radius: 9999px; border: none;
  display: flex; align-items: center; justify-content: center;
  background: #ffffff; color: #003b62;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  cursor: pointer; opacity: 0; visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.back-to-top:hover { background: #edf4ff; }
.back-to-top .material-symbols-outlined { font-size: 13px !important; }
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* Mobile: geser tombol mengambang sedikit dari tepi + susun ulang jarak */
@media (max-width: 640px) {
  .back-to-top {
    right: 0.75rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }
  .a11y-fab {
    right: 0.75rem;
    bottom: calc(0.75rem + 1.25rem + 0.5rem + env(safe-area-inset-bottom, 0px));
  }
  .wa-fab {
    right: 0.75rem;
    bottom: calc(0.75rem + 1.25rem + 0.5rem + 2.75rem + 0.5rem + env(safe-area-inset-bottom, 0px));
    width: 2.85rem;
    height: 2.85rem;
  }
  .wa-fab svg { width: 22px; height: 22px; }
  .social-icon { width: 2.4rem; height: 2.4rem; }
  .social-fab-toggle { right: 2.55rem; }
  .social-fab.closed .social-fab-toggle { right: 0.4rem; }
}

/* Tap target minimum 44x44px untuk tombol ikon kecil di HP */
@media (max-width: 640px) {
  #nav-search-toggle,
  .mobile-menu-toggle,
  .mobile-nav-close,
  #a11y-fab-close {
    min-width: 44px;
    min-height: 44px;
  }
}

/* =========================================================
   Top bar (telepon/email) - rapikan di layar kecil
   ========================================================= */
@media (max-width: 480px) {
  header .h-9 {
    height: auto;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }
}

/* =========================================================
   Tombol Hamburger (muncul di bawah breakpoint xl)
   ========================================================= */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: #003b62;
  cursor: pointer;
  flex-shrink: 0;
}
.mobile-menu-toggle .material-symbols-outlined { font-size: 26px; }

@media (max-width: 1279px) {
  .mobile-menu-toggle { display: inline-flex; }
  header nav.hidden.xl\:flex { display: none !important; }
}

/* =========================================================
   Panel menu mobile (slide-in dari kanan)
   ========================================================= */
.mobile-nav-panel {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 100;
  background: rgba(18, 29, 38, 0.45);
}
.mobile-nav-panel.open { display: block; }

.mobile-nav-sheet {
  position: absolute;
  top: 0; right: 0;
  height: 100%;
  width: min(88vw, 340px);
  background: #ffffff;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: -6px 0 24px rgba(0,0,0,0.2);
  padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px)) 1rem;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.mobile-nav-panel.open .mobile-nav-sheet { transform: translateX(0); }

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #e4e7ec;
}
.mobile-nav-header-title { font-weight: 700; color: #003b62; font-size: 15px; }
.mobile-nav-close {
  width: 2.5rem; height: 2.5rem;
  border-radius: 9999px;
  border: none;
  background: #edf4ff;
  color: #003b62;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0.25rem;
  font-size: 15px;
  font-weight: 600;
  color: #121d26;
  text-decoration: none;
  border-bottom: 1px solid #f1f3f6;
}
.mobile-nav-link.active { color: #003b62; }

.mobile-nav-group { border-bottom: 1px solid #f1f3f6; }
.mobile-nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0.25rem;
  font-size: 15px;
  font-weight: 600;
  color: #121d26;
  background: none;
  border: none;
  cursor: pointer;
}
.mobile-nav-group-toggle .material-symbols-outlined {
  transition: transform 0.2s ease;
  color: #72777f;
  font-size: 20px;
}
.mobile-nav-group-toggle[aria-expanded="true"] .material-symbols-outlined,
.mobile-nav-group.open .mobile-nav-group-toggle .material-symbols-outlined {
  transform: rotate(180deg);
}
.mobile-nav-submenu { display: none; padding: 0 0 0.5rem 0.75rem; }
.mobile-nav-group.open .mobile-nav-submenu { display: block; }
.mobile-nav-submenu > a {
  display: block;
  padding: 0.6rem 0.25rem;
  font-size: 14px;
  color: #42474e;
  text-decoration: none;
}
.mobile-nav-subgroup-toggle {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  padding: 0.6rem 0.25rem;
  font-size: 14px;
  color: #42474e;
  cursor: pointer;
}
.mobile-nav-subgroup-toggle .material-symbols-outlined {
  font-size: 18px;
  transition: transform 0.2s ease;
}
.mobile-nav-subgroup-toggle[aria-expanded="true"] .material-symbols-outlined {
  transform: rotate(180deg);
}
.mobile-nav-subgroup { padding-left: 0.75rem; display: none; }
.mobile-nav-subgroup.open { display: block; }
.mobile-nav-subgroup a {
  display: block;
  padding: 0.55rem 0.25rem;
  font-size: 13.5px;
  color: #42474e;
  text-decoration: none;
}

.mobile-nav-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0 0.75rem 0;
  padding: 0.65rem 1rem;
  border-radius: 9999px;
  background: #edf4ff;
}
.mobile-nav-search .material-symbols-outlined { font-size: 20px; color: #72777f; }
.mobile-nav-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px; /* cegah auto-zoom iOS */
  color: #121d26;
}
.mobile-nav-search input::placeholder { color: #72777f; }

/* Cegah body scroll saat menu mobile terbuka */
body.mobile-nav-locked { overflow: hidden; }

/* Sembunyikan semua tombol mengambang saat menu mobile terbuka */
body.mobile-nav-locked .social-fab,
body.mobile-nav-locked .wa-fab,
body.mobile-nav-locked .a11y-fab,
body.mobile-nav-locked .back-to-top {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* =========================================================
   Footer — responsive mobile: grid 2 kolom rapi
   ========================================================= */
@media (max-width: 767px) {
  footer .grid.lg\:grid-cols-6 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1.75rem 1.25rem;
  }
  /* Kolom 1: Logo & badge Play Store -> full width, center */
  footer .grid.lg\:grid-cols-6 > div:first-child {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 auto 0.5rem auto;
  }
  /* Kolom 2-6 (Pelayanan, Informasi, Cek Bansos, Tentang Kami,
     Alamat Kantor): rata kiri, 2 kolom rapi */
  footer .grid.lg\:grid-cols-6 > div:not(:first-child) {
    text-align: left;
  }
  footer .grid.lg\:grid-cols-6 > div:not(:first-child) > h4 {
    text-align: left;
    font-size: 14px;
    margin-bottom: 0.25rem;
  }
  footer .grid.lg\:grid-cols-6 > div:not(:first-child) > ul {
    display: block;
    text-align: left;
  }
  footer .grid.lg\:grid-cols-6 > div:not(:first-child) > ul li {
    font-size: 13px;
    line-height: 1.6;
  }
  /* Alamat Kantor (kolom terakhir): sejajar dengan Tentang Kami,
     teks sedikit dikecilkan karena kolomnya sempit */
  footer .grid.lg\:grid-cols-6 > div:last-child {
    grid-column: auto;
  }

  .footer-address-block p,
  .footer-address-block span { font-size: 12.5px; line-height: 1.5; }
  .footer-address-block .material-symbols-outlined { font-size: 14px !important; }
}

/* Layar sangat sempit (<380px): jadi 1 kolom penuh supaya tidak
   terlalu sempit dan mepet */
@media (max-width: 380px) {
  footer .grid.lg\:grid-cols-6 {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 767px) {
  footer { padding-bottom: 9rem; }
  footer .flex.flex-col.md\:flex-row {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
}

/* =========================================================
   PETA SEBARAN — Leaflet (peta OpenStreetMap sungguhan)
   ========================================================= */
#peta-leaflet {
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #d9e3f1;
}
#peta-leaflet .leaflet-control-zoom {
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
#peta-leaflet .leaflet-control-attribution {
  font-size: 10px;
  background: rgba(255,255,255,0.85);
}

.peta-label-marker { pointer-events: none; }
.peta-label-marker span {
  display: inline-block;
  white-space: nowrap;
  background: #003b62;
  color: #ffffff;
  font-weight: 700;
  font-size: 11px;
  line-height: 14px;
  padding: 0.3rem 0.6rem;
  border-radius: 0.4rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* Garis batas wilayah (polygon dari Nominatim) */
.peta-boundary-path {
  transition: fill-opacity 0.2s ease, stroke-width 0.2s ease;
}
.peta-boundary-path:hover {
  fill-opacity: 0.22 !important;
  stroke-width: 3 !important;
}

/* Loading kecil di pojok peta saat sedang ambil data batas wilayah */
.peta-loading-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  color: #003b62;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.peta-loading-badge .spin {
  width: 12px; height: 12px;
  border: 2px solid #98cbff;
  border-top-color: #003b62;
  border-radius: 9999px;
  animation: peta-spin 0.6s linear infinite;
}
@keyframes peta-spin { to { transform: rotate(360deg); } }

/* Mobile/tablet: stack vertikal (filter -> peta -> info), tinggi
   peta dijaga tetap cukup untuk dibaca */
@media (max-width: 767px) {
  #peta-app { display: flex; flex-direction: column; }
  #peta-map,
  #peta-leaflet { height: 320px !important; min-height: 320px !important; }
  #peta-app .lg\:col-span-3,
  #peta-app .lg\:col-span-9,
  #peta-app .xl\:col-span-8,
  #peta-app .xl\:col-span-4 { width: 100%; }
}

/* =========================================================
   Input — cegah auto-zoom Safari iOS (font wajib >= 16px)
   ========================================================= */
@media (max-width: 640px) {
  .nav-search-input,
  #tracking-input {
    font-size: 16px !important;
  }
}

/* =========================================================
   Sambutan Kepala Dinas — collapse/expand teks (Baca Selengkapnya)
   ========================================================= */
.sambutan-body {
  overflow: hidden;
  position: relative;
  transition: max-height 0.35s ease;
}
.sambutan-body.sambutan-collapsed {
  max-height: 8.5rem; /* kira-kira 4-5 baris teks pertama */
}
.sambutan-body.sambutan-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3rem;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #edf4ff);
  pointer-events: none;
}
.sambutan-body.sambutan-expanded {
  max-height: 2000px; /* cukup besar supaya semua teks muat */
}

/* =========================================================
   Tracking Permohonan — layout 3 kolom
   (Gambar Rubo | Form Lacak | Hasil)
   ========================================================= */

/* Default: placeholder tampil, kartu hasil disembunyikan */
#tracking-3col #tracking-placeholder {
  display: flex;
}
#tracking-3col #tracking-results {
  display: none;
}

/* Saat hasil muncul (class "has-result" ditambahkan lewat JS):
   sembunyikan placeholder, tampilkan kartu hasil */
#tracking-3col.has-result #tracking-placeholder {
  display: none;
}
#tracking-3col.has-result #tracking-results {
  display: block;
}

@media (max-width: 1023px) {
  #tracking-3col > div {
    width: 100%;
  }
}

/* =========================================================
   Fix: Huruf Kode captcha di layout sebelahan NIK — kecilkan
   supaya tetap 1 baris, tidak wrap jadi 2 baris, dan tingginya
   selaras dengan tinggi input NIK.
   ========================================================= */
#tracking-3col .tr-captcha {
  font-size: 15px;
  letter-spacing: 0.15em;
  padding: 0.875rem 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 400px) {
  #tracking-3col .tr-captcha {
    font-size: 13px;
    letter-spacing: 0.1em;
  }
}