/* Floating buttons on every page: WhatsApp (all screens) and, on phones, up/down (js/navigation.js).
   WhatsApp is a plain link to wa.me: nothing loads and nothing is sent to WhatsApp until it is tapped,
   so it needs no cookie consent. */
.whatsapp-float {
    position: fixed;
    right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    z-index: 999; /* below the cookie banner (1040) */
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    transition: transform 0.2s ease;
}

.whatsapp-float .fa {
    font-size: 32px;
    line-height: 1;
}

.whatsapp-float:hover,
.whatsapp-float:focus {
    color: #fff;
    text-decoration: none;
    transform: scale(1.06);
}

.whatsapp-float:focus-visible {
    outline: 3px solid #016e75;
    outline-offset: 3px;
}

@media (max-width: 767px) {
    .whatsapp-float {
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        width: 52px;
        height: 52px;
    }

    .whatsapp-float .fa {
        font-size: 30px;
    }
}

/* Up/down buttons: phones only, at the middle of the right edge (well away from WhatsApp), in the site's
   button colours.
   js/navigation.js adds .is-visible: "up" after 300px of scrolling, "down" until the end of the page. */
.scroll-btn {
    display: none;
}

@media (max-width: 767px) {
    .scroll-btn {
        position: fixed;
        right: calc(8px + env(safe-area-inset-right, 0px));
        z-index: 999;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 2px solid #fff;
        border-radius: 50%;
        background: #054d4c;
        color: #fff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        opacity: 0;
        visibility: hidden;
        transform: translateX(8px);
        transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
    }

    .scroll-btn.is-visible {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .scroll-btn .fa {
        font-size: 18px;
        line-height: 1;
    }

    .scroll-btn:hover {
        background: #016e75;
    }

    .scroll-btn:focus-visible {
        outline: 3px solid #fcc6ac;
        outline-offset: 2px;
    }

    /* 44px buttons with a 12px gap, centred on the middle of the screen */
    .scroll-btn-up {
        top: calc(50% - 50px);
    }

    .scroll-btn-down {
        top: calc(50% + 6px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .whatsapp-float,
    .scroll-btn {
        transition: none;
    }
}

@media print {
    .whatsapp-float,
    .scroll-btn {
        display: none;
    }
}
