/* ============================================================
   theme-toggle.css — kapy.ch v2 · Task 7
   Segmented-control for tristate theme (Auto / Light / Dark).
   No animations except minimal hover/focus.
   ============================================================ */

.theme-toggle {
  display: inline-flex;
  padding: 2px;
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  gap: 0;
}

.theme-toggle__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 var(--space-3);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  line-height: 1;
  letter-spacing: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

@media (hover: hover) {
  .theme-toggle__btn:hover:not([aria-pressed='true']) {
    color: var(--text-primary);
    background-color: var(--action-ghost-hover);
  }
}

.theme-toggle__btn[aria-pressed='true'] {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

.theme-toggle__btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--bg-canvas),
    0 0 0 4px var(--brand-500);
  z-index: 1;
}

/* Active press feedback (per leitplanke: hover/active ok, ~150ms) */
.theme-toggle__btn:active:not([aria-pressed='true']) {
  background-color: var(--action-ghost-hover);
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle__btn {
    transition: none;
  }
}
