/**
 * <bs-switch> — theme + language switcher.
 *
 * Themes through --bs-sw-* variables that default to the host's tokens, so light, dark and
 * glass come for free. Override them on .bs-switch to reskin for a client.
 */

.bs-switch {
  --bs-sw-bg:      rgba(0, 0, 0, .04);
  --bs-sw-border:  rgba(0, 0, 0, .10);
  --bs-sw-ink:     #4a4458;
  --bs-sw-ink-on:  #141020;
  --bs-sw-active:  #ffffff;
  --bs-sw-accent:  var(--accent, #8b3dff);
  --bs-sw-focus:   var(--bs-sw-accent);

  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--bs-sw-border);
  border-radius: 999px;
  background: var(--bs-sw-bg);
  line-height: 1;
  vertical-align: middle;
}

html.dark .bs-switch {
  --bs-sw-bg:     rgba(255, 255, 255, .06);
  --bs-sw-border: rgba(255, 255, 255, .14);
  --bs-sw-ink:    #b9b1c8;
  --bs-sw-ink-on: #ffffff;
  --bs-sw-active: rgba(255, 255, 255, .12);
}

html.glass-mode .bs-switch {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .22);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
}

.bs-switch button {
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--bs-sw-ink);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.bs-switch button:hover { color: var(--bs-sw-ink-on); }
.bs-switch button:active { transform: scale(.94); }

.bs-switch button:focus-visible {
  outline: 2px solid var(--bs-sw-focus);
  outline-offset: 2px;
}

/* Theme button */
.bs-switch__theme {
  width: 30px;
  height: 30px;
  padding: 0;
}

.bs-switch__theme svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

/* The moon is a filled shape; the sun is stroked. */
.bs-switch__theme svg path[d^="M20.5"] { fill: currentColor; stroke: none; }
.bs-switch__theme svg circle { fill: currentColor; stroke: none; }

/* Separator */
.bs-switch__sep {
  width: 1px;
  height: 16px;
  margin: 0 3px;
  background: var(--bs-sw-border);
}

/* Language buttons */
.bs-switch__langs { display: inline-flex; gap: 2px; }

.bs-switch__lang {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
}

.bs-switch__lang.is-active {
  background: var(--bs-sw-active);
  color: var(--bs-sw-ink-on);
  box-shadow: 0 1px 2px rgba(20, 16, 32, .10);
}

html.dark .bs-switch__lang.is-active { box-shadow: none; }

/* Accent underline on the active language, the one brand flourish. */
.bs-switch__lang.is-active::after {
  content: "";
  position: absolute;
  transform: translateY(11px);
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--bs-sw-accent);
}

.bs-switch__lang { position: relative; }

@media (prefers-reduced-motion: reduce) {
  .bs-switch button { transition: none; }
  .bs-switch button:active { transform: none; }
}
