/* Font pairings on trial. The switcher sets data-type on <html>; with none set, the site's original fonts show.
   C (review round 2, shown first): Helvetica Bold with Garamond, and a decorative serif for the title.
      Helvetica needs a paid web licence, so TeX Gyre Heros stands in for every visitor: it is the open release of URW's
      Helvetica-metric design (GUST Font License). EB Garamond is the open revival of Claude Garamont's types (SIL OFL).
      The title is TeX Gyre Bonum Italic, the open Bookman: New York magazine's masthead is drawn on Bookman swash italic.
   A: Tangerine with Libra Sans. Libra Sans is built from the designer's published source (github.com/StefanPeev/Libra-Sans, SIL Open Font License).
      It comes in regular and bold only, so medium text uses the regular.
   B: Bodoni with Futura. Bodoni Moda is the open Bodoni. Futura needs a paid web licence, so Jost (drawn as a Futura homage) stands in
      for every visitor. A device's own copy of Futura is deliberately not used: reviewers must all see the same thing. */
@font-face { font-family: Tangerine; font-weight: 300 400; font-display: swap; size-adjust: 150%; src: url(../assets/fonts/tangerine-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Tangerine; font-weight: 500 700; font-display: swap; size-adjust: 150%; src: url(../assets/fonts/tangerine-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Libra Sans'; font-weight: 400 500; font-display: swap; src: url(../assets/fonts/libra-sans-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Libra Sans'; font-weight: 600 700; font-display: swap; src: url(../assets/fonts/libra-sans-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Bodoni Moda'; font-weight: 300 400; font-display: swap; size-adjust: 88%; src: url(../assets/fonts/bodoni-moda-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Bodoni Moda'; font-weight: 500; font-display: swap; size-adjust: 88%; src: url(../assets/fonts/bodoni-moda-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Bodoni Moda'; font-weight: 600; font-display: swap; size-adjust: 88%; src: url(../assets/fonts/bodoni-moda-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Bodoni Moda'; font-weight: 300 400; font-style: italic; font-display: swap; size-adjust: 88%; src: url(../assets/fonts/bodoni-moda-latin-400-italic.woff2) format('woff2'); }
@font-face { font-family: 'Bodoni Moda'; font-weight: 500 600; font-style: italic; font-display: swap; size-adjust: 88%; src: url(../assets/fonts/bodoni-moda-latin-500-italic.woff2) format('woff2'); }

@font-face { font-family: 'TeX Gyre Heros'; font-weight: 300 400; font-display: swap; src: url(../assets/fonts/tex-gyre-heros-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'TeX Gyre Heros'; font-weight: 500 900; font-display: swap; src: url(../assets/fonts/tex-gyre-heros-700-normal.woff2) format('woff2'); }
/* The same bold at every weight, for headlines: the pairing asks for Helvetica Bold */
@font-face { font-family: 'Heros Bold'; font-weight: 100 900; font-display: swap; size-adjust: 84%; src: url(../assets/fonts/tex-gyre-heros-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-weight: 300 400; font-display: swap; size-adjust: 114%; src: url(../assets/fonts/eb-garamond-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-weight: 500 700; font-display: swap; size-adjust: 114%; src: url(../assets/fonts/eb-garamond-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-weight: 300 700; font-style: italic; font-display: swap; size-adjust: 114%; src: url(../assets/fonts/eb-garamond-latin-400-italic.woff2) format('woff2'); }
@font-face { font-family: 'TeX Gyre Bonum'; font-weight: 300 700; font-style: italic; font-display: swap; src: url(../assets/fonts/tex-gyre-bonum-400-italic.woff2) format('woff2'); }

/* The editor keeps the site's own fonts whichever pairing is on trial */
:root[data-type="c"] body:not(.is-editor) {
  --serif: 'Heros Bold', Arial, sans-serif;
  --mast: 'TeX Gyre Bonum', 'Bookman Old Style', Georgia, serif;
  --sans: 'TeX Gyre Heros', Arial, sans-serif;
  --read: 'EB Garamond', Garamond, Georgia, serif;
  font-family: var(--read);
}
:root[data-type="a"] body:not(.is-editor) {
  --serif: Tangerine, Cormorant, Georgia, serif;
  --mast: Tangerine, 'Playfair Display', Georgia, serif;
  --sans: 'Libra Sans', 'Liberation Sans', Arial, sans-serif;
  --read: var(--sans);
  font-family: var(--sans);
}
:root[data-type="b"] body:not(.is-editor) {
  --serif: 'Bodoni Moda', 'Bodoni 72', 'Bodoni MT', Didot, Georgia, serif;
  --mast: var(--serif);
  --sans: Jost, 'Century Gothic', 'Segoe UI', sans-serif;
  --read: var(--serif);
  font-family: var(--sans);
}

/* Tangerine is a script: capitals-only and slanted settings do not suit it, and its swashes need room */
[data-type="a"] body:not(.is-editor) :is(.caps-head, .caps-title, .divider, .frames__head h2, .banner__word) { text-transform: none; letter-spacing: 0; margin-right: 0; }
[data-type="a"] body:not(.is-editor) :is(.masthead__logo, .pullquote) { font-style: normal !important; letter-spacing: 0; }
[data-type="a"] body:not(.is-editor) .w { padding: .3em .16em .3em; margin: -.3em -.16em -.3em; }
[data-type="a"] body:not(.is-editor) .who__body p { font-size: clamp(17px, 1.6vw, 21px); line-height: 1.75; }
[data-type="a"] body:not(.is-editor) .tripintro { font-size: clamp(15px, 1.3vw, 17px); line-height: 1.75; }
[data-type="a"] body:not(.is-editor) .dropcap::first-letter { font-size: 64px; line-height: 1; padding-top: 0; }
[data-type="b"] body:not(.is-editor) .dropcap::first-letter { line-height: .9; }

/* Bold Helvetica headlines sit tight; wide tracking is kept for the small labels only */
[data-type="c"] body:not(.is-editor) :is(.display, .hero__intro h1, .destyear__places span) { letter-spacing: -.02em; }
[data-type="c"] body:not(.is-editor) :is(.caps-head, .caps-title, .divider, .frames__head h2) { letter-spacing: 0; }
[data-type="c"] body:not(.is-editor) .banner__word { letter-spacing: .08em; margin-right: -.08em; }
[data-type="c"] body:not(.is-editor) .pullquote { font-family: var(--read) !important; }
[data-type="c"] body:not(.is-editor) .mainnav { font-family: var(--sans); }
/* The title in the manner of the magazine masthead: a large initial with small capitals after it */
[data-type="c"] body:not(.is-editor) .masthead__logo { letter-spacing: 0; }
[data-type="c"] body:not(.is-editor) .logo__rest { font-size: .74em; letter-spacing: .03em; text-transform: uppercase; }

/* The switcher itself always uses the same font, so it does not jump as pairings change */
.typeswitch { position: fixed; z-index: 40; left: 16px; bottom: 16px; display: flex; align-items: center; gap: 2px; padding: 4px; background: rgba(255, 255, 255, .95); border: 1px solid var(--hair); border-radius: 999px; box-shadow: 0 4px 18px rgba(29, 29, 27, .1); font: 500 11.5px/1 Jost, 'Century Gothic', 'Segoe UI', sans-serif; color: var(--ink); }
.typeswitch__label { padding: 0 8px 0 10px; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.typeswitch button { padding: 8px 12px; border-radius: 999px; font: inherit; white-space: nowrap; transition: background .2s, color .2s; }
.typeswitch button:hover { background: var(--stone); }
.typeswitch button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
body.is-editor .typeswitch { display: none; }

@media (max-width: 560px) {
  .typeswitch { left: 50%; translate: -50% 0; }
  .typeswitch button span { display: none; }
}
