/*
 * Metric-adjusted fallback faces — CLAUDE.md section 5.5, "CLS zero".
 *
 * Why this file exists instead of theme.json: WordPress compiles every
 * fontFace `src` through WP_Font_Face::compile_src(), which unconditionally
 * wraps the value as url('…') format('…'). A `local("Arial")` source would be
 * emitted as url('local("Arial")'), which resolves to nothing. Faces built on
 * a locally installed font therefore cannot be expressed in theme.json and
 * have to be declared here. Everything else — the real webfaces, and every
 * colour, size, space, radius and shadow — stays in theme.json.
 *
 * These faces render nothing of their own. They exist so that the text drawn
 * during `font-display: swap` occupies the same space as the webfont that
 * replaces it, which is what keeps CLS at zero.
 *
 * Every number below was measured from the actual font binaries with
 * fontTools: the average advance over the 63 ASCII letters, digits and space
 * that both fonts contain, plus the vertical metrics browsers actually use
 * (OS/2 typo metrics when USE_TYPO_METRICS is set, hhea otherwise).
 * OS/2.xAvgCharWidth was deliberately not used — foundries compute it under
 * two different definitions, and comparing it across fonts gives nonsense
 * (Inter against Arial reports 151%, which would draw the fallback half again
 * too large).
 */

/* Inter 0.5971 em average advance, Arial 0.5743 em. */
@font-face {
	font-family: "Inter Fallback";
	src: local("Arial"), local("Helvetica"), local("Liberation Sans");
	font-weight: 100 900;
	font-style: normal;
	size-adjust: 103.96%;
	ascent-override: 93.18%;
	descent-override: 23.20%;
	line-gap-override: 0%;
}

/* Cormorant Garamond 0.5213 em average advance, Georgia 0.5779 em. */
@font-face {
	font-family: "Cormorant Garamond Fallback";
	src: local("Georgia"), local("Times New Roman"), local("Liberation Serif");
	font-weight: 600;
	font-style: normal;
	size-adjust: 90.20%;
	ascent-override: 102.44%;
	descent-override: 31.82%;
	line-gap-override: 0%;
}

/*
 * Caveat 0.4352 em average advance, Arial 0.5743 em.
 *
 * The fallback is built on Arial rather than on the generic `cursive`
 * keyword on purpose: `cursive` resolves to a different face on every
 * platform, so its metrics cannot be matched and the swap would shift the
 * layout. A predictable adjusted sans is the better failure mode for a face
 * that only ever carries six decorative words (CLAUDE.md section 5.5).
 */
@font-face {
	font-family: "Caveat Fallback";
	src: local("Arial"), local("Helvetica"), local("Liberation Sans");
	font-weight: 500;
	font-style: normal;
	size-adjust: 75.78%;
	ascent-override: 126.67%;
	descent-override: 39.59%;
	line-gap-override: 0%;
}
