/* Reuse the old 44px menu slot without changing the approved header grid. */
.site-header.has-site-language > .menu-button { visibility: hidden; pointer-events: none; }
.site-header.has-site-language > .site-menu-placeholder { visibility: hidden; pointer-events: none; }
.site-header .site-language-button {
  grid-area: menu;
  justify-self: end;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 2px;
  border: 1px solid #5db8ff99;
  border-radius: 8px;
  background: #102943;
  color: #edf6ff;
  cursor: pointer;
  font: 700 10px/1.1 system-ui, sans-serif;
}
.site-language-button > span:first-child { font-size: 20px; line-height: 24px; }
.site-language-dialog {
  box-sizing: border-box;
  width: min(420px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 16px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #5db8ff;
  border-radius: 12px;
  background: #07182b;
  color: #edf6ff;
  font: 16px/1.45 system-ui, sans-serif;
}
.site-language-dialog::backdrop { background: #000a; }
.language-dialog-heading {
  display: flex;
  align-items: center;
  padding: 0 2px 12px;
  border-bottom: 1px solid #2b4c6d;
}
.site-language-dialog h2 { width: 100%; margin: 0; font-size: 22px; text-align: center; }
.site-language-dialog button { min-height: 44px; padding: 9px 12px; border: 1px solid #2b4c6d; border-radius: 8px; background: #102943; color: inherit; cursor: pointer; font: inherit; }
.site-language-dialog [data-language-close] {
  width: 100%;
  margin: 0;
  font-size: inherit;
  text-align: center;
  border-color: #ff6969;
  background: #8f1d1d;
  color: #fff;
}
.site-language-dialog [data-language-close]:hover { background: #b32424; }
.language-dialog-footer { display: flex; width: 100%; padding-top: 6px; }
.language-list { display: grid; gap: 6px; }
.language-list button { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; text-align: start; }
.language-list button span:first-child { font: inherit; }
.language-list button span:last-child { font-size: 13px; opacity: .85; }
.language-list button[aria-pressed="true"] { border-color: #78c2ff; background: #164371; }
.language-list button[aria-pressed="true"] span:first-child::before { content: "✓ "; }
.language-list button:disabled { opacity: .55; cursor: default; }
.site-language-dialog [hidden] { display: none !important; }
.language-status { min-height: 1.4em; margin: 0 0 10px; text-align: center; }
.language-status:empty { display: none; }
.language-note { margin: 12px -12px; font-size: clamp(10px, 2.9vw, 13px); text-align: center; }
html:is([lang="fil"], [lang="fr"], [lang="ru"]) .language-note { font-size: clamp(8px, 2.4vw, 11px); }
@media (max-width: 359px) { html:is([lang="es"], [lang="pt"]) .language-note { font-size: 9px; } }
.language-note > span { display: block; white-space: nowrap; }
.site-language-button:focus-visible, .site-language-dialog button:focus-visible { outline: 2px solid #78c2ff; outline-offset: 3px; }
/* Arabic text follows its own reading direction; fixed navigation stays put. */
html[dir="rtl"] :is(.site-header, .floating-site-controls) { direction: ltr; }
html[dir="rtl"] #app { text-align: start; }
html[dir="rtl"] input:is([type="email"], [type="tel"], [type="url"], [type="number"]) { direction: ltr; }
@media print { .site-language-button, .site-language-dialog { display: none !important; } }
