/*
 * Simplified Chinese (zh) locale overrides.
 * design:sync attaches this sheet to /zh/** pages only, after the design sheets
 * (scripts/extract-pages.mjs localeExtraStylesheets). The design CSS
 * (kookmin_portal_0728/assets/css) stays untouched. Every selector is scoped to html[lang="zh"].
 *
 * Font: exactly the system stack the designer gives the translated zh GNB
 * (11-navigation.css "JA / ZH mega-menu legibility refinement"). No web fonts — every family here
 * is a locally installed system font, so /zh pages make no font requests to external CDNs.
 *
 * Structural rules ported from en.css with the same selectors (proof-card numeral sizing and nudge,
 * proof typing lines, structure-keyed breadcrumb, a:not([href])); typography stays per locale.
 */
html[lang='zh'] body,
html[lang='zh'] :is(button, input, select, textarea) {
  font-family:
    'Noto Sans SC', 'Noto Sans CJK SC', 'Microsoft YaHei', 'PingFang SC', sans-serif !important;
}

/* Design faces served from cdn.jsdelivr.net (00-fonts.css, 49-content-typography.css): the punctuation
   serif (KookminPunctuationMyeongjo/KookminPunctuation) and the InkLipquid handwriting face. Their
   families sit ahead of the stack on these company-about elements, so the browser would fetch them —
   use the same system stack instead (scripts/verify-locale-network.mjs keeps this at zero). The
   professional-service pages (k-solution, settlement-service) get the punctuation serif by selector
   (49-content-typography.css "콤마·따옴표 명조 추가 적용분") — same treatment for those selectors. */
html[lang='zh'] .type-punctuation-serif,
html[lang='zh'] .about-fullscreen__text strong,
html[lang='zh'] .ks-hero__intro h2 strong,
html[lang='zh'] .ks-final-copy strong,
html[lang='zh'] .settlement-accordion__trigger span,
html[lang='zh'] .settlement-cta__content p {
  font-family: 'Noto Sans SC', 'Noto Sans CJK SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

/* CJK line breaking. The design body is `word-break: keep-all` (02-base.css), which never breaks
   between hanzi — Chinese copy has no spaces, so whole sentences would overflow. Inherited by
   every element that does not set its own. */
html[lang='zh'] body {
  word-break: normal;
  line-break: strict;
}

/* The design also sets `word-break: keep-all` on page containers (cards, pills, copy blocks —
   e.g. 14-eb5-overview.css, 15-eb5-law.css, 27-eb1-eb2.css); their div/span/strong children inherit
   it, so a Chinese line cannot break between hanzi and widens the card past a 390px viewport.
   Same CJK line breaking for every element of the page body (the GNB keeps the designer's rules). */
html[lang='zh'] main * {
  word-break: normal !important;
  line-break: strict;
}

/* The designer's ja/zh typesetting for translated menu links (11-navigation.css, same values),
   applied to the body copy elements. */
html[lang='zh'] :is(p, li, h1, h2, h3, h4, a, label, td, th, dt, dd) {
  line-height: 1.38 !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  line-break: strict;
}

/* Home proof cards: "五大银行" does not fit the card width at the design's numeral size and wraps
   into two oversized lines that run into the card label above it — same sizing as en.css. */
html[lang='zh'] .proof-section .proof-card--total > strong {
  font-size: clamp(22px, 2.0833vw, 40px) !important;
  line-height: 1.1 !important;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  html[lang='zh'] .proof-section .proof-card--total > strong {
    font-size: 32px !important;
  }
}

/* The design nudges every card numeral up (translateY, 07-revision-overrides.css) to sit under a
   one-line Korean label; translated labels can take two lines, so the nudge pushes the numeral into
   the label. Let the card's flex layout place it instead (ported from en.css). */
html[lang='zh'] .proof-section .proof-card > strong {
  transform: none !important;
}

/* Typing copy under each proof card (data-lines): translated lines do not fit the card width on
   one line and are clipped — let them wrap instead (as en.css). */
html[lang='zh'] .proof-section .proof-card__typing-line {
  white-space: normal !important;
  overflow: visible !important;
}

/* Breadcrumb standard (46-page-head-unified.css §3). The design selects the breadcrumb by its Korean
   label — nav[aria-label="현재 위치"] — which the translated pages no longer carry, so the hero
   breadcrumb lost these rules. Same declarations keyed on the structure instead (every breadcrumb nav
   has class page-breadcrumb); :where() keeps the design's specificity so the cascade matches ko. */
:where(html[lang='zh']) div.typea-page-head > nav.page-breadcrumb,
:where(html[lang='zh']) .consultation-hero__head > nav.page-breadcrumb,
:where(html[lang='zh']) .eb5-hero__head > nav.page-breadcrumb,
:where(html[lang='zh']) .qualification-hero__head > nav.page-breadcrumb,
:where(html[lang='zh']) .performance-hero > .performance-container > nav.page-breadcrumb,
:where(html[lang='zh']) .eb5-projects-head > nav.page-breadcrumb,
:where(html[lang='zh']) .seminar-detail-hero > .seminar-container > nav.page-breadcrumb,
:where(html[lang='zh']) .seminar-list-hero > .seminar-container > nav.page-breadcrumb,
:where(html[lang='zh']) .customer-cafe-head > nav.page-breadcrumb,
:where(html[lang='zh']) .ks-hero__container > nav.page-breadcrumb,
:where(html[lang='zh']) .settlement-hero__head > nav.page-breadcrumb,
:where(html[lang='zh']) .visa-encyclopedia-hero__head > nav.page-breadcrumb {
  position: static;
  inset: auto;
  order: 1;
  align-self: flex-end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 0;
  color: #1a365d;
  font-family:
    'Pretendard',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-size: clamp(12px, 0.833vw, 16px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: right;
  white-space: normal;
}

:where(html[lang='zh']) div.typea-page-head > nav.page-breadcrumb a,
:where(html[lang='zh']) div.typea-page-head > nav.page-breadcrumb strong,
:where(html[lang='zh']) .consultation-hero__head > nav.page-breadcrumb a,
:where(html[lang='zh']) .consultation-hero__head > nav.page-breadcrumb strong,
:where(html[lang='zh']) .eb5-hero__head > nav.page-breadcrumb a,
:where(html[lang='zh']) .eb5-hero__head > nav.page-breadcrumb strong,
:where(html[lang='zh']) .qualification-hero__head > nav.page-breadcrumb a,
:where(html[lang='zh']) .qualification-hero__head > nav.page-breadcrumb strong,
:where(html[lang='zh']) .performance-hero > .performance-container > nav.page-breadcrumb a,
:where(html[lang='zh']) .performance-hero > .performance-container > nav.page-breadcrumb strong,
:where(html[lang='zh']) .eb5-projects-head > nav.page-breadcrumb a,
:where(html[lang='zh']) .eb5-projects-head > nav.page-breadcrumb strong,
:where(html[lang='zh']) .seminar-detail-hero > .seminar-container > nav.page-breadcrumb a,
:where(html[lang='zh']) .seminar-detail-hero > .seminar-container > nav.page-breadcrumb strong,
:where(html[lang='zh']) .seminar-list-hero > .seminar-container > nav.page-breadcrumb a,
:where(html[lang='zh']) .seminar-list-hero > .seminar-container > nav.page-breadcrumb strong,
:where(html[lang='zh']) .customer-cafe-head > nav.page-breadcrumb a,
:where(html[lang='zh']) .customer-cafe-head > nav.page-breadcrumb strong,
:where(html[lang='zh']) .ks-hero__container > nav.page-breadcrumb a,
:where(html[lang='zh']) .ks-hero__container > nav.page-breadcrumb strong,
:where(html[lang='zh']) .settlement-hero__head > nav.page-breadcrumb a,
:where(html[lang='zh']) .settlement-hero__head > nav.page-breadcrumb strong,
:where(html[lang='zh']) .visa-encyclopedia-hero__head > nav.page-breadcrumb a,
:where(html[lang='zh']) .visa-encyclopedia-hero__head > nav.page-breadcrumb strong {
  color: inherit;
  font: inherit;
  text-decoration: none;
}

@media (max-width: 640px) {
  :where(html[lang='zh']) div.typea-page-head > nav.page-breadcrumb,
  :where(html[lang='zh']) .consultation-hero__head > nav.page-breadcrumb,
  :where(html[lang='zh']) .eb5-hero__head > nav.page-breadcrumb,
  :where(html[lang='zh']) .qualification-hero__head > nav.page-breadcrumb,
  :where(html[lang='zh']) .performance-hero > .performance-container > nav.page-breadcrumb,
  :where(html[lang='zh']) .eb5-projects-head > nav.page-breadcrumb,
  :where(html[lang='zh']) .seminar-detail-hero > .seminar-container > nav.page-breadcrumb,
  :where(html[lang='zh']) .seminar-list-hero > .seminar-container > nav.page-breadcrumb,
  :where(html[lang='zh']) .customer-cafe-head > nav.page-breadcrumb,
  :where(html[lang='zh']) .ks-hero__container > nav.page-breadcrumb,
  :where(html[lang='zh']) .settlement-hero__head > nav.page-breadcrumb,
  :where(html[lang='zh']) .visa-encyclopedia-hero__head > nav.page-breadcrumb {
    font-size: 12px;
  }
}

/* Floating chatbot button label (05-floating.css: content "AI 챗봇") — the zh chatbot trigger
   (src/i18n/messages/zh/chatbot.json). */
html[lang='zh'] .floating-cta__chatbot::after {
  content: 'AI聊天助手';
}

/* Links whose target has no zh page keep their markup but lose href (locale-links.mjs):
   do not advertise them as clickable. */
html[lang='zh'] a:not([href]) {
  cursor: default;
}

/* CEO message sign-off: the design keeps the title line ("국민이주(주) 대표이사") on one line
   (white-space: nowrap) beside the signature image. With the English company name that line is
   wider than the card under 640px and pushes the copy column past the card edge — let it wrap,
   at the space only, so the job title stays whole. */
html[lang='zh'] .ceo-message-page:not(.business-vision-page) .ceo-greeting-card__name {
  white-space: normal;
  word-break: keep-all;
}
