/*
 * Change 120 MR 1 — self-hosted font @font-face declarations.
 *
 * Every named family in themes.css must appear here so the browser
 * doesn't hit Google / Adobe Fonts at runtime. In this MR we declare
 * the families with `src: local(...)` fallbacks; the physical .woff2
 * files land in `static/fonts/<family>/` in a follow-on MR that
 * touches the CI asset pipeline. Until then browsers pick up the
 * system-installed version if available, and drop through the theme
 * fallback chain otherwise.
 *
 * `font-display: swap` prevents FOIT (invisible text) on slow first
 * paints — the fallback renders immediately and swaps when the
 * custom font arrives.
 */

/* Fraunces — Evolve Aurora + Prism + Riso Botanic display */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: local("Fraunces");
}

/* IBM Plex Sans — Evolve text */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: local("IBM Plex Sans");
}

/* Public Sans — Cloudera Signal/Deep text + fallback */
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: local("Public Sans");
}

/* Manrope — Cloudera Signal/Deep display */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: local("Manrope");
}

/* Plus Jakarta Sans — Cloudera EVOLVE26 themes (display + text).
 * The Evolve 26 site uses this family throughout. Self-hosted via
 * local() like the others; the .woff2 files land under
 * static/fonts/plus-jakarta-sans/ in the asset-pipeline MR. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: local("Plus Jakarta Sans");
}

/* JetBrains Mono — Terminal Amber */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: local("JetBrains Mono");
}

/* IBM Plex Mono — Terminal Amber fallback */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: local("IBM Plex Mono");
}

/* Old Standard TT — Riso Botanic display */
@font-face {
  font-family: "Old Standard TT";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: local("Old Standard TT");
}

/*
 * Change 128 — script-coverage faces for the CJK + Arabic locales.
 *
 * The Latin UI faces above cover en/de/es/fr/it/pt-br/id. Simplified
 * Chinese (zh-hans), Japanese (ja), Korean (ko), and Arabic (ar) need a
 * face whose glyph set covers their script, or the browser falls back to
 * whatever system CJK/Arabic font exists (inconsistent, sometimes absent).
 *
 * We use the Noto families (Google's pan-script set, SIL OFL) — the de-facto
 * choice for self-hosted CJK/Arabic. Each face has `local()` first (zero download
 * if the OS ships it, e.g. PingFang/YaHei/Meiryo/Malgun) then a self-hosted subset
 * `.woff2` under static/fonts/<family>/, so non-Latin text renders consistently
 * even on a device with no CJK/Arabic font installed.
 *
 * The .woff2 are SUBSET to only the glyphs our compiled .mo catalogs actually
 * ship (CJK faces are otherwise ~10-20 MB), keeping each under ~700 KB. They are
 * regenerated by scripts/fonts/build_cjk_fonts.py — re-run it after a
 * makemessages/compilemessages pass that adds new non-Latin strings, and commit
 * the updated binaries. See scripts/fonts/README.md. License: static/fonts/OFL.txt.
 */

/* Noto Sans SC — Simplified Chinese (zh-hans). local() first (zero download if
 * the OS has it), else our self-hosted subset .woff2 (built by
 * scripts/fonts/build_cjk_fonts.py — only the glyphs our catalogs ship). */
@font-face {
  font-family: "Noto Sans SC";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: local("Noto Sans SC"), local("Noto Sans CJK SC"),
       url("../fonts/noto-sans-sc/NotoSansSC-subset.1fc655f48fa0.woff2") format("woff2");
}

/* Noto Sans JP — Japanese (ja) */
@font-face {
  font-family: "Noto Sans JP";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: local("Noto Sans JP"), local("Noto Sans CJK JP"),
       url("../fonts/noto-sans-jp/NotoSansJP-subset.5345a90db122.woff2") format("woff2");
}

/* Noto Sans KR — Korean (ko) */
@font-face {
  font-family: "Noto Sans KR";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: local("Noto Sans KR"), local("Noto Sans CJK KR"),
       url("../fonts/noto-sans-kr/NotoSansKR-subset.aad2d99bc787.woff2") format("woff2");
}

/* Noto Sans Arabic — Arabic (ar, RTL) */
@font-face {
  font-family: "Noto Sans Arabic";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: local("Noto Sans Arabic"),
       url("../fonts/noto-sans-arabic/NotoSansArabic-subset.a1157a5fb832.woff2") format("woff2");
}
