/* Shared across the app, static readers, and print tools. Only the family
   changes here; component sizes, line heights, weights, and layouts survive.
   Reading regions switch the inherited face for their entire subtree, so
   nested emphasis, links, and paragraph spans retain the text's reading font. */
@font-face {
  font-family: 'Torah Folio Display';
  src: url('/brand/fonts/TorahFolio-Display.woff2?v=2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root {
  --font-ui: 'Torah Folio Display', 'Frank Ruhl Libre', Georgia, serif;
  --font-translation: Georgia, 'Times New Roman', serif;
  --font-hebrew: 'Frank Ruhl Libre', 'Times New Roman', serif;
  --font-rashi: 'Noto Rashi Hebrew', 'Frank Ruhl Libre', serif;
}
/* Existing components use font shorthands. This family-only policy prevents
   those shorthands from silently restoring a different interface font. */
body, body :where(*) {
  font-family: var(--torah-text-face, var(--font-ui)) !important;
}
body { font-kerning: normal; }

/* English translations, including inherited child markup and print output. */
:where(.interlinear-english, .english-text, .word .en, .fluent,
       .rashi-english, .print-passage .english, .motto-en,
       .study-source-excerpt, blockquote) {
  --torah-text-face: var(--font-translation);
}

/* The display face contains Latin letters. Preserve source Hebrew and labels. */
:where(:lang(he), .interlinear-hebrew, .hebrew-text, .word .he, .hebrew,
       .tanakh-original, .fi-hebrew-name, .fi-detail-hebrew,
       .fi-passage-hebrew, .cx-hebrew, .cx-era-hebrew,
       .reader-title > span, .folio-title h1, .library-book-title > span,
       .library-collection-heading > span, .study-figure-heading p,
       .motto-he, .reader-brand-hebrew) {
  --torah-text-face: var(--font-hebrew);
}

/* Rashi follows the generic Hebrew rule so its distinct script wins. */
:where(.rashi-hebrew, .rashi-hebrew *, .rashi-opening, .rashi-opening *) {
  --torah-text-face: var(--font-rashi);
}

/* The Latin brand keeps its custom lettering even inside a Hebrew interface.
   :lang(he) matches descendants too, so pin every wordmark span explicitly. */
body .torah-logo, body .torah-logo *, body .about-page > h1 {
  --torah-text-face: 'Torah Folio Display', Georgia, serif;
}
body .torah-logo, body .torah-logo-wordmark, body .about-page > h1 {
  direction: ltr;
  unicode-bidi: isolate;
}

/* Frank Ruhl Libre lacks cantillation glyphs, so accented letter clusters
   fall back to a differently proportioned face. Keep Chumash source text in
   one complete Biblical Hebrew font, at the existing reader-selected size. */
@font-face {
  font-family: 'Noto Serif Hebrew';
  src: url('/brand/fonts/NotoSerifHebrew.woff2?v=1') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
body.bible-reader:not([data-corpus-label]) .chumash-source,
.weekly-aliyah .chumash-source {
  --font-hebrew: 'Noto Serif Hebrew', 'Times New Roman', serif;
}
