/* Scroll helpers — top progress bar + back-to-top button.
   Enqueued site-wide via scrimpr_enqueue_assets() in functions.php. */

/* ----- Top scroll progress bar -------------------------------------- */
.scrimpr-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--scrimpr-primary, #2C5282);
    z-index: 9999;
    transition: width 0.05s linear;
    pointer-events: none;
    will-change: width;
}

/* ----- Back-to-top button ------------------------------------------ */
.scrimpr-back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: var(--scrimpr-primary, #2C5282);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 9998;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
}

.scrimpr-back-to-top svg {
    width: 20px;
    height: 20px;
    display: block;
}

.scrimpr-back-to-top:hover,
.scrimpr-back-to-top:focus {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    outline: none;
}

.scrimpr-back-to-top:focus-visible {
    outline: 2px solid var(--scrimpr-primary, #2C5282);
    outline-offset: 2px;
}

.scrimpr-back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Honour reduced motion: turn off transitions but keep the visibility toggle */
@media (prefers-reduced-motion: reduce) {
    .scrimpr-scroll-progress,
    .scrimpr-back-to-top {
        transition: none;
    }
}

/* Mobile: keep clear of the bottom edge / any sticky bar at the bottom */
@media (max-width: 600px) {
    .scrimpr-back-to-top {
        bottom: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
}
