/*
* theme-switch.css
* The light / dark / system switch (_theme_switch.erb), fixed to the top right corner of
* every page. Loaded by _theme_assets.erb.
*/

:root {
  --theme-switch-inset: 1rem;
  --theme-switch-width: 6rem;
}

.theme-switch {
  position: fixed;
  top: var(--theme-switch-inset);
  right: var(--theme-switch-inset);
  z-index: 1040; /* above Bootstrap's fixed navbar (1030), below modals (1050+) */
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background-color: var(--card-bg);
  box-shadow: var(--box-shadow);
}

/* In the signed-in account menu: in place, no floating shadow */
.theme-switch.theme-switch-inline {
  position: static;
  box-shadow: none;
}

.theme-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  transition: none;
}

/* Animate clicks only, not the first state set on page load */
.theme-switch.is-ready button {
  transition: background-color 0.15s ease, color 0.15s ease;
}

.theme-switch button:hover {
  color: var(--text-color);
}

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

.theme-switch button[aria-pressed="true"] {
  background-color: var(--toggle-active-bg);
  color: var(--toggle-active-text);
}

.theme-switch svg {
  width: 16px;
  height: 16px;
}
