/* Theme Toggle — Single icon button (sun ↔ moon) */

.theme-toggle-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  cursor: pointer;
  margin-left: 16px;
  transition: opacity 200ms ease;
  padding: 0;
  opacity: 0.45;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle-btn:hover {
  opacity: 1;
}

.theme-toggle-btn:focus-visible {
  outline: 2px solid var(--color-action-primary, #C5A55A);
  outline-offset: 2px;
}

.theme-toggle-btn:active {
  transform: scale(0.92);
}

/* Icon container */
.theme-toggle-btn .icon-sun,
.theme-toggle-btn .icon-moon {
  position: absolute;
  width: 16px;
  height: 16px;
  transition: opacity 300ms ease, transform 300ms ease;
}

/* SVG icon styling */
.theme-toggle-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Light mode: show moon (click to go dark) */
.theme-toggle-btn {
  color: var(--color-text-secondary, #6B7B8D);
}

/* Dark mode adjustments */
html[data-theme="dark"] .theme-toggle-btn {
  color: var(--brand-gold, #C5A55A);
}

html[data-theme="dark"] .theme-toggle-btn:hover {
  opacity: 1;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .theme-toggle-btn {
    width: 36px;
    height: 36px;
    margin: 12px auto 4px;
    opacity: 0.6;
  }

  .theme-toggle-btn .icon-sun,
  .theme-toggle-btn .icon-moon {
    width: 18px;
    height: 18px;
  }

  .theme-toggle-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .theme-toggle-btn,
  .theme-toggle-btn .icon-sun,
  .theme-toggle-btn .icon-moon {
    transition-duration: 0.01ms !important;
  }

  .theme-toggle-btn:active {
    transform: none;
  }
}

/* High contrast */
@media (prefers-contrast: more) {
  .theme-toggle-btn:focus-visible {
    outline-width: 3px;
  }
}

/* Print */
@media print {
  .theme-toggle-btn {
    display: none;
  }
}
