/*
 * Self-hosted webfonts.
 *
 * Replaces the Google Fonts CDN stylesheet that used to be enqueued from
 * functions.php. Two reasons, one measured and one legal:
 *
 *   Measured on 29 August: three woff2 files at 162,872 bytes decoded plus a
 *   12,936 byte stylesheet, all from fonts.googleapis.com and fonts.gstatic.com.
 *   That was the largest third-party cost on the site, bigger than the
 *   background artwork, and it put a DNS lookup and a TLS handshake from a
 *   second origin on the critical path for text rendering.
 *
 *   Serving Google Fonts from Google's CDN sends every visitor's IP address to
 *   Google. That has been the subject of adverse rulings in the EU and is an
 *   avoidable question for a UK site.
 *
 * The files are the same upstream typefaces, taken from the Fontsource packages
 * (@fontsource-variable/caveat 5.3.0, @fontsource/cormorant-garamond 5.3.0,
 * @fontsource-variable/work-sans 5.3.0), which repackage the Google Fonts
 * originals. All three are SIL Open Font License 1.1; the licences are in this
 * folder.
 *
 * Caveat and Work Sans are variable fonts, so one file covers every weight in
 * the range and there is nothing to add if a weight is wanted later. Cormorant
 * Garamond is not variable, so only the three styles the theme actually uses
 * are here: 400, 600, and 400 italic.
 *
 * Only latin and latin-ext subsets are included. The unicode-range on each face
 * means a browser fetches latin-ext only if the page contains a character in
 * that range, so it costs nothing until it is needed. Cyrillic and Vietnamese
 * were left out; add them from the same packages if that ever changes.
 *
 * The variable families are declared under their plain names rather than
 * Fontsource's "Caveat Variable" and "Work Sans Variable", so theme.json needs
 * no change and nothing downstream has to know these fonts moved.
 *
 * font-display: swap throughout, matching what Google's stylesheet requested.
 *
 * 5.60 (9 October 2026): each latin file is split in two, cut from the same
 * file with fontTools (subsetter, all layout features and hinting kept, the
 * variable fonts keeping their whole weight range: limiting it moved Work
 * Sans 700's outlines). "basic" holds the characters of English text
 * (U+0020-007E, no-break space, middle dot, en and em dash, curly quotes,
 * ellipsis) and is what a page fetches and what is preloaded; "rest" holds
 * the remainder of the latin range and is fetched only for a page with one of
 * those characters. First visit: the three files every page uses, 148 KB, are
 * now 107 KB. Rendered in Chromium against the old files (seven family,
 * weight and style pairs at 14 to 96 px, twice the pixel density): the same
 * pixels for English text. A word mixing basic and rest characters (an
 * accented letter, a pound sign) is shaped in two runs, so kerning and
 * Caveat's joins across that one boundary can differ, as they already could
 * at the latin-ext boundary. The old files are in the theme's git history
 * (5.59). The files are cached for a year (5.60): a changed file gets a new
 * name.
 */

/* ---- Caveat, variable 400 to 700. Headings and the wordmark. ---------- */

@font-face {
	font-family: 'Caveat';
	font-style: normal;
	font-display: swap;
	font-weight: 400 700;
	src: url(./files/caveat-basic-wght.woff2) format('woff2-variations');
	unicode-range: U+0020-007E,U+00A0,U+00B7,U+2013-2014,U+2018-201D,U+2026;
}

@font-face {
	font-family: 'Caveat';
	font-style: normal;
	font-display: swap;
	font-weight: 400 700;
	src: url(./files/caveat-rest-wght.woff2) format('woff2-variations');
	unicode-range: U+0000-001F,U+007F-009F,U+00A1-00B6,U+00B8-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-2012,U+2015-2017,U+201E-2025,U+2027-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
	font-family: 'Caveat';
	font-style: normal;
	font-display: swap;
	font-weight: 400 700;
	src: url(./files/caveat-latin-ext-wght-normal.woff2) format('woff2-variations');
	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;
}

/* ---- Work Sans, variable 100 to 900. Nav and meta. -------------------- */

@font-face {
	font-family: 'Work Sans';
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url(./files/work-sans-basic-wght.woff2) format('woff2-variations');
	unicode-range: U+0020-007E,U+00A0,U+00B7,U+2013-2014,U+2018-201D,U+2026;
}

@font-face {
	font-family: 'Work Sans';
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url(./files/work-sans-rest-wght.woff2) format('woff2-variations');
	unicode-range: U+0000-001F,U+007F-009F,U+00A1-00B6,U+00B8-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-2012,U+2015-2017,U+201E-2025,U+2027-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
	font-family: 'Work Sans';
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url(./files/work-sans-latin-ext-wght-normal.woff2) format('woff2-variations');
	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;
}

/* ---- Cormorant Garamond. Body copy. ----------------------------------
   Static weights, so each style is its own file. 400 is the body, 600 is
   emphasis, 400 italic is the only italic the theme asks for. The body size
   of 24.5px was established by fitting this exact typeface to measured glyph
   widths from the WordPress.com original; see LOG.md. Do not substitute a
   different Garamond. */

@font-face {
	font-family: 'Cormorant Garamond';
	font-style: normal;
	font-display: swap;
	font-weight: 400;
	src: url(./files/cormorant-garamond-basic-400-normal.woff2) format('woff2');
	unicode-range: U+0020-007E,U+00A0,U+00B7,U+2013-2014,U+2018-201D,U+2026;
}

@font-face {
	font-family: 'Cormorant Garamond';
	font-style: normal;
	font-display: swap;
	font-weight: 400;
	src: url(./files/cormorant-garamond-rest-400-normal.woff2) format('woff2');
	unicode-range: U+0000-001F,U+007F-009F,U+00A1-00B6,U+00B8-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-2012,U+2015-2017,U+201E-2025,U+2027-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
	font-family: 'Cormorant Garamond';
	font-style: normal;
	font-display: swap;
	font-weight: 400;
	src: url(./files/cormorant-garamond-latin-ext-400-normal.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;
}

@font-face {
	font-family: 'Cormorant Garamond';
	font-style: normal;
	font-display: swap;
	font-weight: 600;
	src: url(./files/cormorant-garamond-basic-600-normal.woff2) format('woff2');
	unicode-range: U+0020-007E,U+00A0,U+00B7,U+2013-2014,U+2018-201D,U+2026;
}

@font-face {
	font-family: 'Cormorant Garamond';
	font-style: normal;
	font-display: swap;
	font-weight: 600;
	src: url(./files/cormorant-garamond-rest-600-normal.woff2) format('woff2');
	unicode-range: U+0000-001F,U+007F-009F,U+00A1-00B6,U+00B8-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-2012,U+2015-2017,U+201E-2025,U+2027-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
	font-family: 'Cormorant Garamond';
	font-style: normal;
	font-display: swap;
	font-weight: 600;
	src: url(./files/cormorant-garamond-latin-ext-600-normal.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;
}

@font-face {
	font-family: 'Cormorant Garamond';
	font-style: italic;
	font-display: swap;
	font-weight: 400;
	src: url(./files/cormorant-garamond-basic-400-italic.woff2) format('woff2');
	unicode-range: U+0020-007E,U+00A0,U+00B7,U+2013-2014,U+2018-201D,U+2026;
}

@font-face {
	font-family: 'Cormorant Garamond';
	font-style: italic;
	font-display: swap;
	font-weight: 400;
	src: url(./files/cormorant-garamond-rest-400-italic.woff2) format('woff2');
	unicode-range: U+0000-001F,U+007F-009F,U+00A1-00B6,U+00B8-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-2012,U+2015-2017,U+201E-2025,U+2027-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
	font-family: 'Cormorant Garamond';
	font-style: italic;
	font-display: swap;
	font-weight: 400;
	src: url(./files/cormorant-garamond-latin-ext-400-italic.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;
}
