/* ==========================================================================
   rapi-landing.css — perbaikan tampilan beranda Kapanewon, 2 Des 2026.
   Menggantikan <style> inline di landing_page.php. Tampilan dipertahankan;
   yang diperbaiki: warna hover yang tak sesuai tema, kartu, keyboard, HP.
   ========================================================================== */

:root {
  --merah: #ee3733;
  --merah-tua: #c41f1b;
  --hijau-ikon: #009c57;
}

/* ---------- Menu ---------- */
.nav li a:hover,
.nav li a:focus { background-color: var(--merah); color: #fff; }   /* dulu biru #2525ff */
.menu-induk { cursor: default; }
/* dropdown juga terbuka saat dipakai dengan keyboard (Tab) */
.dropdown:focus-within .isi-dropdown { display: block; }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

/* ---------- Kotak pencarian di banner ---------- */
#field-main-search::placeholder { color: #222; font-weight: 600; opacity: 1; }

/* ---------- Kartu "Informasi Kapanewon" ---------- */
.stats .row > [class*="col-"] { margin-bottom: 18px; }
.stats a { display: block; color: inherit; text-decoration: none; }
.card {
  display: flex;
  align-items: center;
  min-height: 90px;
  height: 100%;
  background-color: #fff;
  border: none;
  border-radius: 3px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, .1);
  transition: background-color .15s ease, color .15s ease;
}
.card-icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin: 12px;
  border-radius: 3px;
  color: #fff;
}
.card-wrap { flex: 1; min-width: 0; }
.card-header {
  display: flex;
  align-items: center;
  padding: 0 10px 0 0;
  border: 0;
  background: none;
}
.card-header h4 {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
  overflow-wrap: normal;
  word-break: normal;
}
/* dulu ".card :hover" (dengan spasi) mewarnai tiap elemen anak sendiri-sendiri */
.stats a:hover .card,
.stats a:focus-visible .card { background-color: var(--merah-tua); color: #fff; }

/* ---------- Layanan publik ---------- */
.categories-container h3 { margin: 28px 0 18px; }

/* Kartu tegak (ikon di atas, label di bawah) saat kolomnya sempit:
   HP (2 kartu/baris) dan 992–1199px (6 kartu/baris ±155px). */
@media (max-width: 767px), (min-width: 992px) and (max-width: 1199px) {
  .card { flex-direction: column; justify-content: flex-start; text-align: center; padding-bottom: 12px; min-height: 140px; }
  .card-icon { margin: 14px auto 10px; }
  .card-wrap { width: 100%; }
  .card-header { justify-content: center; padding: 0 8px; }
}

/* ---------- Tombol menu HP ---------- */
header.masthead .navbar-right .navbar-toggle { min-width: 44px; min-height: 44px; margin-right: 0; padding: 10px; }

@media (max-width: 767px) {
  .card-icon { width: 52px; height: 52px; }
  .card-icon .fa-2x { font-size: 1.6em; }
  .stats .row > [class*="col-"] { padding-left: 8px; padding-right: 8px; margin-bottom: 14px; }
  .stats h3, .categories-container h3 { font-size: 20px !important; line-height: 1.3; }

  /* Banner: foto tampil utuh (tidak terpotong), kotak cari di bawahnya, tidak menutupi tulisan di foto */
  .image-banner {
    height: auto !important;
    padding-top: calc(100vw * 801 / 1918);   /* rasio GEDANGSARI.jpg */
    background-size: 100% auto !important;
    background-position: top center !important;
    background-color: #fff !important;
  }
  .image-banner .search-form { margin: 0 !important; padding: 14px 15px 2px !important; transform: none !important; width: auto !important; }
  .image-banner .search-input { margin-bottom: 12px; }
  .search-form .search-input.search-giant input { font-size: 15px; padding: 12px 44px 12px 12px; box-shadow: 3px 3px rgba(0, 0, 0, .25); }

}

/* ---------- Footer: ubin tautan resmi ---------- */
.footer-baru { padding: 36px 0 18px; color: #fff; }
.footer-baru a { color: #fff; font-weight: 400; }
.footer-baru a:hover, .footer-baru a:focus { color: #fff; text-decoration: underline; }

.tautan-judul {
  margin: 0 0 20px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .2px;
}
.tautan-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 132px));
  justify-content: center;
  gap: 24px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tautan-grid li { margin: 0; padding: 0; float: none; width: auto; height: auto; box-shadow: none; overflow: visible; }
.tautan-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  text-decoration: none !important;
}
.tautan-ikon {
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25), 0 4px 10px rgba(0, 0, 0, .25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.tautan-ikon img { display: block; width: 100%; height: 100%; max-height: none; object-fit: cover; }
/* gambar aplikasi Android punya bingkai & bayangan sendiri: dipotong supaya serasi */
.tautan-ikon--bingkai img { transform: scale(1.2); transform-origin: 50% 54%; }
.tautan-nama { font-size: 13px; line-height: 1.35; max-width: 132px; }
.tautan-grid a:hover .tautan-ikon,
.tautan-grid a:focus-visible .tautan-ikon { transform: translateY(-3px); box-shadow: 0 0 0 2px #fff, 0 8px 16px rgba(0, 0, 0, .3); }
.tautan-grid a:hover .tautan-nama { text-decoration: underline; }

.footer-bawah {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .2);
  font-size: 14px;
}
.footer-kontak { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; }
.footer-kontak strong { font-weight: 600; }
.footer-kontak a { padding: 4px 0; }
/* wadah segel DigiCert disembunyikan selama segelnya belum/tidak dimuat */
.footer-segel:not(:has(img, iframe, a)) { display: none; }
.footer-hak { margin: 0; color: rgba(255, 255, 255, .8); }

@media (max-width: 991px) {
  .tautan-grid { grid-template-columns: repeat(3, minmax(0, 132px)); }
}
@media (max-width: 767px) {
  .footer-baru { padding-top: 28px; }
  .tautan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 12px; }
  .tautan-ikon { width: 76px; height: 76px; border-radius: 16px; }
  .tautan-nama { font-size: 12.5px; }
  .footer-bawah { flex-direction: column; align-items: center; text-align: center; }
  .footer-kontak { flex-direction: column; align-items: center; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
