/*
 * The typefaces, and the two stacks that name them.
 *
 * These are declared here rather than in theme.json's
 * `settings.typography.fontFamilies`, which is the obvious home and would have
 * WordPress write the @font-face rules for us. Registering a family there is
 * also the only thing that puts the Font dropdown in the editor's Typography
 * panel, and there is no setting that registers a family while withholding the
 * control — an empty `fontFamilies` is what hides it. So the faces are declared
 * in CSS instead.
 *
 * Nothing is lost by that. This file is enqueued for the editor as well as the
 * front end (see tsm_site_stylesheets()), so the type renders in the Site
 * Editor and the post editor exactly as it does on the site. What goes is only
 * the author's ability to change it.
 *
 * The stacks that name these faces are --font-stack-body and
 * --font-stack-headings in variables.css, which theme.json's `styles` point at,
 * so each one is written once and read from both sides.
 */

/*
 * Instrument Sans, variable on both axes in one file. The weight range is the
 * whole of what the body face offers, so nothing anywhere needs to synthesise a
 * weight.
 */
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("../assets/fonts/InstrumentSans-VariableFont_wdth,wght.ttf")
    format("truetype");
}

/*
 * Successor, in the two cuts the design uses. `block` rather than `swap`: the
 * intro header fades its headline in 1.75s after load and must not fade it in
 * on the fallback face, and headings elsewhere are large enough that a swap
 * would be a visible reflow. Both cuts are preloaded on pages carrying the
 * intro header — see tsm_intro_header_preload_fonts().
 */
@font-face {
  font-family: Successor;
  font-style: normal;
  font-weight: 300;
  font-display: block;
  src: url("../assets/fonts/successor/Successor-Light.woff2") format("woff2");
}

@font-face {
  font-family: Successor;
  font-style: normal;
  font-weight: 500;
  font-display: block;
  src: url("../assets/fonts/successor/Successor-Medium.woff2") format("woff2");
}

@font-face {
  font-family: Successor;
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url("../assets/fonts/successor/Successor-Bold.woff2") format("woff2");
}
