/* ============================================================================================================
   Room above the floating "back to top" button (it is 50px tall and floats 30px above the bottom edge, 80px on phones; main.js
   injects it once the page is scrolled). The browser scrolls a link or field focused with Tab to the bottom edge of the screen,
   which is right under the button. A scroll padding keeps it clear above it.
   ============================================================================================================ */
html {
    scroll-padding-bottom: 96px;
}

@media (max-width: 767.98px) {
    html {
        scroll-padding-bottom: 144px;
    }
}

/* ============================================================================================================
   Room under the footer for the floating "back to top" button.

   The button (injected by main.js) is 50px tall and floats 30px (80px on phones) above the bottom edge. At the very end of
   the page nothing can scroll out from under it, so it sat on the last words of the footer's bottom row ("Powered by ...",
   the copyright line). Empty room under the footer lets that row scroll clear of it. Nothing else moves.
   ============================================================================================================ */
.sfc-wrap {
    padding-bottom: 64px;
}

/* ============================================================================================================
   Room under the cookie notice.

   The notice (injected by main.js on a first visit) is a fixed bar over the bottom of the screen. While it shows,
   main.js puts html.cookie-banner-open on the page and sets --cookie-banner-h to the bar's height. The page then gets
   that much empty room at its end, so the last row of the footer (policy links, "Powered by") can be scrolled out from
   under the bar and clicked, and the browser keeps a link focused with Tab clear of it. Nothing changes once the notice
   has been accepted.
   ============================================================================================================ */
html.cookie-banner-open {
    scroll-padding-bottom: calc(var(--cookie-banner-h, 0px) + 74px);   /* the notice, and the lifted back-to-top button above it */
}

html.cookie-banner-open body::after {
    content: "";
    display: block;
    height: var(--cookie-banner-h, 0px);
}

/* The floating "back to top" button sits at bottom: 30px (inline style), i.e. right behind the notice. */
html.cookie-banner-open .back-to-top {
    bottom: calc(var(--cookie-banner-h, 0px) + 16px) !important;
}
