/* ============================================================
   ARDIAN LAW — 中文排版层 / 中文排版層
   Loaded on /zh/ and /zh-hant/ pages. The typography is shared by both; only
   the font stacks differ, keyed off the lang attribute. Everything else is
   inherited from
   ardian.css: the same tokens, components, spacing and colours.
   This file changes only what Latin typography gets wrong for CJK.
   ============================================================ */

/* Chinese webfonts are NOT loaded from Google Fonts.
   fonts.googleapis.com is blocked in mainland China, which is precisely the
   audience these pages exist for, and a blocked @import holds up a
   render-blocking stylesheet until the connection times out. A full CJK
   webfont is also several megabytes.

   So Chinese text uses the reader's own system face, which is what Chinese
   sites generally do and renders instantly: PingFang SC on Apple, Microsoft
   YaHei on Windows, HarmonyOS Sans or Noto on Android. The Noto names are
   kept first in case the reader has them installed locally.

   The brand Latin faces are listed FIRST in each stack. Font matching runs
   per character, so "Ardian Law" and any Latin text keep the self-hosted
   brand typography while Chinese characters fall through to the system
   face. */

:root{
  --font-display:"Newsreader","Noto Serif SC","Source Han Serif SC","Songti SC","STSong","SimSun",serif;
  --font-text:"Instrument Sans","Noto Sans SC","PingFang SC","HarmonyOS Sans SC","Source Han Sans SC","Hiragino Sans GB","Microsoft YaHei","Heiti SC",sans-serif;
  /* A comfortable CJK line is 35–40 characters, not 68 Latin ones. */
  --measure:37em;
}

/* Traditional pages need Traditional faces, not merely the same characters in
   a Simplified font. The regional glyph standards differ on shared characters
   (戶 against 户, 說 against 説, the grass radical, stroke direction in 骨),
   so a Simplified face renders Traditional text in Mainland letterforms, which
   reads as wrong to a Taiwanese or Hong Kong reader even though every
   character is correct. TC names come first, then HK, then the generic
   fallbacks. This matches on the lang attribute the build writes. */
:root:lang(zh-Hant){
  --font-display:"Newsreader","Noto Serif TC","Source Han Serif TC","Source Han Serif HC","Songti TC","PMingLiU","MingLiU",serif;
  --font-text:"Instrument Sans","Noto Sans TC","PingFang TC","PingFang HK","Source Han Sans TC","HarmonyOS Sans TC","Microsoft JhengHei","Heiti TC",sans-serif;
}

/* CJK has no ascender/descender rhythm to tighten, and negative tracking
   closes the counters. Reset the Latin tracking everywhere. */
.display,.h1,.h2,.h3,.h4,.statement,.wordmark,.lead,.body,.body-sm{letter-spacing:0}

/* Denser glyphs read larger, so the display sizes come down; CJK also needs
   more leading than Latin at the same size. */
.display{font-size:clamp(2rem,1.3rem + 2.9vw,3.5rem);line-height:1.32;font-weight:400}
.h1{font-size:clamp(1.75rem,1.25rem + 2.1vw,2.75rem);line-height:1.38;font-weight:400}
.h2{font-size:clamp(1.5rem,1.15rem + 1.5vw,2.125rem);line-height:1.42;font-weight:400}
.h3{font-size:clamp(1.1875rem,1.05rem + 0.6vw,1.5rem);line-height:1.5;font-weight:500}
.h4{font-size:clamp(1rem,0.96rem + 0.2vw,1.0625rem);line-height:1.6;font-weight:500}
.statement{font-size:clamp(1.5rem,1.05rem + 1.9vw,2.5rem);line-height:1.5;font-weight:300;max-width:18em}

/* Body copy: CJK wants looser leading and no hyphen-driven wrapping. */
.lead{font-size:clamp(1.0625rem,1rem + 0.3vw,1.1875rem);line-height:1.85;max-width:28em}
.body{font-size:1rem;line-height:1.95}
.body-sm{font-size:.9375rem;line-height:1.9}
.article-body{font-size:1rem;line-height:1.95}
p,li{text-wrap:normal;line-break:strict;overflow-wrap:break-word}
.display,.h1,.h2,.h3,.statement{text-wrap:normal}

/* Uppercasing does nothing to CJK and the wide Latin tracking looks loose. */
.eyebrow,.index,.fact dt,.label,.field>label,.article-card__meta{
  text-transform:none;letter-spacing:.06em;font-weight:500;
}
.eyebrow{font-size:.75rem}
.article-card__meta{font-size:.75rem}

/* Latin runs inside Chinese text (names, hex, acronyms) keep the Latin face. */
.lat{font-family:"Instrument Sans","Helvetica Neue",Arial,sans-serif;letter-spacing:.01em}
.wordmark{font-family:"Instrument Sans","Helvetica Neue",Arial,sans-serif;letter-spacing:.2em}

/* The mobile menu's big serif items need the CJK leading too. */
.mobile-menu a{font-size:1.375rem;line-height:1.5;letter-spacing:0}

/* Language switch sits beside the nav, quiet by default. */
.lang-switch{
  font-size:.8125rem;letter-spacing:.04em;color:var(--text-quiet);
  padding:.4rem .6rem;border:1px solid var(--line);border-radius:1px;
  transition:color .25s var(--ease),border-color .25s var(--ease);
  white-space:nowrap;
}
.lang-switch:hover{color:var(--text-strong);border-color:var(--text-strong)}
.site-footer .lang-switch{color:var(--on-dark-quiet);border-color:var(--line-dark)}
.site-footer .lang-switch:hover{color:var(--on-dark);border-color:var(--on-dark)}

/* This file loads after ardian.css, so the single-class rules above would win
   on equal specificity and put the padding back on the three-language group.
   Restate the group here, after them. */
.lang-switch--group{padding:0;display:inline-flex;align-items:stretch}
.lang-switch--group:hover{color:var(--text-quiet);border-color:var(--line)}
.site-footer .lang-switch--group:hover{color:var(--on-dark-quiet);border-color:var(--line-dark)}
.lang-switch--group a{display:block;padding:.4rem .6rem;color:inherit;font-size:inherit}
.nav .lang-switch--group a{font-size:.8125rem;padding:.4rem .6rem}
.lang-switch--group a::after{display:none}
.lang-switch--group a + a{border-left:1px solid var(--line)}
.lang-switch--group a:hover{color:var(--text-strong)}
/* A CJK label carries far more ink than a Latin one at the same size, weight
   and colour, so "English" beside 简体 reads noticeably lighter. Nudging the
   Latin label up one step evens the pair optically. */
.lang-switch--group a[lang="en"]{font-weight:500}
.site-footer .lang-switch--group a + a{border-left-color:var(--line-dark)}
.site-footer .lang-switch--group a:hover{color:var(--on-dark)}
