/**
 * /mdr-content/css/fonts.css — central self-hosted web-font @font-face declarations
 *
 * Registers the project's self-hosted @font-face faces (no external CDN calls): every
 * installation carries its own font files and never depends on a third-party network.
 *
 * Loaded centrally as the FIRST layer of the CSS chain via the head partial
 * (mdr-content/view/public/partials/head.view.php), before essential.css. Load order:
 * fonts.css -> essential.css -> structure.css -> public.css -> (optional) page CSS.
 *
 * Font files live in mdr-content/fonts/. Faces declared here:
 *   - Oswald (Latin + Cyrillic), the primary UI/display typeface, in weights
 *     300 Light, 400 Regular, 500 Medium and 600 SemiBold.
 *   - Liberation Sans (Latin + Latin-ext + Greek + Cyrillic + Hebrew), the base UI/body
 *     face in Regular/Bold/Italic/BoldItalic — self-hosted so body text looks the same
 *     on every OS; Arial-metric; referenced by --font-sans (essential.css).
 *   - Per-script Noto faces for the writing systems Liberation Sans does not cover,
 *     each with a unicode-range so it loads only when its characters appear: Noto
 *     Naskh Arabic (ar/fa/ur/ps/…), Noto Sans Devanagari (hi/mr), Bengali (bn),
 *     Gurmukhi (pa), Telugu (te), Tamil (ta), Thai (th), Ethiopic (am), Javanese (jv)
 *     — all Regular+Bold — and the CJK faces Noto Sans SC (zh), JP (ja), KR (ko),
 *     Regular only. The :lang() block at the foot selects the face per language.
 * All faces use font-display: swap, so text paints immediately in a fallback face and
 * swaps to the web font once it loads (no invisible-text flash).
 *
 * @package    TaNaSi-MDR
 * @author     Keylam Folker
 * @co-author  Claude (Anthropic)
 * @copyright  2026 TaNaSi
 * @license    proprietary — see RULES.md
 * @link       https://ta-na-si.eu
 * @since      1.0.0
 */

/* ---- Oswald (Latin + Cyrillic) — the primary UI/display typeface ---- */
@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('/mdr-content/fonts/Oswald-Light.woff2') format('woff2');
}
@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/mdr-content/fonts/Oswald-Regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/mdr-content/fonts/Oswald-Medium.woff2') format('woff2');
}
@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/mdr-content/fonts/Oswald-SemiBold.woff2') format('woff2');
}

/* ---- Liberation Sans (Latin + Latin-ext + Greek + Cyrillic + Hebrew) — base UI/body ----
   Self-hosted so body text renders IDENTICALLY on every OS instead of resolving to each
   system's own sans (Segoe UI on Windows, a metric clone on Linux, …). Metric-compatible
   with Arial; subset to the European + Greek + Cyrillic + Hebrew ranges. Non-Latin scripts
   not covered here (Arabic, CJK, …) keep their own Noto faces via the :lang() block below.
   Referenced by --font-sans (essential.css). Files from the upstream liberation-fonts
   release, OFL-licensed. */
@font-face {
    font-family: 'Liberation Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/mdr-content/fonts/LiberationSans-Regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Liberation Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/mdr-content/fonts/LiberationSans-Bold.woff2') format('woff2');
}
@font-face {
    font-family: 'Liberation Sans';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('/mdr-content/fonts/LiberationSans-Italic.woff2') format('woff2');
}
@font-face {
    font-family: 'Liberation Sans';
    font-style: italic;
    font-weight: 700;
    font-display: swap;
    src: url('/mdr-content/fonts/LiberationSans-BoldItalic.woff2') format('woff2');
}

/* ==== Non-Latin script faces (bundled, one per writing system) ==================
   Each script has its OWN self-hosted face plus a `unicode-range`, so the browser
   downloads it ONLY when a character in that range actually appears on the page —
   declaring a face never fetches it. The :lang() rules at the foot then select the
   face for text tagged with a matching language. The base Latin/Greek/Cyrillic/
   Hebrew stays on Liberation Sans; these faces only add the scripts it lacks.
   Alphabetic/abugida scripts ship Regular + Bold; the large CJK faces ship Regular
   only (bold is synthesized) to keep their size down — and only ever load for a CJK
   reader. Subset ranges match each face's `unicode-range`. */

/* Arabic — ar + languages in Arabic script (fa/ur/ps/ckb/sd/ug) */
@font-face { font-family: 'Noto Naskh Arabic'; src: url('/mdr-content/fonts/NotoNaskhArabic-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }

/* Devanagari — Hindi (hi), Marathi (mr) */
@font-face { font-family: 'Noto Sans Devanagari'; src: url('/mdr-content/fonts/NotoSansDevanagari-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0900-097F, U+A8E0-A8FF; }
@font-face { font-family: 'Noto Sans Devanagari'; src: url('/mdr-content/fonts/NotoSansDevanagari-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0900-097F, U+A8E0-A8FF; }

/* Bengali — Bengali (bn) */
@font-face { font-family: 'Noto Sans Bengali'; src: url('/mdr-content/fonts/NotoSansBengali-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0980-09FF; }
@font-face { font-family: 'Noto Sans Bengali'; src: url('/mdr-content/fonts/NotoSansBengali-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0980-09FF; }

/* Gurmukhi — Punjabi (pa) */
@font-face { font-family: 'Noto Sans Gurmukhi'; src: url('/mdr-content/fonts/NotoSansGurmukhi-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0A00-0A7F; }
@font-face { font-family: 'Noto Sans Gurmukhi'; src: url('/mdr-content/fonts/NotoSansGurmukhi-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0A00-0A7F; }

/* Telugu — Telugu (te) */
@font-face { font-family: 'Noto Sans Telugu'; src: url('/mdr-content/fonts/NotoSansTelugu-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0C00-0C7F; }
@font-face { font-family: 'Noto Sans Telugu'; src: url('/mdr-content/fonts/NotoSansTelugu-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0C00-0C7F; }

/* Tamil — Tamil (ta) */
@font-face { font-family: 'Noto Sans Tamil'; src: url('/mdr-content/fonts/NotoSansTamil-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0B80-0BFF; }
@font-face { font-family: 'Noto Sans Tamil'; src: url('/mdr-content/fonts/NotoSansTamil-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0B80-0BFF; }

/* Thai — Thai (th) */
@font-face { font-family: 'Noto Sans Thai'; src: url('/mdr-content/fonts/NotoSansThai-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0E00-0E7F; }
@font-face { font-family: 'Noto Sans Thai'; src: url('/mdr-content/fonts/NotoSansThai-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0E00-0E7F; }

/* Ethiopic — Amharic (am) */
@font-face { font-family: 'Noto Sans Ethiopic'; src: url('/mdr-content/fonts/NotoSansEthiopic-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+1200-137F, U+1380-139F, U+2D80-2DDF, U+AB00-AB2F; }
@font-face { font-family: 'Noto Sans Ethiopic'; src: url('/mdr-content/fonts/NotoSansEthiopic-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+1200-137F, U+1380-139F, U+2D80-2DDF, U+AB00-AB2F; }

/* Javanese — Javanese (jv), in the Javanese script */
@font-face { font-family: 'Noto Sans Javanese'; src: url('/mdr-content/fonts/NotoSansJavanese-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+A980-A9DF; }
@font-face { font-family: 'Noto Sans Javanese'; src: url('/mdr-content/fonts/NotoSansJavanese-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+A980-A9DF; }

/* CJK — Regular only. Han unification means zh and ja share codepoints, so the
   :lang() rules (not unicode-range alone) pick SC vs JP. */
@font-face { font-family: 'Noto Sans SC'; src: url('/mdr-content/fonts/NotoSansSC-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+2E80-2EFF, U+3000-303F, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF; }
@font-face { font-family: 'Noto Sans JP'; src: url('/mdr-content/fonts/NotoSansJP-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+3000-303F, U+3040-30FF, U+31F0-31FF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF; }
@font-face { font-family: 'Noto Sans KR'; src: url('/mdr-content/fonts/NotoSansKR-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+1100-11FF, U+3000-303F, U+3130-318F, U+A960-A97F, U+AC00-D7A3, U+FF00-FFEF; }

/* ---- Script wiring (:lang overrides) ------------------------------------------
   Assign the bundled per-script face to text tagged with the matching language, so
   it renders with the bundled face instead of an OS fallback (which many systems
   lack for these scripts → "tofu" boxes). Works both for a whole installation in one
   language (<html lang="hi">) and for a single foreign value inside an otherwise-
   Latin page (<span lang="ja">…</span>) — so e.g. a language-name list shows each
   name in its own script. Each rule keeps 'Liberation Sans' as the second step, so
   Latin/digits/punctuation inside a foreign element still render on the base face;
   the script face's unicode-range confines it to its own characters. Base
   Latin/Greek/Cyrillic/Hebrew text is untouched (no matching :lang rule). */
:lang(ar), :lang(fa), :lang(ur), :lang(ps), :lang(ckb), :lang(sd), :lang(ug) { font-family: 'Noto Naskh Arabic', 'Liberation Sans', sans-serif; }
:lang(hi), :lang(mr) { font-family: 'Noto Sans Devanagari', 'Liberation Sans', sans-serif; }
:lang(bn) { font-family: 'Noto Sans Bengali', 'Liberation Sans', sans-serif; }
:lang(pa) { font-family: 'Noto Sans Gurmukhi', 'Liberation Sans', sans-serif; }
:lang(te) { font-family: 'Noto Sans Telugu', 'Liberation Sans', sans-serif; }
:lang(ta) { font-family: 'Noto Sans Tamil', 'Liberation Sans', sans-serif; }
:lang(th) { font-family: 'Noto Sans Thai', 'Liberation Sans', sans-serif; }
:lang(am) { font-family: 'Noto Sans Ethiopic', 'Liberation Sans', sans-serif; }
:lang(jv) { font-family: 'Noto Sans Javanese', 'Liberation Sans', sans-serif; }
:lang(zh) { font-family: 'Noto Sans SC', 'Liberation Sans', sans-serif; }
:lang(ja) { font-family: 'Noto Sans JP', 'Liberation Sans', sans-serif; }
:lang(ko) { font-family: 'Noto Sans KR', 'Liberation Sans', sans-serif; }

/* ==== Serif faces — article long-form text (selected per language via article:lang) ====
   The base article serif is self-hosted 'Gelasio' (metric-compatible with Georgia →
   same look/layout, but shippable), Latin only; 'Noto Serif' catches Cyrillic/Greek in
   the --font-serif stack (essential.css). The article:lang() rules below UPGRADE the
   article body to the language's proper serif — they outrank the sans :lang() rules
   (specificity article:lang = 0,1,1 > :lang = 0,1,0), so an <article> in a non-Latin
   language shows its SERIF while the surrounding UI stays sans. Headings/UI use
   --font-sans and are untouched. Each face has a unicode-range, so it loads only when
   its characters appear (a plain English article loads only Gelasio). No serif is
   shipped for CJK (Gothic/sans is the screen norm — keeps Noto Sans SC/JP/KR), Arabic
   (Naskh) or Javanese (sans); those article languages fall through to their sans face. */

/* Gelasio — Latin article serif (Georgia-metric) */
@font-face { font-family:'Gelasio'; src:url('/mdr-content/fonts/Gelasio-Regular.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; unicode-range:U+0000-024F,U+0300-036F,U+1E00-1EFF,U+2000-206F,U+20A0-20BF,U+2100-214F,U+2190-21FF,U+2200-22FF; }
@font-face { font-family:'Gelasio'; src:url('/mdr-content/fonts/Gelasio-Bold.woff2') format('woff2'); font-weight:700; font-style:normal; font-display:swap; unicode-range:U+0000-024F,U+0300-036F,U+1E00-1EFF,U+2000-206F,U+20A0-20BF,U+2100-214F,U+2190-21FF,U+2200-22FF; }
@font-face { font-family:'Gelasio'; src:url('/mdr-content/fonts/Gelasio-Italic.woff2') format('woff2'); font-weight:400; font-style:italic; font-display:swap; unicode-range:U+0000-024F,U+0300-036F,U+1E00-1EFF,U+2000-206F,U+20A0-20BF,U+2100-214F,U+2190-21FF,U+2200-22FF; }
@font-face { font-family:'Gelasio'; src:url('/mdr-content/fonts/Gelasio-BoldItalic.woff2') format('woff2'); font-weight:700; font-style:italic; font-display:swap; unicode-range:U+0000-024F,U+0300-036F,U+1E00-1EFF,U+2000-206F,U+20A0-20BF,U+2100-214F,U+2190-21FF,U+2200-22FF; }

/* PT Serif — Cyrillic article serif (built for Cyrillic; Latin included for all-PT articles) */
@font-face { font-family:'PT Serif'; src:url('/mdr-content/fonts/PTSerif-Regular.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; unicode-range:U+0000-024F,U+0300-036F,U+0400-052F,U+2000-206F,U+2100-214F; }
@font-face { font-family:'PT Serif'; src:url('/mdr-content/fonts/PTSerif-Bold.woff2') format('woff2'); font-weight:700; font-style:normal; font-display:swap; unicode-range:U+0000-024F,U+0300-036F,U+0400-052F,U+2000-206F,U+2100-214F; }
@font-face { font-family:'PT Serif'; src:url('/mdr-content/fonts/PTSerif-Italic.woff2') format('woff2'); font-weight:400; font-style:italic; font-display:swap; unicode-range:U+0000-024F,U+0300-036F,U+0400-052F,U+2000-206F,U+2100-214F; }
@font-face { font-family:'PT Serif'; src:url('/mdr-content/fonts/PTSerif-BoldItalic.woff2') format('woff2'); font-weight:700; font-style:italic; font-display:swap; unicode-range:U+0000-024F,U+0300-036F,U+0400-052F,U+2000-206F,U+2100-214F; }

/* Noto Serif — Greek + Cyrillic serif (also the --font-serif fallback for those scripts) */
@font-face { font-family:'Noto Serif'; src:url('/mdr-content/fonts/NotoSerif-Regular.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; unicode-range:U+0000-024F,U+0300-036F,U+0370-03FF,U+0400-052F,U+1F00-1FFF,U+2000-206F,U+2100-214F; }
@font-face { font-family:'Noto Serif'; src:url('/mdr-content/fonts/NotoSerif-Bold.woff2') format('woff2'); font-weight:700; font-style:normal; font-display:swap; unicode-range:U+0000-024F,U+0300-036F,U+0370-03FF,U+0400-052F,U+1F00-1FFF,U+2000-206F,U+2100-214F; }
@font-face { font-family:'Noto Serif'; src:url('/mdr-content/fonts/NotoSerif-Italic.woff2') format('woff2'); font-weight:400; font-style:italic; font-display:swap; unicode-range:U+0000-024F,U+0300-036F,U+0370-03FF,U+0400-052F,U+1F00-1FFF,U+2000-206F,U+2100-214F; }

/* Noto Serif per non-Latin script (Regular + Bold), used by the article:lang rules below */
@font-face { font-family:'Noto Serif Devanagari'; src:url('/mdr-content/fonts/NotoSerifDevanagari-Regular.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; unicode-range:U+0900-097F,U+A8E0-A8FF; }
@font-face { font-family:'Noto Serif Devanagari'; src:url('/mdr-content/fonts/NotoSerifDevanagari-Bold.woff2') format('woff2'); font-weight:700; font-style:normal; font-display:swap; unicode-range:U+0900-097F,U+A8E0-A8FF; }
@font-face { font-family:'Noto Serif Bengali'; src:url('/mdr-content/fonts/NotoSerifBengali-Regular.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; unicode-range:U+0980-09FF; }
@font-face { font-family:'Noto Serif Bengali'; src:url('/mdr-content/fonts/NotoSerifBengali-Bold.woff2') format('woff2'); font-weight:700; font-style:normal; font-display:swap; unicode-range:U+0980-09FF; }
@font-face { font-family:'Noto Serif Gurmukhi'; src:url('/mdr-content/fonts/NotoSerifGurmukhi-Regular.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; unicode-range:U+0A00-0A7F; }
@font-face { font-family:'Noto Serif Gurmukhi'; src:url('/mdr-content/fonts/NotoSerifGurmukhi-Bold.woff2') format('woff2'); font-weight:700; font-style:normal; font-display:swap; unicode-range:U+0A00-0A7F; }
@font-face { font-family:'Noto Serif Telugu'; src:url('/mdr-content/fonts/NotoSerifTelugu-Regular.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; unicode-range:U+0C00-0C7F; }
@font-face { font-family:'Noto Serif Telugu'; src:url('/mdr-content/fonts/NotoSerifTelugu-Bold.woff2') format('woff2'); font-weight:700; font-style:normal; font-display:swap; unicode-range:U+0C00-0C7F; }
@font-face { font-family:'Noto Serif Tamil'; src:url('/mdr-content/fonts/NotoSerifTamil-Regular.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; unicode-range:U+0B80-0BFF; }
@font-face { font-family:'Noto Serif Tamil'; src:url('/mdr-content/fonts/NotoSerifTamil-Bold.woff2') format('woff2'); font-weight:700; font-style:normal; font-display:swap; unicode-range:U+0B80-0BFF; }
@font-face { font-family:'Noto Serif Thai'; src:url('/mdr-content/fonts/NotoSerifThai-Regular.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; unicode-range:U+0E00-0E7F; }
@font-face { font-family:'Noto Serif Thai'; src:url('/mdr-content/fonts/NotoSerifThai-Bold.woff2') format('woff2'); font-weight:700; font-style:normal; font-display:swap; unicode-range:U+0E00-0E7F; }
@font-face { font-family:'Noto Serif Ethiopic'; src:url('/mdr-content/fonts/NotoSerifEthiopic-Regular.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; unicode-range:U+1200-137F,U+1380-139F,U+2D80-2DDF,U+AB00-AB2F; }
@font-face { font-family:'Noto Serif Ethiopic'; src:url('/mdr-content/fonts/NotoSerifEthiopic-Bold.woff2') format('woff2'); font-weight:700; font-style:normal; font-display:swap; unicode-range:U+1200-137F,U+1380-139F,U+2D80-2DDF,U+AB00-AB2F; }

/* article:lang() — the article body gets its language's serif (UI stays sans) */
article:lang(ru), article:lang(uk), article:lang(be), article:lang(bg) { font-family: 'PT Serif', 'Noto Serif', serif; }
article:lang(el) { font-family: 'Noto Serif', serif; }
article:lang(hi), article:lang(mr) { font-family: 'Noto Serif Devanagari', 'Gelasio', serif; }
article:lang(bn) { font-family: 'Noto Serif Bengali', 'Gelasio', serif; }
article:lang(pa) { font-family: 'Noto Serif Gurmukhi', 'Gelasio', serif; }
article:lang(te) { font-family: 'Noto Serif Telugu', 'Gelasio', serif; }
article:lang(ta) { font-family: 'Noto Serif Tamil', 'Gelasio', serif; }
article:lang(th) { font-family: 'Noto Serif Thai', 'Gelasio', serif; }
article:lang(am) { font-family: 'Noto Serif Ethiopic', 'Gelasio', serif; }
