/*
 * Locally bundled editorial faces.
 * Source Serif 4 and Manrope remain the Latin editorial/UI faces.
 * Locale-specific Noto Serif variable fonts are bundled under SIL OFL 1.1.
 */
/* A locale-only alias also loads the approved Latin face on standalone pages.
   Those pages do not load base.css, where SourceSerif is declared. */
@font-face { font-family: "OM Editorial Latin"; src: url('/fonts/SourceSerif4-Variable.subset.woff2') format('woff2'); font-weight:200 900; font-display:swap; }
@font-face {
  font-family: "OM Noto Serif KR";
  src: url("/fonts/NotoSerifKR-Variable.subset.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* Start-screen headline/menu face — sans-serif, chosen for on-screen legibility
   (low stroke contrast, heavier weight) per the mobile-readability review. OFL. */
@font-face { font-family: "OM Plex Sans KR"; src: url("/fonts/IBMPlexSansKR-400.subset.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "OM Plex Sans KR"; src: url("/fonts/IBMPlexSansKR-500.subset.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "OM Plex Sans KR"; src: url("/fonts/IBMPlexSansKR-600.subset.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "OM Plex Sans KR"; src: url("/fonts/IBMPlexSansKR-700.subset.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* Locale-specific aliases keep script routing explicit and auditable. */
@font-face {
  font-family: "OM Noto Serif JP";
  src: url("/fonts/NotoSerifCJKjp-VF.subset.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "OM Noto Serif SC";
  src: url("/fonts/NotoSerifCJKsc-VF.subset.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "OM Noto Serif TC";
  src: url("/fonts/NotoSerifCJKtc-VF.subset.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "OM Noto Serif Thai";
  src: url("/fonts/NotoSerifThai-Variable.subset.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "OM Noto Serif Devanagari";
  src: url("/fonts/NotoSerifDevanagari-Variable.subset.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:where(.reader-ko) { --reader-serif: "OM Noto Serif KR", "Noto Serif KR", serif; }
:where(.reader-ja) { --reader-serif: "OM Noto Serif JP", "Noto Serif CJK JP", "Yu Mincho", serif; }
:where(.reader-zh-cn) { --reader-serif: "OM Noto Serif SC", "Noto Serif CJK SC", "Microsoft YaHei", serif; }
:where(.reader-zh-tw) { --reader-serif: "OM Noto Serif TC", "Noto Serif CJK TC", "Microsoft JhengHei", serif; }
:where(.reader-th) { --reader-serif: "OM Noto Serif Thai", "Noto Serif Thai", "Leelawadee UI", Tahoma, serif; }
:where(.reader-hi) { --reader-serif: "OM Noto Serif Devanagari", "Noto Serif Devanagari", "Nirmala UI", Mangal, serif; }
:where(.reader-en, .reader-es) { --reader-serif: "OM Editorial Latin", SourceSerif, Georgia, serif; }

/* Scripture keeps its source script even in a translated edition. Do not leave
   Chinese passages to an unrelated system sans-serif on Latin/Thai/Hindi devices. */
body:is(.reader-en,.reader-es,.reader-th,.reader-hi) .text .original {
  font-family:var(--reader-serif),"OM Noto Serif TC",serif;
}

.reader-ko :is(.identity h1,.original,.translation p,.prose p),
.reader-ja :is(.identity h1,.original,.translation p,.prose p),
.reader-zh-cn :is(.identity h1,.original,.translation p,.prose p),
.reader-zh-tw :is(.identity h1,.original,.translation p,.prose p),
.reader-th :is(.identity h1,.original,.translation p,.prose p),
.reader-hi :is(.identity h1,.original,.translation p,.prose p),
.reader-en :is(.identity h1,.original,.translation p,.prose p),
.reader-es :is(.identity h1,.original,.translation p,.prose p) {
  font-family: var(--reader-serif);
}

.reader-ko :is(.translation p,.prose p) { line-height: 2; }
.reader-ja :is(.translation p,.prose p),
.reader-zh-cn :is(.translation p,.prose p),
.reader-zh-tw :is(.translation p,.prose p) {
  line-height: 2;
  line-break: strict;
  word-break: normal;
}
.reader-th :is(.identity h1,.translation p,.prose p),
.reader-hi :is(.identity h1,.translation p,.prose p) {
  line-height: 2.05;
  word-break: normal;
  overflow-wrap: break-word;
}
