/**
 * Typography corrections for Chinese, Japanese and Korean.
 *
 * Scoped to the plugin's own controls. Restyling a theme's body text is
 * not this plugin's business.
 */

.ozytr-cjk .ozytr-switcher,
.ozytr-cjk .ozytr-suggestion {
	/* CJK glyphs sit taller than Latin ones, so the same line-height reads
	   as cramped. */
	line-height: 1.8;
	letter-spacing: 0.02em;
}

.ozytr-cjk .ozytr-switcher__label,
.ozytr-cjk .ozytr-suggestion__text {
	/* No spaces between words means the browser needs permission to break
	   anywhere, or a long run overflows its container. */
	word-break: normal;
	overflow-wrap: break-word;
	line-break: strict;
}

.ozytr-cjk .ozytr-switcher__label {
	/* Latin fallbacks first so mixed strings such as "English (英語)" use
	   the right face for each half. */
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
		"Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans SC", "Noto Sans KR",
		"Microsoft YaHei", "Malgun Gothic", Meiryo, sans-serif;
}

.ozytr-cjk .ozytr-switcher__toggle,
.ozytr-cjk .ozytr-switcher__option {
	/* CJK labels are shorter in characters but wider per character, so the
	   Latin minimum width leaves them looking stranded. */
	min-width: 0;
	padding-top: 6px;
	padding-bottom: 6px;
}

.ozytr-cjk .ozytr-switcher--pills .ozytr-switcher__option {
	letter-spacing: 0.05em;
}

/* Language codes and URLs are Latin even on a CJK page. */
.ozytr-cjk .ozytr-lang-code,
.ozytr-cjk .ozytr-switcher__code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	letter-spacing: 0;
}
