/* ==========================================================================
   Typography — EB Garamond
   Replaces Grotley (display), Inter (body) and Montserrat (nav) with a single
   classical serif, matching the 437 reference: wide-tracked caps for headings,
   sentence case at a comfortable measure for body.

   EB Garamond stands in for Dominicale, which is a commercial licence we
   can't ship. It is SIL Open Font Licensed, free for commercial use.

   IMPORTANT — why there is no `*` selector here:
   this Divi build has 110 distinct selectors that set an icon font
   (ETmodules, FontAwesome, feathericons, swiper-icons, dashicons). Many are
   plain elements, not pseudo-elements, so a blanket override would turn every
   icon into a stray letter. Everything below is a POSITIVE list of
   text-bearing elements; icon elements are never matched.
   ========================================================================== */

:root {
  /* ACTIVE SERIF. To go back to EB Garamond, swap these two lines - both
     families are loaded on every page, so nothing else needs touching. */
  --yp-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino,
              "Hoefler Text", Georgia, "Times New Roman", serif;
  /* --yp-serif: "EB Garamond", "Adobe Garamond Pro", Garamond, Georgia, serif; */

  /* Newsreader is variable (200-800). Display weights sit above 400 so the
     caps hold the same colour as Dominicale's single sturdy weight. */
  --yp-w-display: 560;
  --yp-w-section: 540;
  --yp-w-sub: 500;
  --yp-track-display: 0.14em;   /* h1/h2 caps */
  --yp-track-sub: 0.09em;       /* h3-h6 caps */
  --yp-track-nav: 0.18em;       /* nav, matches the "BACK IN STOCK" label */
}

/* ---- base ---------------------------------------------------------------- */

body,
.et_pb_module,
.et_pb_text,
.et_pb_text_inner,
p, li, dt, dd, td, th, caption, figcaption, blockquote, address,
label, legend,
input, select, textarea, button,
.et_pb_slide_description,
.et_pb_blurb_description,
.et_pb_toggle_content,
.et_pb_tab,
.entry-content,
#main-content,
#footer,
.et_pb_button {
  font-family: var(--yp-serif) !important;
}

body, p, li, dd, td, .et_pb_text, .et_pb_text_inner, .entry-content {
  letter-spacing: 0.005em;
  line-height: 1.62;
}

/* ---- headings ------------------------------------------------------------ */
/* The reference sets every heading in caps with generous tracking. Display
   sizes get the widest track; sub-heads step down so they stay readable. */

h1, h2, h3, h4, h5, h6,
.et_pb_module h1, .et_pb_module h2, .et_pb_module h3,
.et_pb_module h4, .et_pb_module h5, .et_pb_module h6,
.et_pb_slide_description .et_pb_slide_title,
h1.entry-title, .et_pb_post_title .entry-title,
.et_pb_blurb_container h4, .et_pb_toggle_title,
.et_pb_accordion .et_pb_toggle_title {
  font-family: var(--yp-serif) !important;
  font-weight: var(--yp-w-sub) !important;
  text-transform: uppercase;
  font-style: normal !important;
}

h1, .et_pb_slide_description .et_pb_slide_title, h1.entry-title {
  letter-spacing: var(--yp-track-display);
  line-height: 1.14;
  word-spacing: 0.08em;
  font-weight: var(--yp-w-display) !important;
  /* trailing letter-space would otherwise push centred caps left of centre */
  margin-right: calc(-1 * var(--yp-track-display));
  max-width: 100%;
}

h2 {
  letter-spacing: var(--yp-track-display);
  line-height: 1.2;
  font-weight: var(--yp-w-section) !important;
  margin-right: calc(-1 * var(--yp-track-display));
  max-width: 100%;
}
h3 { letter-spacing: var(--yp-track-sub);     line-height: 1.28; }
h4, h5, h6 { letter-spacing: var(--yp-track-sub); line-height: 1.34; }

/* Caps in a serif read larger than lowercase at the same size, so pull the
   big display sizes back a little to keep the original page rhythm. */
h1, .et_pb_slide_description .et_pb_slide_title { font-size: 0.92em; }
h2 { font-size: 0.94em; }

/* ---- buttons and small caps labels --------------------------------------- */

.et_pb_button,
.et_pb_contact_submit,
input[type="submit"],
button[type="submit"] {
  font-family: var(--yp-serif) !important;
  text-transform: uppercase;
  letter-spacing: var(--yp-track-nav);
  font-weight: 400 !important;
}

/* ---- header nav ---------------------------------------------------------- */
/* The centred header (header.css) was built on Montserrat; move it onto the
   serif so the whole page speaks one voice. */

/* Deliberately SANS, and deliberately not var(--yp-serif):
   (a) 437's own nav is Euclid, a sans - a serif nav is less faithful to the
       reference, not more;
   (b) header.css stacks two copies of every glyph in a fixed 1.15em
       overflow-hidden box tuned to Montserrat's metrics, and a serif's taller
       ascenders show a sliver of the second glyph;
   (c) at 12px with wide tracking, serifs fight the tracking and legibility drops. */
#main-header .st-nav-link,
#main-header .st-dropdown a {
  font-family: "Montserrat", "Inter", "Helvetica Neue", Arial, sans-serif !important;
}

/* Nav set larger. The letter-swap boxes are height-relative (1.15em), so they
   scale with this automatically - no clipping introduced.

   These used to be a fixed 19px with two breakpoint steps under it, and that
   was what actually forced the nav onto a second line: header.css was sizing
   the row for 12px while this file rendered it at 19px. Size now comes from
   the fluid tokens header.css declares, so one file owns the scale and the row
   cannot be measured against a width it is not drawn at. */
#main-header .st-nav-link { font-size: var(--st-nav-fs); letter-spacing: var(--st-nav-track); }
#main-header .st-dropdown a { font-size: clamp(12px, 0.5vw + 8.8px, 15px); letter-spacing: 0.12em; }

/* ---- restore anything that must NOT become a serif ------------------------ */
/* Belt and braces: any element whose class names it an icon keeps whatever
   font its own rule gave it, even if a selector above happened to reach it. */

[class*="icon"]:not(.et_pb_text):not(p),
[class*="Icon"],
.et-pb-icon, .et_pb_font_icon,
.dsm-icon, .divi8-icon,
.swiper-button-next, .swiper-button-prev {
  font-family: inherit;
}
