/* ═══ Reset ringan + dasar tipografi (§2.2, §2.6) ═══ */

*, *::before, *::after { box-sizing: border-box; }

/* Kelas komponen memakai display:flex/grid, jadi [hidden] harus menang */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 200;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Toggle tema: seluruh permukaan memudar bersama, bukan hanya body.
   Kelas dipasang store.js selama ±350ms saat toggle manual, lalu dilepas. */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color var(--dur-panel) var(--ease-both),
              color var(--dur-panel) var(--ease-both),
              border-color var(--dur-panel) var(--ease-both) !important;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  margin: 0 0 var(--space-32);
  letter-spacing: normal;
  text-wrap: balance;                 /* §2.6 */
}
h1 { font-size: var(--fs-h1);       line-height: var(--lh-h1); }
h2 { font-size: var(--fs-h2);       line-height: var(--lh-h2); }
h3 { font-size: var(--fs-h3);       line-height: var(--lh-h3); }
h4 { font-size: var(--fs-body);     line-height: var(--lh-h3); font-weight: 500; font-family: var(--font-body); }

.h1-large { font-size: var(--fs-h1-large); line-height: var(--lh-h1-large); }
.h-sm { font-size: var(--fs-h3); line-height: var(--lh-h3); }
.h-label { font-family: var(--font-body); font-size: var(--fs-body); font-weight: 500; margin: 0; }

p { margin: 0 0 var(--space-16); text-wrap: pretty; }             /* §2.6 */
p:last-child { margin-bottom: 0; }

.prose > p { max-width: 65ch; }                                    /* §2.6 */

/* Garis bawah hanya di teks berjalan; navigasi & kartu tetap bersih */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-hover) var(--ease-out);
}
a:hover { color: var(--accent); }

.prose a, .article-body a, .footer__addr a, .hint a, .search-hint a, p.muted a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Judul yang jadi tautan tidak digarisbawahi (§1: garis tebal dihindari) */
h1 a, h2 a, h3 a, h4 a {
  text-decoration: none;
  transition: color var(--dur-hover) var(--ease-out);
}
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover { color: var(--accent); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

ul, ol { margin: 0; padding: 0; list-style: none; }

table { border-collapse: collapse; }

/* Angka berbaris (§2.6) */
.tnum, .price, .stat { font-variant-numeric: tabular-nums; }

/* ═══ Fokus keyboard (§3.1 — outline JANGAN dihapus) ═══ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ═══ Utilitas layout ═══ */
.wrap        { width: 100%; max-width: var(--wrap);       margin-inline: auto; padding-inline: var(--gutter); }
.wrap--text  { max-width: var(--wrap-text); }
.wrap--prose { max-width: var(--wrap-prose); }

/* Jarak atas standar untuk halaman yang dimulai dengan breadcrumb */
.page { padding-top: var(--space-32); }

.section        { padding-block: var(--section-y); }
.section--tight { padding-block: var(--space-56); }
.section--wash  { background: var(--bg-alt); }
.section--navy  { background: var(--c-navy); color: var(--on-navy); }

.stack > * + * { margin-top: var(--space-16); }
.stack-32 > * + * { margin-top: var(--space-32); }

/* Kelompok tombol/tautan sebaris — menggantikan style inline yang berulang */
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-16); align-items: center; }
.cluster--center { justify-content: center; }
.cluster--tight { gap: var(--space-8); }

/* Jarak vertikal terbatas pada langkah token (§2.3) */
.mt-8 { margin-top: var(--space-8); }
.mt-16 { margin-top: var(--space-16); }
.mt-24 { margin-top: var(--space-24); }
.mt-32 { margin-top: var(--space-32); }
.mt-56 { margin-top: var(--space-56); }
.mt-120 { margin-top: var(--space-120); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-16 { margin-bottom: var(--space-16); }
.mb-24 { margin-bottom: var(--space-24); }
.mb-32 { margin-bottom: var(--space-32); }
.mb-56 { margin-bottom: var(--space-56); }

/* Panjang baca (§2.6) */
.measure { max-width: 62ch; }
.text-sm { font-size: var(--fs-small); }
.span-full { grid-column: 1 / -1; }
.grow { flex: 1; }
.grow-2 { flex: 2; }
.measure-sm { max-width: 52ch; }
.measure--center { margin-inline: auto; }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--fs-tiny);
  line-height: 1.2;
  letter-spacing: .06em;               /* §2.6 satu-satunya pengecualian */
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--space-16);
}
.eyebrow--gold { color: var(--accent); }
.eyebrow--onnavy { color: var(--on-navy-muted); }

.lead { font-size: calc(var(--fs-body) + 1px); color: var(--text); opacity: .85; max-width: 65ch; }

.muted { color: var(--text-muted); }
.center { text-align: center; }
.center-x { margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--space-16); top: var(--space-16); z-index: 999;
  background: var(--c-navy); color: #fff; padding: 12px 20px;
  border-radius: var(--radius-pill); font-weight: 500;
  /* §5.1 aturan 3: sembunyi lewat transform, bukan menganimasikan top */
  transform: translateY(calc(-100% - 32px));
  transition: transform var(--dur-micro) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* Divider halus, tanpa garis tebal (§1) */
.rule { border: 0; border-top: var(--border); margin: 0; }

/* Grid kartu galeri (§3.4) */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-32);
}

/* ═══ Ikon ═══ */
.icon {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.icon--lg { width: 28px; height: 28px; }
.icon--xl { width: 40px; height: 40px; stroke-width: 1.25; }

/* ═══ Reveal saat scroll (§5.1: hanya opacity + transform, sekali jalan) ═══
   Template menandai elemen dengan data-reveal; ui.js menaikkannya ke
   "pending" hanya bila IntersectionObserver ada & motion tidak direduksi —
   tanpa JS, konten tetap terlihat normal. */
[data-reveal="pending"] { opacity: 0; }
[data-reveal="shown"] {
  animation: reveal-in var(--dur-panel-lg) var(--ease-out) both;
  animation-delay: var(--reveal-delay, 0ms);
}
@keyframes reveal-in { from { opacity: 0; transform: translateY(12px); } }
/* Cetak tidak men-scroll — konten yang belum ter-reveal wajib tampil */
@media print {
  [data-reveal] { opacity: 1 !important; animation: none !important; transform: none !important; }
}

/* ═══ View Transitions (§5.3) ═══ */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation-duration: var(--dur-micro); }
::view-transition-new(root) { animation-duration: var(--dur-micro); }

::view-transition-group(karya-hero) {
  animation-duration: var(--dur-page);
  animation-timing-function: var(--ease-both);
}
