/* Languages module: header switcher (desktop), drawer list (phones), fonts for non-Latin scripts.
   Logical properties (inline-start/end), so this file works left-to-right and right-to-left without a mirrored copy. */

/* Header switcher */
.bhr-lang { position: relative; }
.bhr-lang__btn { list-style: none; width: auto !important; gap: 4px; padding-inline: 8px !important; }
.bhr-lang__btn::-webkit-details-marker { display: none; }
.bhr-lang__btn::marker { content: ""; }
.bhr-lang__now { font-size: 12px; font-weight: 700; letter-spacing: .04em; line-height: 1; }
.bhr-lang__list {
	position: absolute; inset-block-start: calc(100% + 4px); inset-inline-end: 0; z-index: 1000;
	min-width: 190px; margin: 0; padding: 6px 0; list-style: none;
	background: #fff; border: 1px solid #d0d0d0; box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}
.bhr-lang__list a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 16px; color: #222; text-decoration: none; font-size: 15px; }
.bhr-lang__list a:hover, .bhr-lang__list a:focus-visible { background: #f7f7f7; }
.bhr-lang__list a[aria-current] { font-weight: 700; }
.bhr-lang__code { display: inline-block; min-width: 2.2em; color: #666; font-size: 11px; font-weight: 700; letter-spacing: .04em; font-family: var(--wp--preset--font-family--lato, sans-serif); }
.bhr-lang__btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
/* Each language name in its own script's font, whatever the page language. */
:is(.bhr-lang__list, .bhr-drawer-langs) a:is(:lang(ar), :lang(fa)) { font-family: Tahoma, "Segoe UI", "Geeza Pro", "Noto Sans Arabic", sans-serif; font-size: 16px; }
:is(.bhr-lang__list, .bhr-drawer-langs) a:is(:lang(hi), :lang(bn)) { font-family: "Nirmala UI", "Kohinoor Devanagari", "Kohinoor Bangla", "Noto Sans Devanagari", "Noto Sans Bengali", sans-serif; }
:is(.bhr-lang__list, .bhr-drawer-langs) a:lang(zh) { font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }

/* Phones: list in the menu drawer instead of the header */
.bhr-drawer-langs { display: none; }
@media (max-width: 859px) {
	.bhr-header .bhr-lang { display: none; }
	.bhr-drawer-langs { display: block; margin-top: 28px; font-size: 13px; }
	.bhr-drawer-langs p { margin: 0 0 8px; color: #666; }
	.bhr-drawer-langs ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
	.bhr-drawer-langs a { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid #d0d0d0; color: #222; text-decoration: none; font-size: 14px; }
	.bhr-drawer-langs a[aria-current] { border-color: #222; font-weight: 700; }
	.bhr-drawer-langs .bhr-lang__code { min-width: 0; }
}

/* Right-to-left pages (Arabic, Farsi). Banners with text over a photo keep their left-to-right arrangement, because the
   photos are not mirrored (tools/build-rtl.mjs copies their rules unchanged); the text in them reads right to left. */
[dir="rtl"] :is(.bhr-slider, .bhr-spot, .bhr-hero2--page, .bhr-hero, .bhr-archive__head:has(.bhr-archive__hero)) { direction: ltr; }
[dir="rtl"] :is(.bhr-slide__copy, .bhr-spot__copy, .bhr-spot__rail, .bhr-hero2__copy, .bhr-hero__copy, .bhr-archive__headtext) { direction: rtl; text-align: right; }

/* Non-Latin scripts: the theme fonts (Cormorant, Lato) have Latin letters only, so the brand and Latin words keep them
   and the rest falls back to good system fonts for each script. */
html:lang(ar), html:lang(fa) {
	--wp--preset--font-family--lato: Lato, Tahoma, "Segoe UI", "Geeza Pro", "Noto Sans Arabic", Arial, sans-serif;
	--wp--preset--font-family--cormorant: Cormorant, "Noto Naskh Arabic", "Times New Roman", "Geeza Pro", serif;
}
html:lang(zh) {
	--wp--preset--font-family--lato: Lato, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
	--wp--preset--font-family--cormorant: Cormorant, "Songti SC", "SimSun", "Noto Serif SC", serif;
}
html:lang(hi) {
	--wp--preset--font-family--lato: Lato, "Nirmala UI", "Kohinoor Devanagari", "Noto Sans Devanagari", sans-serif;
	--wp--preset--font-family--cormorant: Cormorant, "Nirmala UI", "Kohinoor Devanagari", "Noto Serif Devanagari", serif;
}
/* Bangla (user, 5 Dec): SolaimanLipi by Solaiman Karim (ekushey.org), SIL Open Font License 1.0, licence in the font's
   own metadata. Repackaged as WOFF with every glyph (the font forbids subsetting). Bengali letters only (unicode-range),
   so the brand, prices and English words keep Lato. Regular weight only: bold Bangla is the browser's. */
@font-face {
	font-family: "SolaimanLipi";
	src: url(fonts/solaimanlipi.woff) format("woff");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0964-0965, U+0980-09FF, U+200C-200D, U+25CC;
}
html:lang(bn) {
	--wp--preset--font-family--lato: Lato, SolaimanLipi, "Nirmala UI", "Kohinoor Bangla", "Noto Sans Bengali", sans-serif;
	--wp--preset--font-family--cormorant: Cormorant, SolaimanLipi, "Nirmala UI", "Kohinoor Bangla", "Noto Serif Bengali", serif;
}
/* Letter spacing breaks joined Arabic and Persian letters and Indic syllables; synthetic italics look broken there too. */
:is(:lang(ar), :lang(fa), :lang(hi), :lang(bn), :lang(zh)) { letter-spacing: 0 !important; }
:is(:lang(ar), :lang(fa)) :is(em, i) { font-style: normal; }
