/*
 * Self-hosted font policy. No external font CDN is used in production.
 *
 * Inter-var.woff2        -> Latin / Latin-Extended / currency / typographic
 *                           symbols (✓ ★ → ⚠ ✗ €), variable weight 100-900.
 * NotoSansArabic-var.woff2 -> Arabic block + presentation forms, Arabic-Indic
 *                           digits, variable weight 100-900.
 * Both files are subsetted woff2 (fontTools) and live next to this sheet.
 * System stacks below guarantee graceful degradation if a file is missing.
 */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/Inter-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Noto Sans Arabic';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/NotoSansArabic-var.woff2') format('woff2');
}

:root {
  /* Latin-script stack: bundled Inter first, then proven system UI faces. */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  /* Arabic stack: bundled Noto first, then Arabic-capable system faces. */
  --font-arabic: 'Noto Sans Arabic', 'Tahoma', 'Segoe UI', 'Arial',
                 system-ui, sans-serif;
}

html[lang='ar'] {
  font-family: var(--font-arabic);
}
html:not([lang='ar']) {
  font-family: var(--font-sans);
}

/* Admin shell and namespaced widgets reuse the same stacks explicitly. */
body.admin-body,
.chat-widget, .chat-thread {
  font-family: var(--font-sans);
}
html[lang='ar'] body.admin-body,
html[lang='ar'] .chat-widget,
html[lang='ar'] .chat-thread {
  font-family: var(--font-arabic);
}
