/* Stand-in fonts for the hero and the booking bar (landing page only) */

/* Until Bebas Neue and Barlow arrive from Google Fonts, the page draws its
   text in a font the device already has. These stand-ins are that font
   scaled (size-adjust) so each line of text takes the same width as in the
   web font. Lines break in the same places, so nothing moves when the web
   font arrives.

   Two stand-ins per web font: one built on Roboto (Android phones have it),
   then one built on Arial (iPhones, Macs and Windows have it). A device
   uses the first one it has.

   Only index.html links this file. how-to-play.html and press.html use some
   of the same class names (.hero among them) and stay as they are.

   How each size-adjust was found, measured with letter-spacing left out:
   - A face that draws one phrase takes that phrase's width in the web font
     divided by its width in the local font: the hook (the italic faces).
   - The title (Bebas Neue) is two lines with a hard break. Its value sits
     between the two lines' ratios, so neither line is more than about 2%
     off, and neither can reach the edge of the text column.
   - The other faces draw several texts that want different values. Each
     was chosen by laying out the hero and the bar at every width from 320
     to 480 and at every size the stand-in test lists: the value that is
     clean at every listed size and leaves the fewest widths from 320 to
     480 with a different line break.
   When a size-adjust changes, its two overrides are worked out again from
   it, as below.

   Each stand-in also takes its web font's height above and below the
   baseline (ascent-override, descent-override): 1.00 and 0.20 of the font
   size for Barlow, 0.95 and 0.35 for Bebas Neue. The hero's buttons sit on
   a line whose height depends on those two, whatever the line-height, so
   without them each button line is 2px taller in the stand-in; and the
   title's letters would sit 20px lower in their line until Bebas Neue
   arrives. The browser scales the overrides by size-adjust, so each is the
   web font's value divided by the face's size-adjust. Safari ignores them,
   so there the button lines and the title still move a little.

   Changing a font, a size or the words in the hero or the booking bar can
   break lines differently again. The check is the layout test "the hero
   and the booking bar take the same space before and after the fonts
   arrive" in tests/layout/gates.spec.js; when it fails, re-tune that face's
   size-adjust and recompute its two overrides.

   A browser that does not know size-adjust (Safari 16 and older) draws
   these stand-ins at full size, which lays the hero out as it did before
   this file existed. The layout test "browsers that do not know
   size-adjust see the hero as they did before" holds that. */

/* Bebas Neue: the hero title, "About Last" and "Night..." */
@font-face {
    font-family: 'Bebas Neue Stand-in Roboto';
    src: local('Roboto'), local('Roboto-Regular');
    font-weight: 400;
    size-adjust: 73.2%;
    ascent-override: 129.78%;
    descent-override: 47.81%;
}

@font-face {
    font-family: 'Bebas Neue Stand-in Arial';
    src: local('Arial'), local('ArialMT');
    font-weight: 400;
    size-adjust: 73.8%;
    ascent-override: 128.73%;
    descent-override: 47.43%;
}

/* Barlow 300: the tagline and the awards line */
@font-face {
    font-family: 'Barlow Stand-in Roboto';
    src: local('Roboto Light'), local('Roboto-Light');
    font-weight: 300;
    size-adjust: 94.8%;
    ascent-override: 105.49%;
    descent-override: 21.1%;
}

@font-face {
    font-family: 'Barlow Stand-in Arial';
    src: local('Arial'), local('ArialMT');
    font-weight: 300;
    size-adjust: 87.9%;
    ascent-override: 113.77%;
    descent-override: 22.75%;
}

/* Barlow 300 italic: the hook. Barlow has no italic here (the browser
   slants the upright), and the hook is not in capitals, so these faces
   are its own, set to its measured width ratio. */
@font-face {
    font-family: 'Barlow Stand-in Roboto';
    src: local('Roboto Light Italic'), local('Roboto-LightItalic');
    font-weight: 300;
    font-style: italic;
    size-adjust: 100.43%;
    ascent-override: 99.57%;
    descent-override: 19.91%;
}

@font-face {
    font-family: 'Barlow Stand-in Arial';
    src: local('Arial Italic'), local('Arial-ItalicMT');
    font-weight: 300;
    font-style: italic;
    size-adjust: 96.66%;
    ascent-override: 103.46%;
    descent-override: 20.69%;
}

/* Barlow 400: the press line and the bar's dividers */
@font-face {
    font-family: 'Barlow Stand-in Roboto';
    src: local('Roboto'), local('Roboto-Regular');
    font-weight: 400;
    size-adjust: 95.2%;
    ascent-override: 105.04%;
    descent-override: 21.01%;
}

@font-face {
    font-family: 'Barlow Stand-in Arial';
    src: local('Arial'), local('ArialMT');
    font-weight: 400;
    size-adjust: 87.4%;
    ascent-override: 114.42%;
    descent-override: 22.88%;
}

/* Barlow 700, also drawn for 600: the hero buttons and the bar's lines */
@font-face {
    font-family: 'Barlow Stand-in Roboto';
    src: local('Roboto Bold'), local('Roboto-Bold');
    font-weight: 600 700;
    size-adjust: 95.3%;
    ascent-override: 104.93%;
    descent-override: 20.99%;
}

@font-face {
    font-family: 'Barlow Stand-in Arial';
    src: local('Arial Bold'), local('Arial-BoldMT');
    font-weight: 600 700;
    size-adjust: 87.9%;
    ascent-override: 113.77%;
    descent-override: 22.75%;
}

.hero h1 {
    font-family: 'Bebas Neue', 'Bebas Neue Stand-in Roboto', 'Bebas Neue Stand-in Arial', sans-serif;
}

.hero-content,
.booking-bar,
.booking-bar .booking-dates {
    font-family: 'Barlow', 'Barlow Stand-in Roboto', 'Barlow Stand-in Arial', sans-serif;
}
