/*
 * Hongkun Language Layout 2.8.0 — script fonts and line height.
 * Loaded only on Thai (/th/), Korean (/ko/), Japanese (/ja/) and Arabic (/ar/) pages.
 * Colours are not touched: the site palette (--hk-navy, --hk-orange ...) stays as it is.
 * The site uses var(--hk-font); overriding it on <body> switches every element that uses it.
 */

/* ---------- Thai: stacked vowels and tone marks need extra line height ---------- */
body.hk-language-th {
	--hk-font: "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
	font-family: var(--hk-font);
	line-height: 1.8;
}
body.hk-language-th :is(h1, h2, h3, h4, h5, h6) {
	font-family: var(--hk-font);
	line-height: 1.45;
}
body.hk-language-th :is(p, li, dd, td, th, blockquote, figcaption) {
	line-height: 1.8;
}

/* ---------- Korean: keep words together when lines wrap ---------- */
body.hk-language-ko {
	--hk-font: "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
	font-family: var(--hk-font);
	line-height: 1.75;
	word-break: keep-all;
	overflow-wrap: anywhere;
}
body.hk-language-ko :is(h1, h2, h3, h4, h5, h6) {
	font-family: var(--hk-font);
	line-height: 1.4;
}
body.hk-language-ko :is(p, li, dd, td, th, blockquote, figcaption) {
	line-height: 1.75;
}

/* ---------- Japanese (2.9.0) ---------- */
body.hk-language-ja {
	--hk-font: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", Meiryo, system-ui, sans-serif;
	font-family: var(--hk-font);
	line-height: 1.8;
	line-break: strict;
	overflow-wrap: anywhere;
}
body.hk-language-ja :is(h1, h2, h3, h4, h5, h6) {
	font-family: var(--hk-font);
	line-height: 1.45;
}
body.hk-language-ja :is(p, li, dd, td, th, blockquote, figcaption) {
	line-height: 1.8;
}

/* ---------- Arabic ---------- */
body.hk-language-ar {
	--hk-font: "Noto Sans Arabic", Tahoma, "Segoe UI", system-ui, sans-serif;
	font-family: var(--hk-font);
	line-height: 1.9;
}
body.hk-language-ar :is(h1, h2, h3, h4, h5, h6) {
	font-family: var(--hk-font);
	line-height: 1.5;
}
body.hk-language-ar :is(p, li, dd, td, th, blockquote, figcaption) {
	line-height: 1.9;
}

/* Form controls and menus do not inherit the font by default. */
:is(body.hk-language-th, body.hk-language-ko, body.hk-language-ja, body.hk-language-ar) :is(button, input, select, textarea, .main-navigation, .menu-toggle) {
	font-family: var(--hk-font);
}

/* ---------- Right-to-left layout (html dir="rtl", body.hk-rtl) ---------- */
body.hk-rtl :is(.entry-content, .entry-header, .hk-lang-footer, .hk-lang-footer h2, .hk-lang-footer-details) {
	text-align: start;
}
body.hk-rtl .hk-lang-footer h2 {
	text-align: right;
}
body.hk-rtl :is(.entry-content ul, .entry-content ol) {
	padding-right: 1.5em;
	padding-left: 0;
}
/* E-mail addresses, model codes and marked phrases stay left-to-right inside Arabic text. */
body.hk-rtl :is(.hk-lang-footer-detail a[href^="mailto:"], code, kbd, .ltr) {
	direction: ltr;
	unicode-bidi: isolate;
}
body.hk-rtl .hk-lang-footer-detail dd {
	text-align: right;
}
