/* The language and currency layer (functions/_lib/i18n.mjs adds it to every page). The control borrows the bar's own pieces: the
   pill of .menu__btn, the panel of .menu__panel, the tokens of site.css. Nothing here changes a rule of site.css for an English
   page; the [dir="rtl"] rules only mirror what a right-to-left page needs. */
.i18n { position: relative; flex: none; }
.i18n > summary { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; font-size: 13px; font-weight: 600;
  letter-spacing: 0.02em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; white-space: nowrap;
  list-style: none; -webkit-user-select: none; user-select: none; }
.i18n > summary::-webkit-details-marker { display: none; }
.i18n > summary::marker { content: ""; }
.i18n > summary:hover, .i18n[open] > summary { color: var(--text); }
.i18n__panel { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 30; width: min(560px, calc(100vw - 2 * var(--gutter)));
  max-height: min(72vh, 640px); overflow: auto; overscroll-behavior: contain; padding: 10px; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); }
.i18n__h { margin: 6px 10px 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.i18n__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px; margin: 0 0 8px; padding: 0; list-style: none; }
.i18n__list--cur { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.i18n__list a { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px; font-size: 15px; color: var(--muted);
  text-decoration: none; border-radius: 10px; }
.i18n__list a { unicode-bidi: isolate; }
.i18n__list a:hover { color: var(--text); background: rgba(127, 127, 127, 0.12); text-decoration: none; }
.i18n__list a[aria-current="true"] { color: var(--text); font-weight: 600; background: rgba(127, 127, 127, 0.16); }
.i18n__code { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.i18n__sym { color: var(--muted); font-weight: 400; }
@media (max-width: 720px) {
  .i18n > summary { min-height: 44px; }
  .i18n__panel { position: fixed; top: 56px; inset-inline: var(--gutter); width: auto; max-height: calc(100vh - 80px); }
}
@media print { .i18n { display: none !important; } }

/* A link to a page that exists in English only says so in the reader's language. */
a[data-i18n-note]::after { content: " " attr(data-i18n-note); font-size: 0.9em; opacity: 0.72; }

/* The note above a legal page for a reader of another language. */
.i18n-legal { max-width: var(--measure); margin: 20px auto 0; padding: 12px 16px; font-size: 14px; line-height: 1.5; color: var(--muted);
  border: 1px solid var(--line); border-radius: 14px; }

/* Right-to-left pages (ar, fa, he, ur): the bar's brand keeps the start edge. */
[dir="rtl"] .brand { margin-right: 0; margin-left: auto; }
[dir="rtl"] .menu__panel { right: auto; left: 0; }
