/* ============================================================
   HansMed — CJK type bump (additive, reversible)
   ------------------------------------------------------------
   Chinese text: +10% size and a heavier weight. Loaded LAST on
   every page; remove the <link> to revert.

   Weight buckets (CSS cannot add +100 to a varying base):
     - body / label / header-nav Chinese -> 600
     - heading / display Chinese          -> 700
     - brand wordmark (all)               -> 500 (size left original)
   Size is a relative 1.1em (each context +10%).

   Header nav links / menu items swap Chinese via data-zh (JS), so
   they carry no lang/-zh marker; those are matched under
   html[lang="zh"] so ONLY the Chinese state is weighted (English
   stays at its normal weight). Brand wordmarks are static Chinese
   and are matched directly.
   html/body are excluded so zh-mode does not compound the scale.
   !important is intentional: this is a dedicated type-override layer.
   ============================================================ */

/* ---- General Chinese (excl. brand wordmark): +10% size, weight 600 ----

   THE SIZE BUMP AND THE WEIGHT BUMP ARE SPLIT ON PURPOSE (2026-08-30).

   `font-size: 1.1em` means "10% larger than MY PARENT", never "10% larger than
   my own size" — CSS has no self-relative font unit. That is fine for the
   pattern this file was written for, `<h1>English <span lang="zh">中文</span></h1>`,
   where the span has no size of its own and inherits the heading's. It is wrong
   for any element that DOES carry its own font-size: `!important` threw that
   size away and replaced it with 1.1 x the parent's. Live casualties found by
   measuring both language halves: the blog article title rendered 17.6px
   instead of 80px, six legal-page h1s ~19px instead of 40px, the landing cards
   17.6px instead of 22px (fixed in #338 / #342 / #343), and via the class
   branch below, 望/闻/问 on /about at 17.6px instead of 44px plus the
   organ-clock characters on /wellness-hall at 17.6px instead of 54/64px.
   Nested matches compounded the other way, rendering some text ~2x its
   authored size.

   The size bump therefore lives in a CASCADE LAYER and drops its !important:
   layered declarations lose to unlayered ones no matter how specific, so any
   element with its own font-size keeps it, while elements that merely inherit
   still get the +10%. That is the rule this file always meant.

   DO NOT re-add !important here, and do not move this rule out of the layer —
   either one silently resurrects the bug on every sized element on the site.

   The weight bump stays unlayered and !important: font-weight has no
   parent-relative resolution, so it never had this failure mode. */
[lang="zh"]:not(html):not(body),
.hm5-cn, .card-cn, .card-desc-cn,
.zh, .zh-inline, .bi-zh, .fzh, .fm-zh,
[class*="-zh"]:not(.p-logo-zh),
[class*="-cn"] {
  font-weight: 600 !important;
}

@layer cjk-size {
  [lang="zh"]:not(html):not(body),
  .hm5-cn, .card-cn, .card-desc-cn,
  .zh, .zh-inline, .bi-zh, .fzh, .fm-zh,
  [class*="-zh"]:not(.p-logo-zh),
  [class*="-cn"] {
    font-size: 1.1em;
  }
}

/* ---- Heading / display Chinese: weight 700 ---- */
.hm5-title [lang="zh"],
.page-title [lang="zh"],
h1 [lang="zh"], h2 [lang="zh"], h3 [lang="zh"],
.card-name [lang="zh"],
.v3-hero-zh, .hero-zh, .art-zh-title,
.sh-zh, .qt-zh, .stat-zh {
  font-weight: 700 !important;
}

/* ---- Header nav (data-zh JS swap): match body weight, 中文 mode only ---- */
html[lang="zh"] .nav .nav-link,
html[lang="zh"] .nav .nav-book,
html[lang="zh"] .nav .btn-signin,
html[lang="zh"] .m-menu a,
html[lang="zh"] .m-book {
  font-weight: 600 !important;
}

/* ---- Brand wordmark: ORIGINAL size (reverted); weight 500 (desktop + mobile) ---- */
.nav-wordmark-sub, .nav-brand-text, .p-logo-zh, .m-brand-sub {
  font-weight: 500 !important;
}
