/* ===========================================================================
   PropEdge — self-hosted web fonts
   Ayaz · 20 Sep 2026 · decision register D2 (typeface), D18 (source), D19 (self-host)

   WHY THIS FILE EXISTS
   Until today every preview page in design/ pulled IBM Plex from Google's font
   CDN. That made "we self-host the fonts" a plan rather than a fact, and it had
   three real consequences:
     1. a staging box behind a firewall renders these pages in Tahoma;
     2. a visitor in Muscat calls a third party before consenting to anything;
     3. a tight Content-Security-Policy is impossible while an external font
        host has to be allow-listed (GAP-14).

   LIVE COPY — Mahenoor, 27 Sep 2026, with the Login .aspx (D29).
   This is design/css/propedge-fonts.css with exactly one change, the path
   prefix in every src: url(): the design copy reaches the fonts with
   ../../PropEdge_UI/fonts/IBM-Plex/ ; this file, at css/propedge-fonts.css,
   uses ../fonts/IBM-Plex/ . Nothing else differs. If the design copy
   changes, re-copy it and re-apply only that prefix.
   propedge-fonts.inline.css is NOT this file — it is preview-only base64
   and must never ship.

   Nothing else in the file changes. Do not rename the families.

   SOURCE AND LICENCE — recorded so it can be audited, per D18
     IBM Plex Sans          release  @ibm/plex-sans@1.1.0        font version 3.005
     IBM Plex Sans Arabic   release  @ibm/plex-sans-arabic@1.1.0 font version 1.005
     Both downloaded from github.com/IBM/plex releases on 20 Sep 2026.
     SIL Open Font License 1.1, WITH the Reserved Font Name "Plex".
     OFL.txt travels in PropEdge_UI/fonts/IBM-Plex/ alongside the files.
     The .woff2 are IBM's own bytes, unmodified. Do NOT subset or re-generate
     them: a modified file may not keep "IBM Plex" in its internal name, and
     renaming the family would break every font-family declaration we have.

   WEIGHTS
   400 / 600 / 700 only, in both scripts. Verified from the matching .ttf:
   usWeightClass is 400 / 600 / 700 on both sides, unitsPerEm 1000 on both,
   capHeight 698 on both, xHeight 516 / 522 / 525 on both. A Bold Latin and a
   Bold Arabic heading therefore sit at the same cap height and the same
   optical weight. 300 and 500 are deliberately absent; if a design asks for
   one, ask Ayaz rather than letting the browser synthesise it.

   THE ONE METRIC THAT DOES NOT MATCH — read this before setting line-height
   Measured from the same .ttf files:
       IBM Plex Sans          hhea ascent 1025  descent -275  => 1.300 em line box
       IBM Plex Sans Arabic   hhea ascent 1085  descent -415  => 1.500 em line box
   Neither face sets USE_TYPO_METRICS, so those are the numbers browsers use.
   A block with line-height: normal is therefore about 15% taller in Arabic
   than in English, and a table row will visibly change height when the
   language is switched. ALWAYS set line-height explicitly, from the Arabic
   scale in tokens/typography.json under [dir="rtl"]. Never leave it to normal.
   =========================================================================== */

/* --------------------------------------------------------------- Latin --- */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/IBM-Plex/IBMPlexSans-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/IBM-Plex/IBMPlexSans-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/IBM-Plex/IBMPlexSans-Bold.woff2") format("woff2");
}

/* -------------------------------------------------------------- Arabic --- */
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/IBM-Plex/IBMPlexSansArabic-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/IBM-Plex/IBMPlexSansArabic-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/IBM-Plex/IBMPlexSansArabic-Bold.woff2") format("woff2");
}

/* ---------------------------------------------------------------------------
   IBM Plex Mono is referenced by --pe-font-mono but is NOT self-hosted.
   It is used only for code samples in the design documentation, never in the
   product, so it falls back to ui-monospace / Consolas. If the product ever
   needs it, take it from @ibm/plex-mono and add it here the same way.

   HOW TO PROVE THE FONT ACTUALLY LOADED (acceptance criterion X5)
   Do NOT use document.fonts.check(). Measured 20 Sep: it returns TRUE for a
   family that does not exist at all, because nothing needs loading. A page
   rendering in Tahoma will still report "true". Compare advance widths
   instead — see .pe-font-probe below and the assertion in
   design/propedge-verification.html.
   --------------------------------------------------------------------------- */

.pe-font-probe {
  position: absolute;
  visibility: hidden;
  white-space: nowrap;
  font-size: 100px;
  line-height: 1;
}
