/* Kode Pos & Wilayah — direktori kode pos Indonesia.
   Mobile-first, satu stylesheet, tanpa webfont, tanpa framework.
   Aksen biru; tema terang saja (light only). */
:root {
  color-scheme: light;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #dbeafe;
  --accent: #4f46e5;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.92);
  --input-bg: #ffffff;
  --soft: #eff6ff;
  --code-bg: #f1f5f9;
  --warn-bg: #fffbeb;
  --warn-line: #fcd34d;
  --warn-ink: #92400e;
  --footer-bg: #f1f5f9;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 4px 8px rgba(15, 23, 42, 0.08), 0 12px 28px rgba(15, 23, 42, 0.10);
  --radius: 16px;
  --maxw: 920px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}
a { color: var(--brand-dark); }
a:hover { color: var(--brand); }
::selection { background: var(--brand-soft); }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.brand {
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.brand span {
  background: linear-gradient(120deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand:hover { color: var(--ink); }

/* Layout */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 16px 44px;
}
main.narrow { max-width: 780px; }
h1 { font-size: 29px; line-height: 1.22; margin: 10px 0 10px; letter-spacing: -0.02em; }
h2 { font-size: 21px; margin: 34px 0 8px; letter-spacing: -0.01em; }
h3 { font-size: 17px; margin: 20px 0 6px; }
p { margin: 8px 0; }
.lede { color: var(--muted); font-size: 17px; margin-top: 0; max-width: 62ch; }
.small { font-size: 14px; color: var(--muted); }
.prose { max-width: 68ch; }
.breadcrumb { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb li + li::before { content: "›"; margin-right: 4px; color: var(--muted); }

/* Stats strip */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 18px 0 6px;
}
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 13px 14px;
  text-align: center;
}
.stat b { display: block; font-size: 24px; letter-spacing: -0.02em; color: var(--brand-dark); }
.stat span { font-size: 13px; color: var(--muted); }

/* Search */
.searchbox {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 16px 0 8px;
}
.searchbox label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.search-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .search-row { grid-template-columns: minmax(0, 1fr) 220px; } }
.search-row > :only-child { grid-column: 1 / -1; }
#search-form > .btn { margin-top: 10px; }
.home > h1 { text-align: center; font-size: 32px; }
.home > .lede { text-align: center; margin-left: auto; margin-right: auto; }
.home h1 .accent { color: var(--brand); }
.searchbox input[type="text"],
.searchbox input[type="search"],
.searchbox input[type="number"],
.searchbox select {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  font-size: 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--ink);
}
.searchbox input:focus, .searchbox select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}
.searchbox input[type="search"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 20px 20px;
  padding-left: 40px;
}
.search-hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.search-results { margin-top: 12px; }
.search-results .result-count { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.result-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.result-list a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 11px 13px;
  text-decoration: none;
  color: var(--ink);
}
.result-list a:hover { border-color: var(--brand); }
.result-list .r-name { font-weight: 700; }
.result-list .r-code {
  display: inline-block;
  font-weight: 800;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 1px 9px;
  margin-left: 6px;
  font-size: 14px;
}
.result-list .r-meta { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.result-empty {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 13px;
  font-size: 14px;
  color: var(--muted);
}

/* Province cards */
.prov-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}
@media (min-width: 560px) { .prov-grid { grid-template-columns: 1fr 1fr; } }
.prov-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.prov-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--brand);
}
.prov-card h3 { margin: 0 0 3px; font-size: 17px; }
.prov-card p { margin: 0; font-size: 13px; color: var(--muted); }
.prov-card .go { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--brand-dark); }
.province-more { margin-top: 12px; }
.province-more summary { list-style: none; cursor: pointer; text-align: center; font-weight: 700; font-size: 15px; color: var(--brand-dark); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.province-more summary::-webkit-details-marker { display: none; }
.province-more summary .lbl-less { display: none; }
.province-more[open] summary .lbl-less { display: inline; }
.province-more[open] summary .lbl-more { display: none; }

/* Data tables */
.table-wrap { overflow-x: auto; margin: 12px 0; }
table.dtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.dtable th, .dtable td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.dtable thead th {
  background: var(--soft);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.dtable tbody tr:last-child td { border-bottom: none; }
.dtable tbody tr:target { background: var(--soft); }
.dtable .code { font-weight: 800; color: var(--brand-dark); white-space: nowrap; }
.dtable .vtype { font-size: 12px; color: var(--muted); font-weight: 400; }
.dtable .muted { color: var(--muted); font-size: 13px; white-space: nowrap; }
.dtable .nocode { color: var(--muted); font-size: 14px; }
.dtable td.num, .dtable th.num { text-align: right; white-space: nowrap; }

/* Chip link lists */
.chiplist { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chiplist a, .chiplist span.current {
  display: inline-block;
  padding: 7px 13px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}
.chiplist a:hover { border-color: var(--brand); color: var(--brand-dark); }
.chiplist span.current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }

/* Callouts */
.notice {
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 13px 15px;
  font-size: 14px;
  margin: 16px 0;
}
.notice strong { display: block; margin-bottom: 2px; color: var(--warn-ink); }
/* FAQ */
/* FAQ: jawaban muncul saat pertanyaan diklik */
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { font-weight: 700; cursor: pointer; padding: 13px 28px 13px 0; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; color: var(--muted); }
.faq details[open ] summary::after { content: "\2013"; }
.faq details p { margin: 0 0 14px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1.5px solid #2563eb;
  background: #2563eb;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.btn-block { width: 100%; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--footer-bg);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 16px 30px;
  font-size: 14px;
  color: var(--muted);
}
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 10px; }
.footer-inner a { color: var(--muted); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
