/* The original dark palette stays in fighter-theme.css and fighter-v3.css. */
:root[data-theme="light"] { color-scheme: light; }

.fighter-theme-toggle {
  display: none;
  visibility: hidden;
  flex: 0 0 2.75rem;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 1px solid #74747d;
  background: transparent;
  color: #f4f2ed;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fighter-theme-js .fighter-theme-toggle { display: inline-flex; }
.fighter-theme-toggle[data-theme-ready="true"] { visibility: visible; }
.fighter-theme-toggle:hover { border-color: #f4f2ed; background-color: #25252d; }
.fighter-theme-toggle:active { background-color: #34343d; }
.fighter-theme-toggle:focus-visible { outline: 3px solid #f4f2ed; outline-offset: 3px; }
.fighter-theme-toggle:disabled { color: #a5a5aa; cursor: default; }

.fighter-theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.fighter-theme-toggle__moon { display: none; }
:root[data-theme="dark"] .fighter-theme-toggle__sun { display: none; }
:root[data-theme="dark"] .fighter-theme-toggle__moon { display: block; }
:root[data-theme="light"] .fighter-theme-toggle {
  border-color: #818b98;
  background-color: var(--site-surface, #fff);
  color: var(--site-text, #191b1f);
}
:root[data-theme="light"] .fighter-theme-toggle:hover,
:root[data-theme="light"] .fighter-theme-toggle:active {
  border-color: var(--site-accent, #b71f31);
  background-color: var(--site-surface-alt, #eaedf1);
}
:root[data-theme="light"] .fighter-theme-toggle:focus-visible {
  outline-color: var(--site-accent, #b71f31);
}

/* Only animate palette properties while switching, leaving normal effects alone. */
:root.fighter-theme-changing .fighter-premium-site,
:root.fighter-theme-changing .fighter-premium-site :where(section, article, div, nav, header, footer, p, a, button, input, select, textarea, dl, dt, dd, h1, h2, h3, h4, table, tr, th, td, label, summary, li, span) {
  transition-property: color, background-color, border-color, box-shadow;
  transition-duration: 220ms;
  transition-timing-function: ease;
}

@media (max-width: 430px) {
  /* Reserve a touch target without shrinking the existing logo or menu text. */
  .fighter-theme-js .fighter-premium-site .fighter-site-header__inner {
    gap: 0.5rem !important;
  }
}

@media (max-width: 374px) {
  /* The logo already links home; free its duplicate link's space on narrow phones. */
  .fighter-theme-js .fighter-premium-site .fighter-main-menu > a:first-child:not(:last-child) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root.fighter-theme-changing .fighter-premium-site,
  :root.fighter-theme-changing .fighter-premium-site * {
    transition-duration: 0s;
  }
}
