/* Other languages: the language button and picker, each script's own letters,
   and right-to-left pages. */
:root { --serif: "Fraunces", var(--script-head, Georgia), Georgia, serif; --sans: "Inter", var(--script, system-ui), system-ui, -apple-system, "Segoe UI", sans-serif; }
.sharebtn { font-family: var(--sans); }

/* top bar: "English" on pages in another language, and the globe */
.sitebar .lang-en { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1.5px solid #E8B83A; border-radius: 999px; color: #F6CE5E; font: 600 14px/1 "Inter", system-ui, sans-serif; text-decoration: none; white-space: nowrap; }
.sitebar .lang-en:hover { background: rgba(232,184,58,.16); color: #F6CE5E; }
.sitebar .lang-globe { display: flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: #F3F1EA; cursor: pointer; }
.sitebar .lang-globe:hover { background: rgba(255,255,255,.1); }
.sitebar .donate svg { flex: none; }
@media (max-width: 640px) {
  .sitebar .family a { padding: 0 9px; }
  .sitebar .lang-en { padding: 0 10px; font-size: 13px; }
  .sitebar .lang-globe, .sitebar .theme { width: 36px; }
  .sitebar .donate { justify-content: center; width: 36px; height: 36px; min-height: 36px; padding: 0; gap: 0; }
  .sitebar .donate span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* the picker: a panel on computers, a sheet from the bottom on phones */
.panel-lang { width: min(760px, calc(100vw - 16px)); }
.lang-q { flex: none; width: 100%; height: 46px; padding: 0 16px; border: 1px solid var(--line2); border-radius: 999px; background: var(--bg); color: var(--ink); font: 16px var(--sans); }
.lang-scroll { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
.lang-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 3px; }
.lang-item { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-height: 54px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; line-height: 1.35; }
.lang-item:hover { background: var(--gold-soft); color: var(--ink); }
.lang-item b { font-size: 15px; font-weight: 600; }
.lang-item small { font-size: 12px; color: var(--muted); }
.lang-item[aria-current] { border: 2px solid var(--gold); background: var(--gold-soft); }
.lang-item[aria-current]::after { content: "✓"; position: absolute; top: 6px; inset-inline-end: 10px; color: var(--gold-text); font-weight: 700; }
@media (max-width: 760px) { .lang-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .panel-lang { width: 100%; max-width: 100%; max-height: 86dvh; margin: auto auto 0; border-radius: 22px 22px 0 0; border-bottom: 0; }
  .lang-grid { grid-template-columns: minmax(0, 1fr); }
}
.lang-h { margin: 10px 4px 4px; font: 600 12px var(--sans); color: var(--muted); }
[data-lang-suggested][hidden] { display: none; }
.foot-langs { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 14px; }
.foot-langs a { display: inline-flex; align-items: center; min-height: 28px; }
.foot-langs a[aria-current] { color: var(--ink); font-weight: 600; }
.langoffer { position: fixed; z-index: 50; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 20px); padding: 8px 8px 8px 18px; border-radius: 999px; background: #12191B; color: #F3F1EA; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.langoffer[dir=rtl] { padding: 8px 18px 8px 8px; }
.langoffer a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: #E8B83A; color: #1A1400; font-weight: 700; text-decoration: none; white-space: nowrap; }
.langoffer button { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 22px; cursor: pointer; }

/* letters that join or stack need their own spacing */
html:not([lang=en]) * { letter-spacing: 0 !important; }
html[lang=ur] body, html[lang=pnb] body { line-height: 2; }
html[lang=ur] h1, html[lang=pnb] h1, html[lang=ur] h2, html[lang=pnb] h2, html[lang=ur] h3, html[lang=pnb] h3 { line-height: 1.8; }
html[lang=ur] .times .n, html[lang=pnb] .times .n { line-height: 1.9; }
html:not([lang=en]) .t1-opt, html:not([lang=en]) .chip, html:not([lang=en]) .btn { text-wrap: balance; }
html:not([lang=en]) .times .n, html:not([lang=en]) .acc-cell .n { overflow-wrap: anywhere; }

/* long words on narrow screens: they shrink or break rather than push the page wide */
html:not([lang=en]) .grid > *, html:not([lang=en]) .grid label, html:not([lang=en]) select, html:not([lang=en]) .grid input { min-width: 0; max-width: 100%; }
html:not([lang=en]) :is(h1, h2, h3, label, b, small, summary, .btn, .chip) { overflow-wrap: anywhere; }
@media (max-width: 560px) { html:not([lang=en]) .placebtn { padding: 0 12px; font-size: 14px; } }

/* right to left */
.brand { direction: ltr; }
[dir=rtl] .sr, [dir=rtl] .skip { left: auto; right: -9999px; }
[dir=rtl] .skip:focus { right: 8px; }
[dir=rtl] .tt th, [dir=rtl] .t1-opt, [dir=rtl] .method, [dir=rtl] .acc-city { text-align: right; }
[dir=rtl] .t1-links { margin-left: 0; margin-right: auto; }
[dir=rtl] .t1 summary::after { margin: 0 4px 0 0; }
[dir=rtl] .designpick > div { right: auto; left: 0; }
[dir=rtl] .acc-why { border-left: 0; border-right: 3px solid var(--gold); padding: 4px 14px 4px 0; }
[dir=rtl] .acc-why ul { padding: 0 18px 0 0; }
[dir=rtl] .acc-map { direction: ltr; }
[dir=rtl] .acc-crumbs span:not(:empty)::before { content: "‹"; margin: 0 2px 0 6px; }
/* clock figures read left to right */
[dir=rtl] .times .t, [dir=rtl] .htimes .t, [dir=rtl] .clock .count, [dir=rtl] .countdown .big, [dir=rtl] .pair .big, [dir=rtl] .acc-cell b { direction: ltr; unicode-bidi: isolate; }
[dir=rtl] pre, [dir=rtl] input[type=url], [dir=rtl] input[type=email] { direction: ltr; text-align: left; }
[dir=rtl] code { unicode-bidi: isolate; direction: ltr; }
/* the half circle of the day starts on the side reading starts */
[dir=rtl] .dial svg { direction: ltr; transform: scaleX(-1); }
[dir=rtl] .dial svg text { transform: scaleX(-1); transform-box: fill-box; transform-origin: center; }
@media (min-width: 861px) { [dir=rtl] .skyhero .when { left: auto; right: max(20px, calc((100vw - var(--max)) / 2 + 20px)); } }
[dir="rtl"] .acc-city .small { direction: ltr; text-align: right; }
