/* themeset.css — style du widget <themeSet/> : pilule segmentée à 3 icônes (clair / sombre / système).
 * 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. */

.wbThemeSet {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-hover, #eef1f5);
  border: 1px solid var(--border-color, #d8dee9);
  line-height: 0;
}

.wbThemeSet__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.wbThemeSet__btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.wbThemeSet__btn:hover {
  color: var(--text-main, #1f2937);
}

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

.wbThemeSet__btn.is-active {
  background: var(--bg-flat, #ffffff);
  color: var(--primary, #2563eb);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .14);
}

/* Mode sombre : contraste adapté (le contrôle est utilisable sur fond clair comme sombre). */
[data-theme="dark"] .wbThemeSet {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .14);
}

[data-theme="dark"] .wbThemeSet__btn.is-active {
  background: rgba(255, 255, 255, .16);
  color: #ffffff;
}

/* Variante mode="toggle" : un seul bouton icône (bascule clair↔sombre). */
.wbThemeSet__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border-color, #d8dee9);
  background: var(--bg-hover, #eef1f5);
  color: var(--text-main, #1f2937);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.wbThemeSet__toggle:hover {
  color: var(--primary, #2563eb);
}

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

.wbThemeSet__toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Lune affichée en thème clair (→ basculer vers sombre) ; soleil en thème sombre. */
.wbThemeSet__sun { display: none; }
.wbThemeSet__moon { display: inline-flex; }
[data-theme="dark"] .wbThemeSet__moon { display: none; }
[data-theme="dark"] .wbThemeSet__sun { display: inline-flex; }

[data-theme="dark"] .wbThemeSet__toggle {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .14);
  color: #ffffff;
}
