/*
 * Self-hosted font faces (task_mms_live_has_no_page_cache_20260924, CLS fix,
 * 2026-11-12). Replaces the fonts.googleapis.com CDN link that mms_enqueue_assets()
 * used to load (removed in functions.php the same commit). Both files are the
 * Google Fonts "latin" subset of the real variable-font binary Google serves to a
 * modern Chrome UA (confirmed via fontTools: both carry an fvar wght axis, so one
 * file per family covers every weight this theme uses, same as the CDN response
 * which pointed every discrete-weight @font-face at the same URL).
 *
 * Why self-host: removes the DNS + TLS + request round trip to fonts.googleapis.com
 * and fonts.gstatic.com (two separate origins) that was blocking first paint of any
 * text behind a webfont. Files are served from the same origin as the page, so they
 * benefit from the new page cache and from HTTP/2 multiplexing with the rest of the
 * page's assets.
 *
 * Fallback metric matching (the actual CLS fix): a browser renders text in the
 * fallback font stack first, then swaps to the webfont once it loads (font-display:
 * swap). If the fallback font has different average character width and vertical
 * metrics than the real font, that swap changes how much horizontal and vertical
 * space the text occupies, which is itself a layout shift. "Unbounded Fallback" and
 * "Work Sans Fallback" below are Arial sized and shaped (via size-adjust,
 * ascent-override, descent-override) to approximate each real font's box as closely
 * as a single linear transform of Arial can get, so the swap moves surrounding
 * content less. Ratios computed from each file's own OS/2 and hhea tables
 * (xAvgCharWidth, ascent, descent) against Arial's published metrics
 * (unitsPerEm 2048, xAvgCharWidth 904, ascent 1854, descent -434), the same method
 * used by next/font and the Fontaine library:
 *   size-adjust = (ownAvgCharWidth/ownUnitsPerEm) / (arialAvgCharWidth/arialUnitsPerEm)
 *   ascent-override = (ownAscent/ownUnitsPerEm) / size-adjust
 *   descent-override = (|ownDescent|/ownUnitsPerEm) / size-adjust
 * These are approximations, not a byte-for-byte metric match: a variable-weight
 * display font (Unbounded) does not have one single width, this uses the file's
 * OS/2 average. Still materially closer than the un-adjusted "sans-serif" fallback
 * theme.json shipped with before this fix, which is what should be measured in this
 * task's before/after.
 */

@font-face {
	font-family: 'Unbounded';
	font-style: normal;
	font-weight: 200 900;
	font-display: swap;
	src: url('../fonts/unbounded-variable-latin.woff2') format('woff2-variations'),
	     url('../fonts/unbounded-variable-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: 'Unbounded Fallback';
	src: local('Arial');
	size-adjust: 171.27%;
	ascent-override: 58.10%;
	descent-override: 14.30%;
	line-gap-override: 0%;
}

@font-face {
	font-family: 'Work Sans';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('../fonts/work-sans-variable-latin.woff2') format('woff2-variations'),
	     url('../fonts/work-sans-variable-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: 'Work Sans Fallback';
	src: local('Arial');
	size-adjust: 135.25%;
	ascent-override: 68.76%;
	descent-override: 17.97%;
	line-gap-override: 0%;
}
