/* Light/dark switch in the header (partials/theme-toggle.ejs, public/js/theme.js). Shows the moon
   in light mode (switch to dark) and the sun in dark mode. */

.theme-toggle {
  display: inline-grid;
  width: 2.125rem;
  height: 2.125rem;
  padding: 0;
  flex: none;
  color: var(--color-ink-soft);
  cursor: pointer;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md, 7px);
  place-items: center;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--color-brand-text);
  background: var(--color-surface-soft);
  border-color: var(--color-line-strong);
}

.theme-toggle:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring, 0 0 0 3px rgb(20 125 112 / 28%));
}

.theme-toggle__icon {
  display: inline-flex;
  width: 1.05rem;
  height: 1.05rem;
}

.theme-toggle__icon svg {
  width: 100%;
  height: 100%;
}

.theme-toggle__icon--sun,
[data-bs-theme="dark"] .theme-toggle__icon--moon {
  display: none;
}

[data-bs-theme="dark"] .theme-toggle__icon--sun {
  display: inline-flex;
}

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

@media print {
  .theme-toggle {
    display: none;
  }
}
