/**
 * Alf Theme — Scroll-to-Top Button
 *
 * Fixed circular button, bottom-right, red-gradient fill with a beige
 * arrow + "TOP" label. A ring around the button fills in beige to show
 * how far down the page the user has scrolled. Hidden until the user
 * scrolls past a threshold (see assets/js/scroll-top.js).
 *
 * @package AlfTheme
 */

.scroll-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Progress ring — tracks scroll position around the button */
.scroll-top__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.scroll-top__ring-track,
.scroll-top__ring-progress {
  fill: none;
  stroke-width: 3;
}

.scroll-top__ring-track {
  stroke: rgba(240, 240, 227, 0.25);
}

.scroll-top__ring-progress {
  stroke: var(--color-bg, #f8faf0);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear;
}

/* Button face — red gradient circle, beige arrow + label */
.scroll-top__face {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary, #cd261d) 0%, var(--color-primary-dark, #a41c16) 100%);
  color: var(--color-bg, #f8faf0);
  box-shadow: 0 4px 14px rgba(12, 12, 12, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.scroll-top:hover .scroll-top__face,
.scroll-top:focus-visible .scroll-top__face {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(12, 12, 12, 0.32);
}

.scroll-top:focus-visible {
  outline: 2px solid var(--color-primary-dark, #a41c16);
  outline-offset: 4px;
  border-radius: 50%;
}

.scroll-top__arrow {
  width: 14px;
  height: 14px;
}

.scroll-top__label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: normal;
}

@media (max-width: 767px) {
  .scroll-top {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
  }

  .scroll-top__face {
    width: 46px;
    height: 46px;
  }

  .scroll-top__label {
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {

  .scroll-top,
  .scroll-top__face {
    transition: none;
  }
}