/*
 * Hashi — CJK-only typography overrides.
 *
 * Enqueued by functions.php ONLY when pll_current_language() is `ja`.
 * Latin-only visitors (EN / ES) never see this file or the CJK fonts.
 *
 * Rules:
 *  - Body: Noto Sans JP with slightly looser line-height (1.7 vs Latin's 1.65).
 *  - Display: Noto Serif JP at a tighter scale than Latin (3.5rem vs 4rem) because
 *    Japanese characters at the same px size optically read larger than Latin.
 *  - Letter-spacing: zero on display (Latin uses -0.02em; CJK doesn't need it
 *    and the negative value can cause crowding with kanji).
 */

html[lang^="ja"] body,
html[lang^="ja"] .wp-block-group,
html[lang^="ja"] p,
html[lang^="ja"] li {
	font-family: var(--wp--preset--font-family--sans-jp);
	line-height: 1.75;
	font-feature-settings: "palt" 1;
}

html[lang^="ja"] h1,
html[lang^="ja"] h2,
html[lang^="ja"] h3 {
	font-family: var(--wp--preset--font-family--serif-jp);
	letter-spacing: 0;
	font-feature-settings: "palt" 1;
}

html[lang^="ja"] h1 {
	font-size: clamp(2.25rem, 3vw + 1rem, 3.5rem);
	line-height: 1.25;
	font-weight: 600;
}

html[lang^="ja"] h2 {
	font-size: clamp(1.625rem, 1.5vw + 1rem, 2.125rem);
	line-height: 1.35;
}

html[lang^="ja"] h3 {
	font-size: 1.375rem;
	line-height: 1.4;
}

/* h4 small-cap labels — Inter handles half-width Latin even on JA pages.
   Override slightly tighter letter-spacing for the JA case where the label
   is rendered in katakana or hiragana. */
html[lang^="ja"] h4 {
	font-family: var(--wp--preset--font-family--sans-jp);
	letter-spacing: 0.06em;
	text-transform: none;
}

/* Buttons — keep CTA buttons crisp. Inter is fine for short EN/JA mixed
   labels like "見る" or "問い合わせ". */
html[lang^="ja"] .wp-element-button,
html[lang^="ja"] .wp-block-button__link {
	font-family: var(--wp--preset--font-family--sans-jp);
	letter-spacing: 0.04em;
	text-transform: none;
}

/* Language switcher — render JA label with Noto Sans JP regardless of locale
   so it doesn't fall back to a system font. */
.sfp-language-switcher [lang="ja"] {
	font-family: var(--wp--preset--font-family--sans-jp, "Noto Sans JP", system-ui, sans-serif);
}
