/* ------------------------------------------------------------------
   Arabic fonts — served from this origin, loaded only on /ar/ routes.

   Regenerate with `bash scripts/build-fonts.sh`. The files are subset;
   do not copy them out of node_modules by hand.

   SELF-HOSTED, NOT GOOGLE. Every page view used to hand a Jeddah
   visitor's IP address to Google, which a German court has already held
   unlawful, and it is the sort of thing a Saudi PDPL review asks about.
   Self-hosting removes the question rather than answering it — and it
   removes two hosts from the CSP and two DNS lookups from the critical
   path at the same time.

   FOUR FILES, 84 KB, against a 90 KB budget (rule 04 §11).

   TWO OF THEM ARE LATIN, AND THEY ARE NOT OPTIONAL. IBM Plex Sans
   Arabic's `arabic` subset contains **no digits, no Latin letters and no
   comma or full stop** — verified against the binaries: 681 glyphs, not
   one of them ASCII. This site sets Western digits inside Arabic text by
   default (rule 01 §7), so without a Latin face every price, phone
   number, year and «XPEL» would fall back to whatever the system offers,
   at a different weight and different metrics, in the middle of a
   sentence. It is subtle enough to survive a review and visible enough
   to look cheap.

   The whole Latin subset would cost ~39 KB and put the page over budget,
   so it is cut to what an Arabic page actually uses (see the build
   script) — 9.8 KB per weight instead of 20. `unicode-range` is what
   makes the browser reach for it: same family name, so the two files
   behave as one font.

   TWO WEIGHTS, NOT FOUR. The CSS names 400/500/600/700, and four Arabic
   weights would be 130 KB. With 400 and 700 present the browser resolves
   500 to the regular face and 600 to the bold one — a difference nobody
   has noticed on a headline.
   ------------------------------------------------------------------ */

/* ---------------------------------------------------------- Arabic */

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  /* `swap`, never `block`. A blocked paint on a slow Jeddah connection is
     an invisible page; unstyled Arabic for 200 ms is a readable one. */
  font-display: swap;
  src: url('/fonts/plex-arabic-400.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+FDFC, U+FE70-FEFC;
}

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/plex-arabic-700.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+FDFC, U+FE70-FEFC;
}

/* ------------------------------------- Latin inside Arabic text ---
   Digits, punctuation and brand names. Same family, different range. */

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/plex-latin-400.woff2') format('woff2');
  unicode-range: U+0020-007E, U+00A0, U+00B0, U+00D7, U+2013, U+2014,
    U+2018, U+2019, U+201C, U+201D, U+2026, U+2039, U+203A, U+20AC;
}

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/plex-latin-700.woff2') format('woff2');
  unicode-range: U+0020-007E, U+00A0, U+00B0, U+00D7, U+2013, U+2014,
    U+2018, U+2019, U+201C, U+201D, U+2026, U+2039, U+203A, U+20AC;
}
