/* =============================================================
   /zh/ — Simplified Chinese overrides
   Loaded only by /zh/ pages, after global.zh.css and pages.css.
   global.zh.css is generated by build.js from global.css with the
   Google Fonts @import removed (fonts.googleapis.com is often
   blocked in mainland China and the @import holds up rendering).

   - Baloo 2 and JetBrains Mono are self-hosted, Latin only.
   - Chinese text uses the visitor's system fonts: no CJK web font.
   - Every rule is scoped with html:lang(zh) so it also beats
     same-selector rules that load later (e.g. the inlined
     wa-banner.css).
   ============================================================= */

/* Latin-only subsets. Curly quotes (U+2018–201F), the em dash
   (U+2014) and the ellipsis (U+2026) are left out of the range so
   Chinese “”、—— and … render full-width from the CJK font. */
@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/baloo-2-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-2013, U+2015-2017, U+2020-2025, U+2027-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-2013, U+2015-2017, U+2020-2025, U+2027-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* System CJK stack: macOS/iOS, Windows, Android/Linux, then Latin fallbacks. */
:root {
  --zh-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "Noto Sans SC", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif;
}

/* ----- Font stacks ------------------------------------------ */
html:lang(zh) body {
  font-family: var(--zh-sans);
  line-height: 1.8;
  line-break: strict;
}

/* Display / heading font: Baloo 2 for Latin and digits, CJK from the system. */
html:lang(zh) h1, html:lang(zh) h2, html:lang(zh) h3,
html:lang(zh) h4, html:lang(zh) h5, html:lang(zh) h6,
html:lang(zh) .display, html:lang(zh) .section-head h2, html:lang(zh) .variant h3,
html:lang(zh) .industry h3, html:lang(zh) .why-cell h3, html:lang(zh) .bottom-cta h2,
html:lang(zh) .brand-name, html:lang(zh) .header-cta,
html:lang(zh) footer.site h4,
html:lang(zh) .qform .qf-title, html:lang(zh) .qf-submit, html:lang(zh) .footer-quote-btn,
html:lang(zh) .stat-cell .stat-num, html:lang(zh) .cert-body h4, html:lang(zh) .process-num,
html:lang(zh) .wa-btn {
  font-family: "Baloo 2", var(--zh-sans);
}

/* UI labels that use Arial in English */
html:lang(zh) .lang-switch button, html:lang(zh) .nav-btn, html:lang(zh) .nav-cta,
html:lang(zh) .dd-col-head, html:lang(zh) .dd-help .h, html:lang(zh) .dd-footer-btn,
html:lang(zh) .dd-simple-head, html:lang(zh) .m-nav-btn, html:lang(zh) .m-sub-col-head,
html:lang(zh) .drawer-cta, html:lang(zh) .formats-table th {
  font-family: "Helvetica Neue", Arial, var(--zh-sans);
}

/* Mono labels: JetBrains Mono for codes, CJK from the system. */
html:lang(zh) .mono, html:lang(zh) .sv-pill, html:lang(zh) .future-pill,
html:lang(zh) .quote-art-caption, html:lang(zh) .placeholder-label,
html:lang(zh) .hero-art .corner, html:lang(zh) .specchip .meta, html:lang(zh) .variant .num,
html:lang(zh) .specs-art .ref, html:lang(zh) .spec-list .v .pill, html:lang(zh) .finish .num,
html:lang(zh) .industry .tag, html:lang(zh) .why-cell .meta, html:lang(zh) .stat-cell .stat-src,
html:lang(zh) .cert-mark, html:lang(zh) .cert-body .cert-meta, html:lang(zh) .solution-card .sc-tag {
  font-family: "JetBrains Mono", ui-monospace, var(--zh-sans), monospace;
}

/* ----- CJK typography --------------------------------------- */
/* Tracking is for Latin caps; it breaks up Chinese text. */
html:lang(zh) * { letter-spacing: 0 !important; }

/* Body copy at ~1.8 */
html:lang(zh) p, html:lang(zh) li, html:lang(zh) .lede, html:lang(zh) .desc,
html:lang(zh) .sc-desc, html:lang(zh) .why-cell p, html:lang(zh) .faq-a-inner,
html:lang(zh) .spec-list .v, html:lang(zh) .cert-body p, html:lang(zh) .process-cell p,
html:lang(zh) .dd-help .b, html:lang(zh) .footer-desc {
  line-height: 1.8;
}

/* English display lines run at 1.0–1.1; CJK glyphs fill the em box and need room. */
html:lang(zh) h1, html:lang(zh) h2, html:lang(zh) h3, html:lang(zh) .display {
  line-height: 1.35;
}

/* Chinese headings capped at 700 (system CJK fonts have no 800; browsers fake it). */
html:lang(zh) .stat-cell .stat-num, html:lang(zh) .process-num { font-weight: 700; }

/* No italics in Chinese. */
html:lang(zh) em, html:lang(zh) i { font-style: normal; }
