/**
 * Grow It Font Strategy
 * - Latin/default: DM Sans (self-hosted via Google Fonts CDN)
 * - Arabic: Cairo (RTL, loaded only when lang=ar)
 * - Cyrillic (ru): Noto Sans — lazy loaded
 * - CJK (zh): Noto Sans SC — lazy loaded (~500KB)
 * - Khmer (km): Noto Sans Khmer — lazy loaded
 */

/* ── DM Sans — default for all Latin languages ─────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* ── Cairo — Arabic only (loaded via JS when lang=ar) ──────────────── */
/* @import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700&display=swap'); */

/* ── Base font assignment ───────────────────────────────────────────── */
:root {
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;
  --font-heading: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-num:     'DM Sans', 'Tabular', monospace;
  --font-ar:      'Cairo', 'DM Sans', sans-serif;
}

body {
  font-family: var(--font-body);
}

/* ── RTL — applied when html[dir=rtl] ──────────────────────────────── */
html[dir="rtl"] body {
  font-family: var(--font-ar);
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
}

html[dir="rtl"] .main-content {
  margin-left: 0;
  margin-right: 240px;
}

html[dir="rtl"] .modal {
  text-align: right;
}

/* Khmer needs more line height */
html[lang="km"] body {
  line-height: 1.9;
}

/* ── Lazy font loader (called by i18n.js on lang switch) ────────────── */
