/* Language menu v1 (2026-10-21): a styled button + listbox instead of the browser's native select menu, used on the
   Home page, the sign-in dialog and the legal pages. Loaded last; the html + id-free class chain plus !important
   outranks the older .public-language-select rules. */

html body .lang-menu {
  --lang-text: #f1f3f1;
  --lang-text-2: rgba(241, 243, 241, 0.74);
  --lang-line: rgba(241, 243, 241, 0.16);
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  min-height: 0 !important;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  font-family: "Geist Local", "Geist", Arial, sans-serif;
}
html body .lang-menu .lang-menu-native { display: none !important; }

html body .lang-menu .lang-menu-button {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: auto !important;
  height: 40px;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 10px 0 12px !important;
  border: 1px solid rgba(241, 243, 241, 0.28) !important;
  border-radius: 14px;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--lang-text) !important;
  font: 500 13px/1 "Geist Local", "Geist", Arial, sans-serif !important;
  letter-spacing: 0 !important;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}
html body .lang-menu .lang-menu-button:hover,
html body .lang-menu.is-open .lang-menu-button { border-color: rgba(241, 243, 241, 0.5) !important; background: rgba(241, 243, 241, 0.05) !important; }
html body .lang-menu .lang-menu-button:focus-visible { outline: 2px solid rgba(241, 243, 241, 0.7) !important; outline-offset: 2px !important; }
html body .lang-menu .lang-menu-globe { width: 15px; height: 15px; flex: none; color: var(--lang-text-2); }
html body .lang-menu .lang-menu-chevron { width: 14px; height: 14px; flex: none; color: var(--lang-text-2); transition: transform 160ms ease; }
html body .lang-menu.is-open .lang-menu-chevron { transform: rotate(180deg); }

html body .lang-menu .lang-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  min-width: max(100%, 184px);
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--lang-line);
  border-radius: 12px;
  background: #141615;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
  animation: lang-menu-in 140ms ease both;
}
html body .lang-menu .lang-menu-list[hidden] { display: none; }
html body .lang-menu.align-end .lang-menu-list { left: auto; right: 0; }
html body .lang-menu [role="option"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--lang-text-2);
  font: 400 14px/1 "Geist Local", "Geist", Arial, sans-serif;
  cursor: pointer;
  outline: none;
}
html body .lang-menu [role="option"]:hover,
html body .lang-menu [role="option"]:focus-visible,
html body .lang-menu [role="option"]:focus { background: rgba(241, 243, 241, 0.07); color: var(--lang-text); }
html body .lang-menu [role="option"][aria-selected="true"] { color: var(--lang-text); font-weight: 500; }
html body .lang-menu .lang-menu-check { width: 14px; height: 14px; flex: none; visibility: hidden; }
html body .lang-menu [aria-selected="true"] .lang-menu-check { visibility: visible; }
@keyframes lang-menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html body .lang-menu .lang-menu-list { animation: none; }
  html body .lang-menu .lang-menu-chevron { transition: none; }
}

/* Sign-in dialog: same height and radius as its other controls. */
html body #authGate .lang-menu { justify-self: start !important; width: auto !important; margin: 0 0 22px !important; }
html body #authGate .lang-menu .lang-menu-button { height: 36px; border-radius: 10px; border-color: rgba(241, 243, 241, 0.13) !important; }
@media (max-width: 620px) { html body #authGate .lang-menu { margin-bottom: 18px !important; } }

/* Narrow Home header: the globe alone keeps room for the sign-in buttons. */
@media (max-width: 420px) {
  html body .public-nav-actions .lang-menu .lang-menu-value { display: none; }
  html body .public-nav-actions .lang-menu .lang-menu-button { padding: 0 8px 0 10px !important; gap: 6px !important; }
}
