﻿/* ==========================================================================
   Flytande "tillbaka till toppen"-knapp, nere till höger.
   Dold som standard, visas via .is-visible (satt av back-to-top.js när man
   scrollat förbi en tröskel).
   ========================================================================== */

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: var(--color-text);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 240ms ease, transform 240ms ease, visibility 240ms;
}

    .back-to-top.is-visible {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .back-to-top:hover {
        opacity: 0.85;
    }

@media (max-width: 600px) {
    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 44px;
        height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top {
        transition: opacity 240ms ease, visibility 240ms;
        transform: none;
    }
}
