/* The site's global CSS — fonts, reset, base colours.
 *
 * A FILE, registered in nuxt.config's `css: []`, and not a <style> block in app.vue. It lived in
 * app.vue until 2026-11-23, and that made `error.vue` unstyled: Nuxt renders the error page INSTEAD
 * of app.vue, so none of app.vue's CSS ever reached it — a parent who hit a wrong link got the
 * right Arabic sentence in a bare serif with no margins. Registered here it applies to both.
 *
 * Self-hosted brand + Kurdish-coverage fonts — same rationale and files as frontend/web/src/
 * styles/fonts.css (see that file's header comment): Cairo is missing 5 Sorani-only codepoints,
 * so Kurdish (`ckb`) pages use Vazirmatn, which trails every stack as a real-font fallback for
 * any Kurdish glyph appearing on an ar/en page. Self-hosted only — never a Google Fonts/CDN link.
 * Licensing: SIL OFL 1.1 — see OFL-Cairo.txt / OFL-Vazirmatn.txt in public/fonts/. */
@font-face { font-family: 'Cairo'; src: url('/fonts/Cairo-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cairo'; src: url('/fonts/Cairo-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cairo'; src: url('/fonts/Cairo-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cairo'; src: url('/fonts/Cairo-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/fonts/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/fonts/Vazirmatn-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/fonts/Vazirmatn-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/fonts/Vazirmatn-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --brand: #0a7a55;
  /* One source of truth: every rule reads var(--font-ui); no selector below names a family. */
  --font-ui: 'Cairo', 'Vazirmatn', sans-serif;
}
/* Matches web/admin's mechanism. pages/[school]/*.vue set <html lang> per request via useHead
   (isRtl/pickLocale in utils/localized.ts already emit 'ar' | 'en' | 'ckb'), so this selector
   picks up the real per-visitor locale with no extra wiring. [lang], not html[lang], so it also
   works on a nested span carrying its own lang="ckb" for mixed-language content. */
[lang="ckb"] { --font-ui: 'Vazirmatn', sans-serif; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  color: #1f2933;
  background: #ffffff;
  line-height: 1.6;
}
/* Form controls (the school-site search/contact bits, if any) don't inherit the document font by
   default in browser UA stylesheets. */
button, input, select, textarea, optgroup { font-family: inherit; }
a { color: var(--brand); }

/* ---- the visitor's error page (error.vue) ----------------------------------------------------
 * Here and NOT in error.vue's own <style scoped>, for the same measured reason the fonts above are
 * here: a scoped block compiles into `_nuxt/entry.*.css`, and NO emitted HTML links that file — so
 * on the deployed build the error page rendered as unstyled, full-width, default-serif text. Class
 * names are prefixed `err-` because these rules are global now, and `.wrap` / `.body` / `.links`
 * are far too common to be.
 */
.err-wrap { max-width: 520px; margin: 0 auto; padding: 5rem 1.5rem; text-align: center; }
/* The number is context, not the message — the sentence under it is what a parent reads. */
.err-code { font-size: 3rem; font-weight: 700; color: #d1d5db; margin: 0 0 0.5rem; line-height: 1; }
.err-wrap h1 { font-size: 1.4rem; margin: 0 0 0.75rem; }
.err-body { color: #6b7280; margin: 0 0 2rem; }
.err-links { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.err-links a {
  display: inline-block; padding: 0.55rem 1.1rem; text-decoration: none; color: inherit;
  border: 1px solid #e5e7eb; border-radius: 999px;
}
.err-links a:hover { border-color: var(--brand); }
