/* ============================================================================
   28-zh.css — the Chinese reader's type
   ----------------------------------------------------------------------------
   Loaded only by zh/index.html, last, so its :root wins over 02-layout.css
   and 27-type.css.

   THE PROBLEM. Every face this site chose is Latin-only. Source Serif 4 carries
   the prose, Bricolage Grotesque carries the furniture, Courier Prime carries
   the code — none has a single Han glyph. Left alone, Chinese text falls
   through to whatever the browser picks, which is a different face on every
   machine and undoes the design.

   NO WEBFONT. A subset of Noto Sans SC that covered this text would still run
   to megabytes against a 300 KB page, and this site makes no network requests
   at runtime. So each token keeps its Latin face at the front of the chain and
   gains a Han fallback that ships with the platform. Latin and digits render in
   the site's own voice; Han resolves to PingFang on Apple, YaHei on Windows.

   SERIF FOR PROSE, SANS FOR FURNITURE. Body copy stays serif in Chinese too —
   Songti/SimSun against Source Serif 4 — so the reading voice survives the
   translation. Headings, labels and UI keep Bricolage's role but resolve Han
   through PingFang/YaHei, which is what a Chinese reader expects of chrome.
   If the serif body reads poorly at these sizes on a given platform, the fix
   is one line: point --serif at the same stack as --sans.

   METRICS. Han is a square, dense glyph with no ascender/descender rhythm to
   carry the eye, so Latin leading is too tight for it. Han also needs no
   tracking — Bricolage's -.03em display tracking jams the squares together.
   Both are corrected below.
   ========================================================================= */

:root{
  /* Han fallbacks appended; the Latin faces stay first in every chain. */
  --han-sans:"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",
             "Source Han Sans SC","Noto Sans SC","WenQuanYi Micro Hei";
  --han-serif:"Songti SC","Source Han Serif SC","Noto Serif SC","SimSun","宋体";

  --sans:'Libre Franklin',system-ui,-apple-system,'Segoe UI',var(--han-sans),sans-serif;
  --serif:'Source Serif 4',Georgia,'Times New Roman',var(--han-serif),serif;
  --disp:'Bricolage Grotesque',system-ui,-apple-system,'Segoe UI',var(--han-sans),sans-serif;
  --mono:'Courier Prime',ui-monospace,Consolas,var(--han-sans),monospace;

  /* Chinese runs ~55% of the English character count, so a line holds far more
     meaning per centimetre. A 66ch measure that is right for English is a long
     way past comfortable here. */
  --measure:42em;
}

/* ---------- leading ---------- */
/* Han has no x-height rhythm to ride, so it wants more air between lines than
   Latin at the same size. */
[lang^="zh"] body,
[lang^="zh"] p,
[lang^="zh"] li,
[lang^="zh"] .lede,
[lang^="zh"] .def,
[lang^="zh"] .dbody{line-height:1.8}

[lang^="zh"] .say,
[lang^="zh"] .brief,
[lang^="zh"] .card p,
[lang^="zh"] .tile span,
[lang^="zh"] .figc,
[lang^="zh"] figcaption{line-height:1.7}

/* ---------- tracking ---------- */
/* Every negative tracking value in 27-type.css was chosen for Latin display
   sizes. On Han it closes the gaps the glyphs need. Zero it across the board;
   positive tracking on small uppercase labels is left alone, because those
   labels are still Latin. */
[lang^="zh"] h1,
[lang^="zh"] h2,
[lang^="zh"] h3,
[lang^="zh"] h4,
[lang^="zh"] .lede,
[lang^="zh"] .stand,
[lang^="zh"] .ptitle,
[lang^="zh"] .chapcard b,
[lang^="zh"] .mrow b,
[lang^="zh"] .endcap b{letter-spacing:0}

/* Han headings carry weight better than width. Bricolage's condensed display
   widths do nothing for a face that is not Bricolage, and the optical-size
   axis is meaningless on the fallback. */
[lang^="zh"] h1,
[lang^="zh"] h2{font-variation-settings:normal;font-weight:700}

/* ---------- line breaking ---------- */
/* Chinese breaks between any two characters, so the Latin hyphenation and
   break rules the page sets are wrong here; `strict` keeps punctuation off the
   start of a line, which is the rule that actually matters. */
[lang^="zh"] p,
[lang^="zh"] li,
[lang^="zh"] .lede,
[lang^="zh"] .say,
[lang^="zh"] .brief{line-break:strict;overflow-wrap:break-word;hyphens:none}

/* ---------- mixed runs ---------- */
/* An English term in parentheses on first use is the house rule, so nearly
   every paragraph mixes scripts. Browsers set Han and Latin tight against each
   other; a hair of space either side of the Latin run stops `图元（Prim）` from
   looking like one word. */
[lang^="zh"] code,
[lang^="zh"] .term{margin-inline:.12em}

/* ---------- chrome that was sized for English ---------- */
/* The masthead plate and the menu rows were measured against English strings.
   Chinese is shorter in characters but wider per character, and these sit in
   fixed-width furniture, so they get a size down rather than a wrap. */
[lang^="zh"] .plate b{font-size:.84rem;letter-spacing:0}
[lang^="zh"] .plate i{font-size:.63rem;letter-spacing:0}
[lang^="zh"] .crumb{font-size:.7rem}
[lang^="zh"] .rail b{letter-spacing:0;line-height:1.45}
