/**
 * Self-hosted Latin webfaces. Serving these ourselves keeps them on our own CDN and
 * removes a third-party request (GDPR).
 *
 * This file used to be called googlefonts-latin.css and was enqueued NOWHERE — it and
 * its woff2 files were built and committed, while the site loaded Google's CDN instead.
 * apptweak-theme.php now enqueues it for every language, which is also what stopped CJK
 * pages rendering Latin text in Helvetica.
 *
 * Sources:
 *   Bricolage Grotesque — fonts.gstatic.com, variable, SIL OFL 1.1
 *                         (upstream: github.com/ateliertriay/bricolage)
 *                         licence shipped alongside as fonts/bricolage-grotesque-OFL.txt
 *   Karla               — https://gwfh.mranftl.com/fonts/karla?subsets=latin
 *   Unbounded           — fonts.gstatic.com, variable, SIL OFL 1.1
 *                         (upstream: github.com/googlefonts/unbounded)
 *                         licence shipped alongside as fonts/unbounded-OFL.txt
*/

/* Bricolage Grotesque — VARIABLE, MAR-595 brand display face.
 *
 * `font-weight: 200 800` is a RANGE, deliberately. Declaring the range is what lets
 * `font-medium` / `font-bold` keep working and keep inheriting. Do NOT reach for
 * `font-variation-settings: 'wght' …` instead: per spec it outranks `font-weight`, so
 * every weight utility silently stops working and the value does not inherit.
 *
 * Optical sizing needs no descriptor here — the font carries an `opsz` axis and CSS
 * applies it automatically, because `font-optical-sizing` defaults to `auto`.
 *
 * Split by unicode-range so a page with no extended-Latin characters fetches only the
 * 75KB latin file and skips the 30KB latin-ext one. The ranges are copied verbatim from
 * Google's own css2 output for this family.
 */
@font-face {
  font-display: swap;
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  src: url('../fonts/bricolage-grotesque-v9-latin-variable.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-display: swap;
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  src: url('../fonts/bricolage-grotesque-v9-latin-ext-variable.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;
}

/* Bricolage Fallback — metric-compatible stand-in shown during the swap.
 *
 * Every number below was MEASURED, not estimated. A wrong size-adjust makes layout
 * shift worse than having no fallback at all, so guessing is not an option. Method:
 * load the real woff2 with FontFace(), then read canvas TextMetrics at a 1000px em for
 * Bricolage and for each candidate fallback. Measured (ascent / descent / width of
 * "Handgloves ASO 0123"):
 *
 *   Bricolage       930 / 270 / 9079.36   <- target
 *   Arial           905 / 212 / 10173.34  <- base chosen here
 *   Helvetica Neue  952 / 213 / 10151     (within 0.2% of Arial on width)
 *   system-ui       967 / 211 / 9540.04
 *   Karla           917 / 252 / 9741
 *
 * Bricolage is NARROWER than every candidate, so size-adjust has to come down.
 * Arial is the base because it is effectively universal and metric-standard, and
 * `local()` resolves it on macOS too.
 *
 *   size-adjust       = 9079.36 / 10173.34            = 89.25%
 *   ascent-override   = (930/1000) / 0.8925           = 104.21%
 *   descent-override  = (270/1000) / 0.8925           = 30.25%
 *
 * The overrides are divided by the ratio because size-adjust scales the metrics too;
 * multiplying back out reproduces 930 / 270 / 9079.4 exactly. If the font file is ever
 * re-subset or updated, RE-MEASURE — do not carry these numbers forward.
 */
@font-face {
  font-family: 'Bricolage Fallback';
  src: local('Arial');
  size-adjust: 89.25%;
  ascent-override: 104.21%;
  descent-override: 30.25%;
  line-gap-override: 0%;
}

/* Unbounded — VARIABLE, the Atlas AI display face (`font-ai`, and the Kit's AI H1/H2/H3).
 *
 * Self-hosted as of 2026-10-23, which closes the last fonts.googleapis.com request on
 * the public site. Before that it was fetched TWICE on every AI page: once by the theme
 * at `wght@700` only, and again by Elementor at all eighteen static weights, because
 * Elementor ships Unbounded as a GOOGLE font and an editor had picked it.
 *
 * The theme's own enqueue asked for 700 alone while the Kit uses 400, 500 and 700
 * (AI H3 400, AI H1 Regular and AI H2 500, AI H1 Bold 700). Elementor's broad fetch was
 * quietly covering the other two, so removing it WITHOUT self-hosting would have broken
 * three of the four AI heading styles. The variable file makes the question moot.
 *
 * `font-weight: 200 900` is the full axis range and is a RANGE for the same reason
 * Bricolage's is — see that block above before changing it.
 *
 * Source: fonts.gstatic.com v12, variable, SIL OFL 1.1
 *         (upstream: github.com/googlefonts/unbounded)
 *         licence shipped alongside as fonts/unbounded-OFL.txt
 */
@font-face {
  font-display: swap;
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 200 900;
  src: url('../fonts/unbounded-v12-latin-variable.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-display: swap;
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 200 900;
  src: url('../fonts/unbounded-v12-latin-ext-variable.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-20C4,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Lora is retired — MAR-595. Its three @font-face blocks and six files (woff2 + ttf for
   regular/italic/600) are deleted; the display face is Bricolage Grotesque, declared
   above and exposed as the --font-display token. */

/* karla-200 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Karla';
  font-style: normal;
  font-weight: 200;
  src: url('../fonts/karla-v31-latin-200.woff2') format('woff2'), url('../fonts/karla-v31-latin-200.ttf') format('truetype'); /* Chrome 4+, Firefox 3.5+, IE 9+, Safari 3.1+, iOS 4.2+, Android Browser 2.2+ */
}
/* karla-200italic - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Karla';
  font-style: italic;
  font-weight: 200;
  src: url('../fonts/karla-v31-latin-200italic.woff2') format('woff2'), url('../fonts/karla-v31-latin-200italic.ttf') format('truetype'); /* Chrome 4+, Firefox 3.5+, IE 9+, Safari 3.1+, iOS 4.2+, Android Browser 2.2+ */
}
/* karla-300 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Karla';
  font-style: normal;
  font-weight: 300;
  src: url('../fonts/karla-v31-latin-300.woff2') format('woff2'), url('../fonts/karla-v31-latin-300.ttf') format('truetype'); /* Chrome 4+, Firefox 3.5+, IE 9+, Safari 3.1+, iOS 4.2+, Android Browser 2.2+ */
}
/* karla-300italic - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Karla';
  font-style: italic;
  font-weight: 300;
  src: url('../fonts/karla-v31-latin-300italic.woff2') format('woff2'), url('../fonts/karla-v31-latin-300italic.ttf') format('truetype'); /* Chrome 4+, Firefox 3.5+, IE 9+, Safari 3.1+, iOS 4.2+, Android Browser 2.2+ */
}
/* karla-regular - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Karla';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/karla-v31-latin-regular.woff2') format('woff2'), url('../fonts/karla-v31-latin-regular.ttf') format('truetype'); /* Chrome 4+, Firefox 3.5+, IE 9+, Safari 3.1+, iOS 4.2+, Android Browser 2.2+ */
}
/* karla-italic - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Karla';
  font-style: italic;
  font-weight: 400;
  src: url('../fonts/karla-v31-latin-italic.woff2') format('woff2'), url('../fonts/karla-v31-latin-italic.ttf') format('truetype'); /* Chrome 4+, Firefox 3.5+, IE 9+, Safari 3.1+, iOS 4.2+, Android Browser 2.2+ */
}
/* karla-500 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Karla';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/karla-v31-latin-500.woff2') format('woff2'), url('../fonts/karla-v31-latin-500.ttf') format('truetype'); /* Chrome 4+, Firefox 3.5+, IE 9+, Safari 3.1+, iOS 4.2+, Android Browser 2.2+ */
}
/* karla-500italic - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Karla';
  font-style: italic;
  font-weight: 500;
  src: url('../fonts/karla-v31-latin-500italic.woff2') format('woff2'), url('../fonts/karla-v31-latin-500italic.ttf') format('truetype'); /* Chrome 4+, Firefox 3.5+, IE 9+, Safari 3.1+, iOS 4.2+, Android Browser 2.2+ */
}
/* karla-600 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Karla';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/karla-v31-latin-600.woff2') format('woff2'), url('../fonts/karla-v31-latin-600.ttf') format('truetype'); /* Chrome 4+, Firefox 3.5+, IE 9+, Safari 3.1+, iOS 4.2+, Android Browser 2.2+ */
}
/* karla-600italic - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Karla';
  font-style: italic;
  font-weight: 600;
  src: url('../fonts/karla-v31-latin-600italic.woff2') format('woff2'), url('../fonts/karla-v31-latin-600italic.ttf') format('truetype'); /* Chrome 4+, Firefox 3.5+, IE 9+, Safari 3.1+, iOS 4.2+, Android Browser 2.2+ */
}
/* karla-700 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Karla';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/karla-v31-latin-700.woff2') format('woff2'), url('../fonts/karla-v31-latin-700.ttf') format('truetype'); /* Chrome 4+, Firefox 3.5+, IE 9+, Safari 3.1+, iOS 4.2+, Android Browser 2.2+ */
}
/* karla-700italic - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Karla';
  font-style: italic;
  font-weight: 700;
  src: url('../fonts/karla-v31-latin-700italic.woff2') format('woff2'), url('../fonts/karla-v31-latin-700italic.ttf') format('truetype'); /* Chrome 4+, Firefox 3.5+, IE 9+, Safari 3.1+, iOS 4.2+, Android Browser 2.2+ */
}
/* karla-800 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Karla';
  font-style: normal;
  font-weight: 800;
  src: url('../fonts/karla-v31-latin-800.woff2') format('woff2'), url('../fonts/karla-v31-latin-800.ttf') format('truetype'); /* Chrome 4+, Firefox 3.5+, IE 9+, Safari 3.1+, iOS 4.2+, Android Browser 2.2+ */
}
/* karla-800italic - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Karla';
  font-style: italic;
  font-weight: 800;
  src: url('../fonts/karla-v31-latin-800italic.woff2') format('woff2'), url('../fonts/karla-v31-latin-800italic.ttf') format('truetype'); /* Chrome 4+, Firefox 3.5+, IE 9+, Safari 3.1+, iOS 4.2+, Android Browser 2.2+ */
}
