/* ==========================================================================
   AstraCursus - selettore di lingua (IT/EN)
   Icona neutra (globo) + codice lingua attivo; dropdown Italiano / English con
   spunta sulla voce corrente. Usa i token del tema Aurora: nessun nuovo colore.
   ========================================================================== */

.lang-switch {
  position: relative;
  flex: 0 0 auto;
}

.lang-switch__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 7px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-btn);
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.lang-switch__btn:hover { background: rgba(255, 255, 255, 0.1); }
.lang-switch__btn[aria-expanded="true"] {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
}
.lang-switch__btn:focus-visible {
  outline: var(--focus-ring) solid var(--focus);
  outline-offset: 2px;
}

.lang-switch__icon { width: 18px; height: 18px; color: var(--accent); flex: 0 0 auto; }
.lang-switch__code { min-width: 1.5em; text-align: center; }

.lang-switch__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  min-width: 184px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow);
}
.lang-switch__menu[hidden] { display: none; }

.lang-switch__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--ink-muted);
  font-size: 0.9375rem;
  cursor: pointer;
}
.lang-switch__option:hover { background: rgba(255, 255, 255, 0.08); color: var(--ink); }
.lang-switch__option:focus-visible {
  outline: var(--focus-ring) solid var(--focus);
  outline-offset: -2px;
  color: var(--ink);
}
.lang-switch__option[aria-selected="true"] { color: var(--ink); font-weight: 600; }

.lang-switch__check { width: 16px; height: 16px; color: var(--accent); opacity: 0; flex: 0 0 auto; }
.lang-switch__option[aria-selected="true"] .lang-switch__check { opacity: 1; }

/* Senza JS il selettore non ha effetto: meglio non mostrarlo. */
html.no-js .lang-switch { display: none; }

/* --- responsive: nel header mobile sta a sinistra dell'hamburger --- */
@media (max-width: 940px) {
  .lang-switch { order: 2; margin-inline-start: auto; }
  .nav-toggle { order: 3; margin-inline-start: 0; }
  .site-header__inner > .brand { order: 1; }
  .site-header__inner > .header-cta { order: 4; }
  .site-header__inner > .nav { order: 5; }
}

@media (max-width: 420px) {
  .site-header__inner { gap: var(--s-3); }
  .brand__mark { width: 34px; height: 34px; }
  .brand__name { font-size: 1.125rem; }
  .lang-switch__btn { padding: 7px 8px; }
}
