/* ============================================================================
   Scroll-to-Top Button — Styles

   Floating button that appears after scrolling 300px down.
   Positioned bottom-right, below the keyboard shortcuts button (z-index 900).
   ============================================================================ */

/* ── Button ─────────────────────────────────────────────────────────────── */

.stt-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 800;
  width: var(--touch-min, 2.75rem);
  height: var(--touch-min, 2.75rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: var(--radius-full, 9999px);
  background: var(--primary);
  color: var(--primary-on);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

/* When visible */
.stt-btn.stt-visible {
  opacity: 0.75;
  visibility: visible;
  transform: translateY(0);
}

/* Hover — fully opaque */
.stt-btn.stt-visible:hover {
  opacity: 1;
}

/* Focus-visible ring */
.stt-btn:focus-visible {
  outline: 2px solid var(--focus-ring, rgba(255, 138, 91, 0.6));
  outline-offset: 2px;
  opacity: 1;
}

/* Shift right when keyboard shortcuts button exists (practice pages) */
.stt-btn.stt-has-shortcuts {
  right: 5rem;
}

/* ── Icon ───────────────────────────────────────────────────────────────── */

.stt-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .stt-btn {
    bottom: 1rem;
    right: 1rem;
  }

  .stt-btn.stt-has-shortcuts {
    right: 4rem;
  }
}

@media (max-width: 640px) {
  .stt-btn.stt-has-shortcuts {
    right: 3.5rem;
  }
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .stt-btn {
    transition-duration: 0.01ms !important;
  }
}

/* ── Print ──────────────────────────────────────────────────────────────── */

@media print {
  .stt-btn {
    display: none !important;
  }
}
