/*
  Buddhadham.net — CSS (split)
  Files included in this single document for convenience:
    - base.css           (variables, reset, typography, layout)
    - header-footer.css  (site header, nav, footer, toTop button)
    - components.css     (cards, toc, media, figure, code blocks)
    - utilities.css      (helpers / spacing / small utilities)
    - print.css          (@media print overrides)

  Usage (development):
    <link rel="stylesheet" href="/assets/css/base.css">
    <link rel="stylesheet" href="/assets/css/header-footer.css">
    <link rel="stylesheet" href="/assets/css/components.css">
    <link rel="stylesheet" href="/assets/css/utilities.css">
    <link rel="stylesheet" href="/assets/css/print.css" media="print">

  Production: concatenate + minify into bundle.min.css, optionally inline critical header styles.
*/

/* ------------------------------------------------------------------
   base.css
   ------------------------------------------------------------------ */
:root{
  --bg: #ffffff;
  --text: #1f2937;           /* slate-800 */
  --muted: #6b7280;          /* slate-500 */
  --link: #0f766e;           /* teal-700 */
  --link-hover: #115e59;     /* teal-800 */
  --border: #e5e7eb;         /* slate-200 */
  --card: #ffffff;
  --shadow: rgba(0,0,0,.06);
  --code-bg: #f8fafc;        /* slate-50 */
  --mark: #fff3b0;
  --radius: 12px;
  --container: 900px;
  --lead: 1.8;
  --space: 20px;
}
@media (prefers-color-scheme: dark){
  :root{
    --bg: #0b0c0d;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --link: #7dd3fc;         /* sky-300 */
    --link-hover: #bae6fd;   /* sky-200 */
    --border: #1f2937;       /* slate-800 */
    --card: #0f1113;
    --shadow: rgba(0,0,0,.25);
    --code-bg: #111827;      /* slate-900 */
    --mark: #3b82f6;
  }
}

/* Reset & Base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }
body{
  margin: 0;
  font-family: "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: var(--lead);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Container & Prose */
.prose{
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space);
}
@media (max-width: 600px){ .prose{ padding: 14px; } }

/* Headings & text */
h1,h2,h3,h4{ line-height: 1.35; margin: 1.2em 0 .4em; }
h2{ font-size: clamp(1.2rem, 1.2vw + 1rem, 1.4rem); }
h3{ font-size: clamp(1.05rem, 1vw + .9rem, 1.2rem); }
p{ margin: .7em 0; }
small, .muted{ color: var(--muted); }

a{ color: var(--link); text-decoration: none; }
a:hover{ color: var(--bg); background: var(--link); transition: .18s ease; }

/* Utilities that are generic but core to layout (kept here) */
.container{ max-width: var(--container); margin: 0 auto; padding: 0 var(--space); }
.center{ text-align: center; }
.right{ text-align: right; }
.indent{ text-indent: 1.4em; }



