/* Local stand-in for fonts.googleapis.com/css?family=Roboto
 *
 * Served at /static/vendor/fonts/roboto.css. Benchling's shipped page asks for
 * the Google-hosted stylesheet in TWO places (the captured entry HTML's <head>,
 * and a jQuery `.append('<link href="<that same Google URL>">')`
 * inside editor.*.js that injects it into the rich-text-editor iframe's own
 * document) -- see hermetic.py's inventory. Both are rewritten to this file.
 *
 * UPDATE: each face now ends with a vendored same-origin woff2 (latin subset,
 * see VENDORED.md for source/sha256/licence) AFTER the local() sources, so an
 * OS-installed Roboto still wins and everything else gets real Roboto metrics
 * instead of the generic fallback. The historical rationale below explains why
 * Google's own stylesheet is still not used.
 *
 * WHY local() SOURCES AND NOT VENDORED woff2 BINARIES (original rationale):
 *
 * 1. Google's stylesheet is NOT a stable vendorable artifact. The bytes it
 *    returns depend on the requesting User-Agent (woff2 for a modern browser,
 *    ttf/eot for older ones) and on Google's own rolling font revisions, so a
 *    recorded sha256 of "the Roboto CSS" would be a fiction -- it would not
 *    match what the CI browser would have received, and it would drift without
 *    any change on our side. A file whose provenance cannot be pinned is
 *    exactly the kind of thing VENDORED.md exists to refuse.
 * 2. It would pull font BINARIES from a second external host. The stylesheet's
 *    every @font-face `src` points at fonts.gstatic.com, so serving Google's
 *    CSS verbatim from our own origin does not make the page hermetic at all --
 *    it just moves the leak one hop down. Vendoring the binaries instead means
 *    carrying ~20 woff2 files in the wheel for every weight/style/subset the
 *    stylesheet declares.
 * 3. The behavioural cost is bounded and known. Benchling's own benchling.css
 *    names Roboto in exactly ONE rule (`font-family: 'Roboto', sans-serif`) and
 *    once more inside a long system-font fallback stack; everything else uses
 *    the system stack. With `local()` the browser uses an OS-installed Roboto
 *    when there is one and the generic `sans-serif` otherwise -- i.e. the same
 *    outcome that rule's own declared fallback already specifies.
 *
 * The residual risk, stated rather than hidden: text metrics in that one rule
 * can differ from a run that reached Google. No spec in aetia's mock-tenant
 * suite asserts on text width or on a webfont having loaded, and the structured
 * -table geometry that DID break when CSS went missing (#184) comes from
 * FixedDataTable's position rules in benchling.css, not from font metrics.
 * Only a browser can confirm the rendered result; see this package's
 * hermeticity tests for what is machine-checked.
 */

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Roboto'), local('Roboto-Regular'), local('Roboto Regular'),
       url('roboto-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: local('Roboto Medium'), local('Roboto-Medium'), local('Roboto'),
       url('roboto-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Roboto Bold'), local('Roboto-Bold'), local('Roboto'),
       url('roboto-latin-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: local('Roboto Italic'), local('Roboto-Italic'), local('Roboto'),
       url('roboto-latin-400-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: local('Roboto Bold Italic'), local('Roboto-BoldItalic'), local('Roboto'),
       url('roboto-latin-700-italic.woff2') format('woff2');
}
