/* Languages of decision 008 (es, fr, ar, ja, zh, ko). Loaded only on those pages (layouts/appv2).
   The site fonts (Gilroy, Graphik, MabryPro, ApercuPro) have no Arabic/CJK glyphs: system fonts for those scripts. */

html:lang(ar) body, html:lang(ar) h1, html:lang(ar) h2, html:lang(ar) h3, html:lang(ar) h4,
html:lang(ar) p, html:lang(ar) a, html:lang(ar) span, html:lang(ar) li, html:lang(ar) button,
html:lang(ar) input, html:lang(ar) textarea, html:lang(ar) time, html:lang(ar) div {
    font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif;
}
html:lang(ja) body, html:lang(ja) h1, html:lang(ja) h2, html:lang(ja) h3, html:lang(ja) h4,
html:lang(ja) p, html:lang(ja) a, html:lang(ja) span, html:lang(ja) li, html:lang(ja) button,
html:lang(ja) input, html:lang(ja) textarea, html:lang(ja) time, html:lang(ja) div {
    font-family: Graphik, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, "Noto Sans JP", sans-serif;
}
html:lang(zh-Hans) body, html:lang(zh-Hans) h1, html:lang(zh-Hans) h2, html:lang(zh-Hans) h3, html:lang(zh-Hans) h4,
html:lang(zh-Hans) p, html:lang(zh-Hans) a, html:lang(zh-Hans) span, html:lang(zh-Hans) li, html:lang(zh-Hans) button,
html:lang(zh-Hans) input, html:lang(zh-Hans) textarea, html:lang(zh-Hans) time, html:lang(zh-Hans) div {
    font-family: Graphik, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
}
html:lang(ko) body, html:lang(ko) h1, html:lang(ko) h2, html:lang(ko) h3, html:lang(ko) h4,
html:lang(ko) p, html:lang(ko) a, html:lang(ko) span, html:lang(ko) li, html:lang(ko) button,
html:lang(ko) input, html:lang(ko) textarea, html:lang(ko) time, html:lang(ko) div {
    font-family: Graphik, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}
/* CJK: no letter-spacing tricks or forced upper case meant for Latin/Cyrillic headings. */
html:lang(ja) *, html:lang(zh-Hans) *, html:lang(ko) * { letter-spacing: normal; word-break: normal; line-break: strict; }
/* Arabic letters join: any letter-spacing breaks the words apart. */
html:lang(ar) * { letter-spacing: normal !important; }

/* Arabic: right-to-left. Flex rows and text alignment flip with dir="rtl"; mirror what is positioned explicitly. */
[dir="rtl"] body { text-align: right; }
[dir="rtl"] .tape_meta, [dir="rtl"] .section_meta { left: auto; right: 0; border-radius: 3px 0 0 0; }
[dir="rtl"] .mfp-content, [dir="rtl"] .mfp-title { text-align: right; }
/* Header menu: the gap between items is a right margin in style.css. */
@media (min-width: 992px) {
    [dir="rtl"] .menu_item { margin-right: 0; margin-left: 60px; }
    [dir="rtl"] .menu_item:last-child { margin-left: 0; }
}
[dir="rtl"] .mfp-title { padding-right: 0; padding-left: 36px; }
/* Latin names, numbers and URLs inside Arabic text keep their own direction. */
[dir="rtl"] code { direction: ltr; unicode-bidi: isolate; }
