/* ==========================================================
   base.css — reset, design tokens, tipografi dasar, utilitas
   Dimuat PERTAMA di semua halaman.
   Font (taruh di <head> tiap halaman, sebelum base.css):
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link href="https://fonts.googleapis.com/css2?family=Caveat:wght@500&family=Montserrat:wght@500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
   ========================================================== */

:root {
  /* Warna dasar */
  --color-bg: #F6F1EA;
  --color-surface: #FBF8F3;
  --color-border: #E3DACB;
  --color-text: #1E1B18;
  --color-text-muted: #6E655B;
  --color-primary: #C84A25;
  --color-primary-dark: #A93A1A;
  --color-primary-soft: #F3D9CF;
  --color-green-dark: #27312B;
  --color-olive: #6F7B3A;
  --color-blush: #F5DDD5;
  --color-footer: #222622;
  --color-success: #2F6B3F;
  --color-danger: #B3261E;

  /* Warna badge kategori (teks putih, kontras >= 4.5) */
  --cat-budaya: #C84A25;
  --cat-tradisi: #A8581A;
  --cat-seni: #7A3B5E;
  --cat-gaya-hidup: #6F7B3A;
  --cat-tokoh: #2F5D62;
  --cat-opini: #3A3530;

  /* Font */
  --font-heading: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-script: "Caveat", "Segoe Print", cursive;

  /* Skala tipografi */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: clamp(1.5rem, 2.5vw, 1.875rem);
  --text-3xl: clamp(1.75rem, 4vw, 2.75rem);

  /* Jarak */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 2rem;
  --space-8: 3rem;
  --space-9: 4rem;

  /* Bentuk */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(60, 40, 20, 0.06);
  --shadow-md: 0 8px 24px rgba(60, 40, 20, 0.1);

  --container: 1280px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font: 400 var(--text-base)/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
ul, ol { padding: 0; }
[hidden] { display: none !important; }
::selection { background: var(--color-primary-soft); }

/* ---------- Tipografi ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}
h1 { font-size: var(--text-3xl); font-weight: 800; }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
p { text-wrap: pretty; }
.text-muted { color: var(--color-text-muted); }
.script { font-family: var(--font-script); font-weight: 500; }

/* ---------- Aksesibilitas ---------- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--space-4); top: -4rem; z-index: 100;
  padding: var(--space-2) var(--space-4); border-radius: var(--radius);
  background: var(--color-primary); color: #fff; text-decoration: none;
}
.skip-link:focus { top: var(--space-4); }

/* ---------- Layout dasar ---------- */
.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }

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