/*
 * fonts.css — Metric-matched fallback faces for Oswald / Source Sans 3
 * ═══════════════════════════════════════════════════════════
 * PATH: public/css/fonts.css
 * ROLE: The Google Fonts <link> in layouts/public_main.php loads with
 *       font-display: swap, so on first paint the browser renders text in
 *       the next font in the stack (a system sans), then swaps to the real
 *       webfont once it arrives. A system sans has different average glyph
 *       width and vertical metrics than Oswald/Source Sans 3, so that swap
 *       reflows the page (a real layout-shift/CLS cost). These synthetic
 *       faces reuse Arial's outlines but override its metrics
 *       (size-adjust, ascent/descent/line-gap) to match the real webfont,
 *       so the fallback text occupies the same box the webfont will and the
 *       swap causes no layout shift.
 *
 *       Values computed 2026-09-21 with fontTools from the actual served
 *       weight-400 latin subset files (fonts.gstatic.com, Oswald v57 /
 *       Source Sans 3 v19) against Arial's published metrics
 *       (@capsizecss/metrics 4.3.0 — ascent 1854, descent -434,
 *       unitsPerEm 2048, xWidthAvg 913), via the standard
 *       size-adjust = webfont-avg-char-width / fallback-avg-char-width
 *       formula; ascent/descent then normalized to the webfont's
 *       proportions and divided by size-adjust. A locally installed
 *       Liberation Sans was tried first and rejected — its own OS/2
 *       xAvgCharWidth field (1187) disagrees with Arial's published value
 *       (913) enough to throw the ratio off, so the published capsize
 *       numbers are used instead. Arial Narrow was considered for Oswald
 *       (a condensed display font) but no reliably published metrics
 *       table for it could be found, so plain Arial is used for both —
 *       the box-metrics match still removes the swap-caused reflow even
 *       though the glyphs themselves are proportionally wider than
 *       Oswald's. Recompute if the Google Fonts weights change.
 * MODIFIED: 2026-09-21 — created (SEO round, WP-D)
 */

@font-face {
  font-family: 'Oswald Fallback';
  src: local('Arial');
  ascent-override: 123.97%;
  descent-override: 30.03%;
  line-gap-override: 0%;
  size-adjust: 96.23%;
}

@font-face {
  font-family: 'Source Sans 3 Fallback';
  src: local('Arial');
  ascent-override: 96.92%;
  descent-override: 37.86%;
  line-gap-override: 0%;
  size-adjust: 105.65%;
}
