/* ================================================================
   base.css — reset, variabel, tipografi, layout umum, utility.
   Dimuat di semua halaman lewat base.html.
   JANGAN taruh style komponen/halaman di sini.
   ================================================================ */

/* ---------- Variabel global ---------- */
:root {
  /* Dasar */
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-border: #e4e6dc;

  /* Teks */
  --color-text: #1a1a1a; /* teks & judul: hitam */
  --color-ghost: rgb(
    76 46 5 / 0.35
  ); /* Deep Walnut transparan, buat teks dekoratif */
  --color-muted: #6b6c72; /* Rosy Granite versi gelap */

  /* Brand */
  --color-primary: #566246; /* Dusty Olive versi gelap: tombol, link */
  --color-primary-hover: #4c5530;
  --color-primary-soft: #bee7b8; /* Celadon: pill aktif, badge */
  --color-accent: #7a8450; /* Dusty Olive asli: ikon, ilustrasi */
  --color-sage: #aebd93; /* Dry Sage: garis, grafik */
  --color-neutral: #95969d; /* Rosy Granite: border tebal, ikon nonaktif */

  /* Status */
  --color-danger: #c0392b;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  min-height: 100dvh; /* ukuran layar yang lebih pas di HP */
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-primary);
}

.page-container {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

.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;
}

/* ================= Aksesibilitas ================= */

/* 1. Fokus keyboard: garis jelas saat navigasi pakai tab, tidak muncul sat di klik mpuse */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}

/* di latar gelap/berwarna (toast, tombol primary) garisnya putih biar kelihatan */
.toast :focus-visible {
  outline-color: #fff;
}

/* 2. Kurangi animasi kalau user mengaktifkan "Reduce motion" di OS-nya */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* pengecualian: spinner loading tetap berputar pelan,
     supaya user tetap tahu prosesnya masih jalan */
  .spinner {
    animation-duration: 2s !important;
    animation-iteration-count: infinite !important;
  }
}
