/*
 * Self-hosted Open Sans (issue #22).
 *
 * Replaces the fonts.googleapis.com stylesheet that Enfold injects via an
 * inline script (disabled through the avf_output_google_webfonts_script
 * filter in wofk-front-page-hero.php). The files are the Open Sans v44
 * variable-font woff2 subsets Google serves to modern browsers; one file
 * covers all weights the theme uses (400 and 600), so a single preload
 * makes the font available at first paint and prevents the fallback-font
 * size flash on the front-page hero title.
 *
 * unicode-range values are copied verbatim from the Google Fonts CSS so
 * the latin-ext file is only downloaded when such characters occur.
 */

/*
 * Metric-compatible fallback for the frames before the preloaded woff2 is
 * ready: production pages paint from the Hummingbird cache within ~50 ms,
 * faster than even a disk-cached font fetch, so with font-display: swap the
 * fallback font is briefly visible. The theme's font stack is
 * "open sans", Helvetica, Arial — these faces shadow "Helvetica" with a
 * size-adjusted Arial so that fallback text occupies the same width as
 * Open Sans and the swap is invisible. The ratios were measured per weight
 * against this site's woff2 (Open Sans 600 is narrower than Arial bold,
 * Open Sans 400 is wider than Arial regular); ascent/descent overrides are
 * Open Sans' hhea metrics (106.88 % / 29.30 %) divided by the size-adjust.
 */
@font-face {
	font-family: 'Helvetica';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: local('Arial');
	size-adjust: 104.85%;
	ascent-override: 101.94%;
	descent-override: 27.95%;
	line-gap-override: 0%;
}

@font-face {
	font-family: 'Helvetica';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: local('Arial Bold'), local('Arial-BoldMT'), local('Arial');
	size-adjust: 95.65%;
	ascent-override: 111.74%;
	descent-override: 30.63%;
	line-gap-override: 0%;
}

/* latin */
@font-face {
	font-family: 'Open Sans';
	font-style: normal;
	font-weight: 400 600;
	font-stretch: 100%;
	font-display: swap;
	src: url('../fonts/open-sans-v44-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;
}

/* latin-ext */
@font-face {
	font-family: 'Open Sans';
	font-style: normal;
	font-weight: 400 600;
	font-stretch: 100%;
	font-display: swap;
	src: url('../fonts/open-sans-v44-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
