/* Locale typography — zh (ported 2026-08-20 from the perma.asia fork's
   calibrated rules; see its assets/locale-typography.css for the full
   measurement history. Only the zh set is ported: TP's Thai pages shipped on
   the theme's own metrics and changing them now would be a visible change
   outside this deployment's scope.)

   Loaded on every non-EN front-end request; every rule is scoped to
   html[lang|="zh"], so on /th/ the file is inert. */

/* An ideograph fills the whole em box and packs 8-20 strokes into it, so at
   the same nominal size it reads smaller and denser than Latin — CJK is
   conventionally set 4-6% larger for the same apparent size. 1.05em is the
   bottom of that range; em (not rem) so pre-sized components keep their own
   proportion; p and li only — buttons, labels, headings are sized to their
   boxes and must not grow. */
:where(html[lang|="zh"]) p,
:where(html[lang|="zh"]) li {
  font-size: 1.05em;
}

html[lang|="zh"] h1,
html[lang|="zh"] h2,
html[lang|="zh"] h3,
html[lang|="zh"] h4,
html[lang|="zh"] h5,
html[lang|="zh"] h6 {
  /* Corpus max line-height ratio measured at 1.135 for zh; 1.15 with margin.
     Ideographs sit on a fixed em square: any tracking — especially a theme's
     negative tracking — reads as a spacing error rather than style. */
  line-height: 1.15;
  letter-spacing: 0;
}

html[lang|="zh"] body {
  line-height: 1.75;
}

html[lang|="zh"] blockquote {
  line-height: 1.5;
}

/* Kinsoku: a line may not start with closing punctuation or end with opening
   punctuation. text-spacing-trim is a harmless forward-compatible
   declaration (browsers already trim adjacent full-width punctuation by
   default — measured; do not "upgrade" it to trim-start). */
html[lang|="zh"] {
  line-break: strict;
  text-spacing-trim: trim-auto;
}
