/* langswitch.css — style du widget <langswitch/> : sélecteur de langue (liens, ou dropdown <details>).
 * Chargé automatiquement par le widget (une fois par page). Thème-aware via [data-theme="dark"].
 * Variables du thème réutilisées si présentes (sinon valeurs de repli) → fonctionne sur tout layout.
 * Le widget marche sans ce CSS (liens nus) ; ce fichier ne fait que la présentation. */

.wbLangSwitch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: .875rem;
  line-height: 1;
}

/* Entrées : liens de langue + langue courante */
.wbLangSwitch a,
.wbLangSwitch .is-active {
  display: inline-flex;
  align-items: center;
  padding: .25rem .5rem;
  border-radius: .375rem;
  text-decoration: none;
  color: var(--text-muted, #64748b);
  transition: background .15s ease, color .15s ease;
}

.wbLangSwitch a:hover {
  color: var(--text-main, #1f2937);
  background: var(--bg-hover, #eef1f5);
}

.wbLangSwitch a:focus-visible {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: 1px;
}

/* Langue courante : marquée, non cliquable */
.wbLangSwitch .is-active {
  font-weight: 600;
  color: var(--primary, #2563eb);
  cursor: default;
}

/* ------------------------------------------------------------------ mode dropdown (<details>) */
.wbLangSwitch--dd {
  position: relative;
  display: inline-block;
}

.wbLangSwitch--dd > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: .25rem .5rem;
  border-radius: .375rem;
  color: var(--text-main, #1f2937);
  border: 1px solid var(--border-color, #d8dee9);
  background: var(--bg-hover, #eef1f5);
  user-select: none;
}

.wbLangSwitch--dd > summary::-webkit-details-marker {
  display: none;
}

.wbLangSwitch--dd > summary::after {
  content: "\25BE"; /* ▾ */
  margin-left: .35rem;
  font-size: .75em;
  opacity: .6;
}

.wbLangSwitch--dd > summary:focus-visible {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: 1px;
}

.wbLangSwitch--dd > nav {
  position: absolute;
  z-index: 50;
  top: calc(100% + .25rem);
  right: 0;
  min-width: 8rem;
  display: flex;
  flex-direction: column;
  padding: .25rem;
  border-radius: .5rem;
  background: var(--bg-flat, #ffffff);
  border: 1px solid var(--border-color, #d8dee9);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .15);
}

/* ------------------------------------------------------------------ thème sombre */
[data-theme="dark"] .wbLangSwitch a:hover,
[data-theme="dark"] .wbLangSwitch--dd > summary {
  background: rgba(255, 255, 255, .08);
}

[data-theme="dark"] .wbLangSwitch--dd > summary {
  border-color: rgba(255, 255, 255, .14);
}

[data-theme="dark"] .wbLangSwitch--dd > nav {
  background: #1e1e22;
  border-color: rgba(255, 255, 255, .12);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}
