/* Language and currency switcher, and right-to-left layout for Arabic (i18n.js). */
@import url("https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@400;500;600&family=Noto+Naskh+Arabic:wght@400;500&family=Noto+Sans+Devanagari:wght@400;500;600&display=swap");

html.i18n-pending body { visibility: hidden; }

.prefs { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.pref { position: relative; display: inline-flex; align-items: center; gap: 4px; color: var(--dim, #9aa3c7); }
.pref svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; position: absolute; inset-inline-start: 9px; pointer-events: none; }
.pref select {
  appearance: none; -webkit-appearance: none; font: inherit; font-size: .82rem; color: var(--ink, #e9ecf7);
  background: rgba(7, 11, 26, .6); border: 1px solid var(--line, rgba(190, 205, 255, .22)); border-radius: 999px;
  padding: 6px 12px; min-height: 34px; cursor: pointer;
}
.pref svg + select { padding-inline-start: 30px; }
.pref select:hover { border-color: var(--gold, #f2c879); }
.pref select:focus-visible { outline: 2px solid var(--gold, #f2c879); outline-offset: 2px; }
.pref select option { color: #111; }
.pref-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.appbar .prefs { margin-inline-start: 8px; }
@media (max-width: 480px) {
  .nav .prefs { margin-inline-start: auto; }
  .pref select { font-size: .78rem; padding: 5px 9px; min-height: 32px; }
  .pref svg + select { padding-inline-start: 26px; }
  .pref svg { inset-inline-start: 7px; width: 14px; height: 14px; }
}

/* Hindi: Devanagari letters; the display fonts have none. */
html[lang="hi"] body, html[lang="hi"] body *:not(svg):not(svg *) { font-family: "Figtree", "Noto Sans Devanagari", system-ui, sans-serif; }
html[lang="hi"] .brand, html[lang="hi"] .appbrand span, html[lang="hi"] .title { font-family: var(--font-display, "Marcellus"), serif; }
html[lang="hi"] h1, html[lang="hi"] h2, html[lang="hi"] h3, html[lang="hi"] .title, html[lang="hi"] .eyebrow, html[lang="hi"] .label { font-family: "Noto Sans Devanagari", sans-serif; letter-spacing: 0 !important; text-transform: none; }
/* Ukrainian and Russian: Cyrillic falls back from Marcellus to the body font. */
html[lang="uk"] h1, html[lang="uk"] h2, html[lang="uk"] h3, html[lang="ru"] h1, html[lang="ru"] h2, html[lang="ru"] h3 { letter-spacing: .02em; }

/* Arabic: a font with Arabic letters, and mirrored layout. */
html[lang="ar"] body, html[lang="ar"] body *:not(svg):not(svg *) { font-family: "Noto Kufi Arabic", "Figtree", system-ui, sans-serif; }
html[lang="ar"] .brand, html[lang="ar"] .appbrand span, html[lang="ar"] .title, html[lang="ar"] .chart .name { font-family: var(--font-display, "Marcellus"), "Noto Kufi Arabic", serif; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] .title, html[lang="ar"] .brand,
html[lang="ar"] .appbrand, html[lang="ar"] .eyebrow, html[lang="ar"] .label { letter-spacing: 0 !important; }
html[lang="ar"] blockquote, html[lang="ar"] .story, html[lang="ar"] .myth { font-family: "Noto Naskh Arabic", serif; font-style: normal; }
[dir="rtl"] .brand, [dir="rtl"] .appbrand, [dir="rtl"] .coords, [dir="rtl"] input[type="email"],
[dir="rtl"] input[type="password"], [dir="rtl"] #su-code { direction: ltr; }
[dir="rtl"] .brand, [dir="rtl"] .appbrand { unicode-bidi: isolate; }
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="password"] { text-align: right; }
[dir="rtl"] ul { padding-right: 1.2em; padding-left: 0; }
[dir="rtl"] .nav ul, [dir="rtl"] .apptabs, [dir="rtl"] .tabbar { padding-right: 0; }
[dir="rtl"] .mname, [dir="rtl"] .join-form, [dir="rtl"] .pick, [dir="rtl"] .menu button, [dir="rtl"] th, [dir="rtl"] td,
[dir="rtl"] .doc-body th, [dir="rtl"] .doc-body td, [dir="rtl"] .ex .presc, [dir="rtl"] .tr-hero { text-align: right; }
[dir="rtl"] .pillar ul, [dir="rtl"] .plan ul, [dir="rtl"] .recipe ul, [dir="rtl"] .next-card .exlist, [dir="rtl"] .done-list,
[dir="rtl"] .rv-list, [dir="rtl"] .gentle-list { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .switch-inline { margin-left: 0; margin-right: auto; }
[dir="rtl"] .meal .badge, [dir="rtl"] .now, [dir="rtl"] .big-number small { margin-left: 0; margin-right: 6px; }
[dir="rtl"] .week-tag, [dir="rtl"] .challenge li b { margin-right: 0; margin-left: 6px; }
[dir="rtl"] .based { border-left: 0; border-right: 3px solid var(--vit); padding: 4px 12px 4px 0; }
[dir="rtl"] #meals .meal { border-left: 1px solid rgba(154, 215, 189, .18); border-right: 4px solid var(--meal); }
[dir="rtl"] .drawer { right: auto; left: 0; border-left: 0; border-right: 1px solid var(--line); }
[dir="rtl"] .menu i { transform: rotate(135deg); }
[dir="rtl"] .start::before { border-left: 0; border-right: 9px solid currentColor; }
/* The night-sky charts and the hero keep their drawn orientation. */
[dir="rtl"] .chart svg, [dir="rtl"] .hero-chart svg { direction: ltr; }
/* English blocks (payment terms, consent boxes, the company line) keep left-to-right order inside an Arabic page. */
[dir="rtl"] .site-foot > div:first-child, [dir="rtl"] footer > div[data-no-i18n] { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] [lang="en"][dir="ltr"] { text-align: left; }

/* Arabic and Devanagari letters join, so spaced-out labels and monospace data fonts break them. */
html[lang="ar"] body *:not(svg):not(svg *), html[lang="hi"] body *:not(svg):not(svg *) { letter-spacing: 0 !important; }
html[lang="ar"] body *:not(svg):not(svg *):not(.brand):not(.brand *):not(.appbrand *):not(.title):not(blockquote):not(.story):not(.myth) { font-family: "Noto Kufi Arabic", "Figtree", system-ui, sans-serif !important; }
html[lang="hi"] body *:not(svg):not(svg *):not(.brand):not(.brand *):not(.appbrand *):not(.title) { font-family: "Figtree", "Noto Sans Devanagari", system-ui, sans-serif !important; }
