/* ProspectIQ light/dark switch button (every page). The themes themselves are the token blocks in
   /static/styles.css; /static/js/theme.js sets html[data-theme] and wires [data-theme-toggle]. */

.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.theme-toggle:hover {
  background: var(--surface-2);
  border-color: var(--border-hover);
  color: var(--text);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-icon {
  display: block;
  width: 18px;
  height: 18px;
}

/* The icon shows what a click does: the moon in light mode, the sun in dark mode. */
.theme-icon--sun,
:root[data-theme="dark"] .theme-icon--moon {
  display: none;
}

:root[data-theme="dark"] .theme-icon--sun {
  display: block;
}

/* Login page: no header, so the switch sits in the top-right corner. */
.theme-toggle--corner {
  position: absolute;
  top: 12px;
  right: 16px;
}

/* Main app header: keep the switch next to the user menu when the header wraps. */
@media (max-width: 720px) {
  .app-header-inner > .theme-toggle {
    order: 2;
  }
}

@media (forced-colors: active) {
  .theme-toggle {
    border-color: ButtonText;
  }
}
