/* High-contrast Folio theme toggle + sliding indicator */

[data-theme-toggle] {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0.2rem !important;
  border-radius: 9999px;
  cursor: pointer;
  /* Kill faint ring-border from dump markup */
  --tw-ring-shadow: 0 0 #0000 !important;
  --tw-ring-color: transparent !important;
  box-shadow: none !important;
  border: 1.5px solid #737373 !important;
  background: #d4d4d4 !important;
  transition: background-color 0.28s ease, border-color 0.28s ease;
}

.dark [data-theme-toggle] {
  border-color: #a3a3a3 !important;
  background: #2a2a2a !important;
}

/* Sliding white indicator — animates left ↔ right */
[data-theme-toggle] > [data-sliding-theme-pill] {
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 9999px;
  z-index: 0;
  pointer-events: none;
  background: #ffffff !important;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(0, 0, 0, 0.14);
  transform: translateX(0);
  transition: transform 0.32s cubic-bezier(0.34, 1.2, 0.64, 1);
  will-change: transform;
}

[data-theme-toggle][data-theme-state="dark"] > [data-sliding-theme-pill] {
  transform: translateX(1.625rem);
}

.dark [data-theme-toggle] > [data-sliding-theme-pill] {
  background: #f4f4f5 !important;
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.22);
}

/* Hide old dump pills (absolute accent divs inside buttons) */
[data-theme-toggle] > button > div.absolute {
  display: none !important;
}

[data-theme-toggle] > button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 9999px;
  padding: 0.3rem;
  color: #404040 !important;
  background: transparent !important;
  border: 0;
  cursor: pointer;
  pointer-events: none; /* whole toggle handles click */
  transition: color 0.22s ease;
}

.dark [data-theme-toggle] > button {
  color: #e5e5e5 !important;
}

[data-theme-toggle] > button svg {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
  stroke-width: 2.25;
  transition: color 0.22s ease;
}

/* Active icon sits on white pill → near-black */
[data-theme-toggle] > button[data-active="true"] {
  color: #0a0a0a !important;
}

.dark [data-theme-toggle] > button[data-active="true"] {
  color: #0a0a0a !important;
}

@media (prefers-reduced-motion: reduce) {
  [data-theme-toggle] > [data-sliding-theme-pill],
  [data-theme-toggle] > button,
  [data-theme-toggle] {
    transition: none !important;
  }
}
