/*********************************************************************

    ███████╗ ██████╗██████╗  ██████╗ ██╗     ██╗         ████████╗ ██████╗ ██████╗
    ██╔════╝██╔════╝██╔══██╗██╔═══██╗██║     ██║         ╚══██╔══╝██╔═══██╗██╔══██╗
    ███████╗██║     ██████╔╝██║   ██║██║     ██║            ██║   ██║   ██║██████╔╝
    ╚════██║██║     ██╔══██╗██║   ██║██║     ██║            ██║   ██║   ██║██╔═══╝
    ███████║╚██████╗██║  ██║╚██████╔╝███████╗███████╗       ██║   ╚██████╔╝██║
    ╚══════╝ ╚═════╝╚═╝  ╚═╝ ╚═════╝ ╚══════╝╚══════╝       ╚═╝    ╚═════╝ ╚═╝

 *********************************************************************/



    /*
        The left corner, because the right one is taken. Side Cart WooCommerce
        keeps its basket there, and stacking this above it was tried first:
        two controls in a column, the top one always a little in the way.

        The numbers are the basket's own, mirrored. The plugin writes
        `bottom: 12px; right: 1px` into the page and its stylesheet adds
        `margin: 10px`, so the basket is a 64 x 64 circle 22px up from the
        bottom and 11px in from its edge. The same two figures on this side
        put the two at the same height, one at each end of the window.

        It keeps the basket's treatment as well — same 64, same circle, same
        soft shadow — so that the pair reads as one set even across the width
        of the page. Gold is here as the hover rather than the fill: a solid
        gold square was tried and, against the basket, looked like a brick.

        The z-index is deliberately low, and 150 is picked from the four
        things that could cover this button or be covered by it. The search
        panel is a full window sheet at 200 and the cookie banner sits at
        9000; both must come over the top of it. The side cart's dimmer is at
        999996 and its basket at 9999997, so opening the cart covers this the
        way it covers the rest of the page. That leaves the header at 100,
        which this clears.
    */

    .nvm-scroll-top {
        position: fixed;
        left: 11px;
        bottom: 22px;
        z-index: 150;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 64px;
        height: 64px;
        padding: 0;
        border: none;
        background: var(--nvm-color-white);
        color: var(--nvm-color-ink);
        border-radius: 50%;
        box-shadow: 0 0 15px 2px rgba( var(--nvm-black), 0.1 );
        cursor: pointer;

        /*
            Hidden, but not with display: none — the button has to be able to
            fade. visibility is what takes it out of the tab order while it is
            invisible, and its transition is delayed until the fade has
            finished so it does not disappear mid-way.
        */
        opacity: 0;
        visibility: hidden;
        transform: translateY( 8px );
        transition: opacity 0.25s ease-in-out,
                    transform 0.25s ease-in-out,
                    visibility 0s 0.25s;
    }

    .nvm-scroll-top.is-visible {
        opacity: 1;
        visibility: visible;
        transform: translateY( 0 );
        transition: opacity 0.25s ease-in-out,
                    transform 0.25s ease-in-out,
                    visibility 0s 0s;
    }

    /*
        Both colours have to be restated whatever they are, because
        responsiville.moressette.css paints every button grey on hover, text
        and background alike, and would otherwise take this one with it.

        Gold is the accent the rest of the site uses, and it is the colour of
        the basket's own counter sitting just below. The arrow stays ink
        rather than turning white: white on this gold is 2.8:1, under the 3:1
        a graphic needs to stay legible, and ink on it is 5.8:1.
    */

    .nvm-scroll-top:hover,
    .nvm-scroll-top:focus-visible {
        background: var(--nvm-color-gold);
        color: var(--nvm-color-ink);
    }

    /*
        Focus holds the button in place. Without this a keyboard user who
        reaches the top is left holding a control the page has just hidden,
        and the browser drops their place in the document.

        The outline is here because moressette removes it from every button.
    */

    .nvm-scroll-top:focus-visible {
        visibility: visible;
        transform: translateY( 0 );
        outline: 2px solid var(--nvm-color-ink);
        outline-offset: 2px;
    }

        .nvm-scroll-top svg {
            display: block;
            width: 26px;
        }
