/* ==========================================================================
   ruang-baca.online — Design Tokens & Sistem Tema Ramah Mata
   Default: Putih polos lembut (#ffffff / #fcfcfb) dengan teks arang (#262626)
   ========================================================================== */

:root {
  /* Warna Permukaan & Latar (Putih Polos Lembut) */
  --bg-page: #fcfcfb;
  --bg-surface: #ffffff;
  --bg-subtle: #f6f6f3;
  --bg-hover: #f1f1ed;

  /* Warna Teks (Hindari hitam murni #000000 agar tidak menyilaukan mata) */
  --text-primary: #262626;
  --text-secondary: #5a5e63;
  --text-muted: #767b80;

  /* Garis & Pembatas Tipis */
  --border-color: #eaeae6;
  --border-strong: #d8d8d2;

  /* Satu Warna Aksen Tenang (Biru Tinta Kalem) */
  --accent: #2b4c6f;
  --accent-hover: #203b57;
  --accent-soft: #f0f4f8;
  --accent-border: #cbd8e6;

  /* Kotak Sorotan Minimalis (Lembut di Mata) */
  --callout-bg: #f7f7f5;
  --callout-border-analogy: #7b8fa1;
  --callout-border-lab: #6e857a;
  --callout-border-action: #2b4c6f;
  --callout-border-warning: #a37b4b;
  --callout-border-note: #85888c;

  /* Tipografi */
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Lora", "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Preferensi Baca Dinamis (Diubah lewat theme.js) */
  --reader-font: var(--font-serif);
  --reader-size: 1.125rem; /* 18px di desktop */
  --reader-line-height: 1.82;
  --reader-measure: 65ch;

  /* Ukuran Layout */
  --header-height: 62px;
  --container-max: 1040px;
  --prose-max: 720px;
  --radius-sm: 4px;
  --radius-md: 6px;
}

/* Tema Sepia — Kertas Hangat untuk Bacaan Panjang */
[data-theme="sepia"] {
  --bg-page: #f6f1e7;
  --bg-surface: #fbf7ef;
  --bg-subtle: #eee7d9;
  --bg-hover: #e7dfd0;

  --text-primary: #3a3128;
  --text-secondary: #635749;
  --text-muted: #7f7262;

  --border-color: #e4dccd;
  --border-strong: #d3c8b4;

  --accent: #3d5a73;
  --accent-hover: #2d4459;
  --accent-soft: #eae5da;
  --accent-border: #cfc6b5;

  --callout-bg: #efe9dc;
  --callout-border-analogy: #758491;
  --callout-border-lab: #6c7e70;
  --callout-border-action: #3d5a73;
  --callout-border-warning: #9c7444;
  --callout-border-note: #877c6e;
}

/* Tema Gelap — Redup Lembut untuk Malam Hari (Hindari #000000 pekat) */
[data-theme="dark"] {
  --bg-page: #181a1b;
  --bg-surface: #1f2224;
  --bg-subtle: #25282b;
  --bg-hover: #2c3034;

  --text-primary: #d8d6d0;
  --text-secondary: #a4a7ab;
  --text-muted: #84888d;

  --border-color: #2d3135;
  --border-strong: #3d4248;

  --accent: #82a8cc;
  --accent-hover: #9bbde0;
  --accent-soft: #232c35;
  --accent-border: #364758;

  --callout-bg: #222528;
  --callout-border-analogy: #7898b8;
  --callout-border-lab: #769c8b;
  --callout-border-action: #82a8cc;
  --callout-border-warning: #c29b68;
  --callout-border-note: #8d9196;
}

/* Skala Ukuran Teks Baca */
[data-font-size="small"] {
  --reader-size: 1rem;
}

[data-font-size="medium"] {
  --reader-size: 1.125rem;
}

[data-font-size="large"] {
  --reader-size: 1.25rem;
}

[data-font-size="xlarge"] {
  --reader-size: 1.375rem;
}

/* Pilihan Jenis Huruf Baca */
[data-font-family="serif"] {
  --reader-font: var(--font-serif);
}

[data-font-family="sans"] {
  --reader-font: var(--font-sans);
}

@media (max-width: 640px) {
  :root,
  [data-font-size="medium"] {
    --reader-size: 1.04rem; /* ~16.6px nyaman di layar HP */
  }
  [data-font-size="small"] {
    --reader-size: 0.95rem;
  }
  [data-font-size="large"] {
    --reader-size: 1.16rem;
  }
  [data-font-size="xlarge"] {
    --reader-size: 1.28rem;
  }
}
