/*
 * Japanese (ja) locale overrides.
 * design:sync attaches this sheet to /ja/** 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="ja"].
 *
 * Font: none on purpose. The designer's translated GNB gives zh a system font stack but ja no
 * font-family at all (11-navigation.css "JA / ZH mega-menu legibility refinement") — Pretendard
 * has no kana/kanji, so the browser falls back to the system Japanese font. No web fonts here.
 *
 * 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.
 */

/* CJK line breaking. The design body is `word-break: keep-all` (02-base.css), which never breaks
   between kana/kanji — Japanese copy has no spaces, so whole sentences would overflow. Inherited
   by every element that does not set its own. */
html[lang='ja'] 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 Japanese line cannot break between kana/kanji 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='ja'] 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='ja'] :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;
}

/* Company-about closing line (09-sub-pages.css .about-fullscreen__text strong) is set in the Korean
   handwriting face InkLipquid, which maps many kanji/kana to blank glyphs — the Japanese sentence
   renders with gaps. Not a new font: inherit the page's own design stack (no web font added). */
html[lang='ja'] .about-fullscreen__text strong {
  font-family: inherit;
}

/* Home proof cards (ported from en.css): the translated "5 major banks" numeral does not fit the
   card width at the design's numeral size and wraps into oversized lines that run into the card label
   above it — same sizing as en.css. */
html[lang='ja'] .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='ja'] .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 (as en.css). */
html[lang='ja'] .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='ja'] .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='ja']) div.typea-page-head > nav.page-breadcrumb,
:where(html[lang='ja']) .consultation-hero__head > nav.page-breadcrumb,
:where(html[lang='ja']) .eb5-hero__head > nav.page-breadcrumb,
:where(html[lang='ja']) .qualification-hero__head > nav.page-breadcrumb,
:where(html[lang='ja']) .performance-hero > .performance-container > nav.page-breadcrumb,
:where(html[lang='ja']) .eb5-projects-head > nav.page-breadcrumb,
:where(html[lang='ja']) .seminar-detail-hero > .seminar-container > nav.page-breadcrumb,
:where(html[lang='ja']) .seminar-list-hero > .seminar-container > nav.page-breadcrumb,
:where(html[lang='ja']) .customer-cafe-head > nav.page-breadcrumb,
:where(html[lang='ja']) .ks-hero__container > nav.page-breadcrumb,
:where(html[lang='ja']) .settlement-hero__head > nav.page-breadcrumb,
:where(html[lang='ja']) .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='ja']) div.typea-page-head > nav.page-breadcrumb a,
:where(html[lang='ja']) div.typea-page-head > nav.page-breadcrumb strong,
:where(html[lang='ja']) .consultation-hero__head > nav.page-breadcrumb a,
:where(html[lang='ja']) .consultation-hero__head > nav.page-breadcrumb strong,
:where(html[lang='ja']) .eb5-hero__head > nav.page-breadcrumb a,
:where(html[lang='ja']) .eb5-hero__head > nav.page-breadcrumb strong,
:where(html[lang='ja']) .qualification-hero__head > nav.page-breadcrumb a,
:where(html[lang='ja']) .qualification-hero__head > nav.page-breadcrumb strong,
:where(html[lang='ja']) .performance-hero > .performance-container > nav.page-breadcrumb a,
:where(html[lang='ja']) .performance-hero > .performance-container > nav.page-breadcrumb strong,
:where(html[lang='ja']) .eb5-projects-head > nav.page-breadcrumb a,
:where(html[lang='ja']) .eb5-projects-head > nav.page-breadcrumb strong,
:where(html[lang='ja']) .seminar-detail-hero > .seminar-container > nav.page-breadcrumb a,
:where(html[lang='ja']) .seminar-detail-hero > .seminar-container > nav.page-breadcrumb strong,
:where(html[lang='ja']) .seminar-list-hero > .seminar-container > nav.page-breadcrumb a,
:where(html[lang='ja']) .seminar-list-hero > .seminar-container > nav.page-breadcrumb strong,
:where(html[lang='ja']) .customer-cafe-head > nav.page-breadcrumb a,
:where(html[lang='ja']) .customer-cafe-head > nav.page-breadcrumb strong,
:where(html[lang='ja']) .ks-hero__container > nav.page-breadcrumb a,
:where(html[lang='ja']) .ks-hero__container > nav.page-breadcrumb strong,
:where(html[lang='ja']) .settlement-hero__head > nav.page-breadcrumb a,
:where(html[lang='ja']) .settlement-hero__head > nav.page-breadcrumb strong,
:where(html[lang='ja']) .visa-encyclopedia-hero__head > nav.page-breadcrumb a,
:where(html[lang='ja']) .visa-encyclopedia-hero__head > nav.page-breadcrumb strong {
  color: inherit;
  font: inherit;
  text-decoration: none;
}

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

/* Floating chatbot button label (05-floating.css: content "AI 챗봇") — the ja chatbot trigger
   (src/i18n/messages/ja/chatbot.json). */
html[lang='ja'] .floating-cta__chatbot::after {
  content: 'AIチャットボット';
}

/* Links whose target has no ja page keep their markup but lose href (locale-links.mjs):
   do not advertise them as clickable. */
html[lang='ja'] 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='ja'] .ceo-message-page:not(.business-vision-page) .ceo-greeting-card__name {
  white-space: normal;
  word-break: keep-all;
}
