/*
 * Self-hosted webfonts.
 *
 * These used to come from fonts.googleapis.com and api.fontshare.com. Serving
 * them ourselves removes a third-party dependency from every page render (a
 * failed fetch leaves headings in the fallback face until a reload), drops four
 * preconnects and two cross-origin stylesheet requests, and keeps visitors' IP
 * addresses off a third party, which matters more now that the site markets to
 * readers in the EU.
 *
 * The shared-cache argument for font CDNs no longer applies: browsers partition
 * the HTTP cache by top-level site (Chrome 86, Firefox 85, Safari earlier), so
 * a font fetched on another site is never reused here.
 *
 * vercel.json already serves *.woff2 with Cache-Control: max-age=31536000.
 * Filenames are therefore treated as immutable. Replacing a font means writing
 * a new filename, not overwriting one of these.
 */

/* --------------------------------------------------------- Cabinet Grotesk */
/*
 * The four weights api.fontshare.com was serving, taken from the official
 * download's Fonts/WEB/ folder unmodified. Same 405 characters as the CDN
 * build, verified by reading the cmap out of both.
 *
 * Discrete weights rather than the variable file that also ships in that
 * download, even though the variable one is 41 KB against 81 KB for these
 * four. Two reasons. A browser only ever fetches the weights a page actually
 * matches, so the four statics usually transfer less than the variable file
 * would. And declaring a 100 to 900 axis would restyle the site: Fontshare
 * declares 400, 500, 700 and 800, so an element at font-weight 600 currently
 * snaps to 700, and on a continuous axis it would render at a true 600.
 *
 * Licence: this is NOT an open font. See cabinet-grotesk-FFL.txt, and the
 * memory note, before reusing these files anywhere else.
 */
@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('/fonts/cabinet-grotesk-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('/fonts/cabinet-grotesk-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('/fonts/cabinet-grotesk-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('/fonts/cabinet-grotesk-800.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------------ Nunito */
/*
 * Nunito is a variable font. Google serves one file per unicode-range subset
 * and reuses it across every weight, so `wght@400;500;600;700` was four
 * @font-face blocks pointing at the same bytes. One block per subset here.
 *
 * The file's wght axis runs 200 to 1000, but the declared range is 400 to 700
 * because that is what Google was declaring. Widening it would change how the
 * site renders: elements at font-weight 800 currently match the 700 face and
 * are drawn at 700, and on the full axis they would suddenly be drawn at 800.
 * Moving where the fonts are served from should not restyle the page.
 *
 * Cyrillic, Greek and Vietnamese subsets are deliberately absent. Nothing on
 * the site is written in those scripts, and unicode-range means a browser only
 * fetches a subset it needs, so latin-ext costs nothing to keep as insurance
 * for place names in the travel posts.
 */
@font-face {
  font-family: 'Nunito';
  src: url('/fonts/nunito-variable-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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: 'Nunito';
  src: url('/fonts/nunito-variable-latin-ext.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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;
}
