/* ==========================================================================
   SELF-HOSTED WEBFONTS - extended subsets
   --------------------------------------------------------------------------
   Served from our own origin via WhiteNoise; nothing here touches
   fonts.googleapis.com or fonts.gstatic.com.

   Loaded via the partials/_fonts.html include. Do not add font links to
   individual templates: include that partial instead. Eight auth templates
   each carrying their own Google Fonts link is how the site ended up asking
   for DM Sans 600 on the main pages and 700 on the auth pages.

   WHAT LIVES WHERE
   The three latin faces that paint above the fold are declared inline in
   partials/_fonts.html, because a separate stylesheet would put a request
   chain (HTML -> fonts.css -> woff2) in front of the first paint. This file
   holds the latin-ext subsets, which are only fetched when a page actually
   contains those characters, so a chain costs nothing.

   The metric-matched fallback faces ('DM Sans Fallback', 'DM Serif Fallback')
   are also inline in the partial: they have to be parsed before first layout
   or the browser has already used the wrong metrics.

   Files: static/fonts/*.woff2
   Source: Google Fonts CSS API v17, latin + latin-ext subsets only.
   src paths are relative so ManifestStaticFilesStorage rewrites them at
   collectstatic time. Do not make them absolute.

   --------------------------------------------------------------------------
   FALLBACK METRIC DERIVATION (values applied in partials/_fonts.html)

   Read off the woff2 files with fontTools (hhea, normalised by unitsPerEm):
     DM Sans                  ascent 0.9920  descent -0.3100  lineGap 0.0000
     DM Serif Display         ascent 1.0360  descent -0.3350  lineGap 0.0000
     DM Serif Display italic  ascent 1.0360  descent -0.3350  lineGap 0.0000

   size-adjust was then tuned against real rendered text widths measured in
   Chrome, using the actual homepage copy at the actual sizes, rather than an
   abstract average advance. Measured widths:
     hero h1, 58px serif        DM Serif Display 1361.67px  Georgia 1363.64px
     hero em, 58px serif italic DM Serif Display  116.81px  Georgia  124.20px
     body,    16px sans w400    DM Sans          2078.38px  Arial   1978.38px

   Giving size-adjust = webfont width / fallback width:
     DM Sans        -> Arial            105.05%   (Segoe UI measured 105.07%)
     DM Serif       -> Georgia           99.86%
     DM Serif ital  -> Georgia Italic    94.05%

   ascent/descent overrides are the webfont's own ratios divided by
   size-adjust, because the overrides apply after the size adjustment:
     ascent-override  = (ascent  / upem) / size-adjust
     descent-override = |descent / upem| / size-adjust

   Georgia is already an almost exact width match for DM Serif Display roman,
   which is why the h1 block never visibly moved. The whole of the observed
   reflow was the italic <em> and the sans body copy.
   ========================================================================== */

/* --- DM Sans - variable, weight 100-1000, roman, latin-ext -------------- */

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("./fonts/dm-sans-var-latin-ext.b9209b52c467.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;
}

/* --- DM Serif Display - static 400, roman, latin-ext -------------------- */

@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/dm-serif-display-400-latin-ext.fbcccd02b7b0.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;
}

/* --- DM Serif Display - static 400, italic ------------------------------ */
/* The latin italic face is inline in partials/_fonts.html (homepage hero
   h1 contains an <em>). Only latin-ext lives here. */

@font-face {
  font-family: 'DM Serif Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/dm-serif-display-400-italic-latin-ext.b6dc2f28ec50.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;
}
