/* ============================================================
   SCROLL-TO-TOP / SCROLL-TO-BOTTOM BUTTONS
   Shared component — included on every page via page.njk.
   Web-only: hidden in print via @media print.
   ============================================================ */

.scroll-btn {
  position: fixed;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

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

/* Stacked bottom-right: bottom button lowest, top button above it */
.scroll-btn--bottom {
  bottom: 24px;
}

.scroll-btn--top {
  bottom: 76px;
}

/* Visible state — JS removes the [hidden] attr and adds this class */
.scroll-btn:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-btn:hover {
  background: var(--bg-card-hover);
  color: var(--primary);
  border-color: var(--primary-glow);
}

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

/* Web-only — hidden completely during print */
@media print {
  .scroll-btn {
    display: none !important;
  }
}

/* Reduced-motion: skip transitions */
@media (prefers-reduced-motion: reduce) {
  .scroll-btn {
    transition: none;
  }
}

/* Smaller on narrow screens */
@media (max-width: 600px) {
  .scroll-btn {
    width: 38px;
    height: 38px;
    right: 14px;
  }

  .scroll-btn svg {
    width: 16px;
    height: 16px;
  }

  .scroll-btn--bottom {
    bottom: 16px;
  }

  .scroll-btn--top {
    bottom: 62px;
  }
}
