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

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

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



    /*
        Figma reference — Homepage / "Catalogues", 1920px artboard.

            band .......... 1920 x 490, white, full bleed
            transitions ... 220 above and below, #ECEAE5 to #FFFFFF
            grid .......... four columns of 345 with 20 gaps = 1440
            column one .... icon 95 x 90, title ExtraBold 50, view all Bold 14
            columns 2-4 ... covers 345 x 490, filling the band's height
            hover ......... gold square 105 x 105 centred, eye 71 x 36 inside

        The white band runs edge to edge while its contents sit in the 1440
        column, so the section paints itself full width and centres a grid
        inside — it must not be placed in a panel.
    */

    .nvm-catalogues {
        position: relative;
    }

        /*
            The two 220px transitions are drawn as rectangles in the artboard.
            They belong to this section rather than to the ones around it, so
            they are its own pseudo elements: the block stays self contained
            and an editor never has to place anything between sections.
        */

        .nvm-catalogues::before,
        .nvm-catalogues::after {
            content: '';
            display: block;
            width: 100%;
            height: clamp( 80px, 11.46vw, 220px );
        }

        .nvm-catalogues::before {
            background: linear-gradient( to top, var(--nvm-color-white), var(--nvm-color-sand) );
        }

        .nvm-catalogues::after {
            background: linear-gradient( to bottom, var(--nvm-color-white), var(--nvm-color-sand) );
        }

        /*
            The transition is the gap, so whatever comes next must not add
            one of its own.

            The products carousel opens with padding-top: 110px, which is the
            rhythm every other section boundary on the page is set to. After
            this block it lands on top of a transition that is already 220 at
            1920 — measured on the home page, 330 against the 110 everywhere
            else, which reads as a double gap and was reported as one.

            The band below is the carousel's, not this block's, so the fix
            belongs here rather than in its stylesheet: it is this block's
            ::after that makes the padding redundant, and a rule written over
            there would have to name a neighbour it knows nothing about.

            :has() is the only way across. The sections are divs carrying
            nothing but `section` — there is no class to tell one from
            another — and they are immediate siblings, so the step from this
            one to the next is a sibling combinator and nothing wider. The
            selector cannot reach a carousel anywhere else on the page.
        */

        .section:has( .nvm-catalogues ) + .section .nvm-products-carousel {
            padding-top: 0;
        }

    .nvm-catalogues__band {
        background: var(--nvm-color-white);
    }

        /*
            Four equal columns and a 20 gap come to exactly 1440 at the drawn
            size, so the grid is expressed that way rather than in pixels and
            keeps its proportions at every width.
        */

        /*
            The padding alone does everything, and nothing else must join in.

            --nvm-content-inset is max( floor, (100vw - 1440) / 2 ), so once
            the screen is wide enough the padding IS the centring margin and
            leaves exactly 1440 between. Adding max-width and auto margins on
            top counted the same space twice: at 1680 it left 1200 instead of
            1440, and at 1440 the .large override removed the margin entirely
            and the grid touched both edges.

            This is how the products carousel and Shop the Look already do it.
        */

        .nvm-catalogues__grid {
            display: grid;
            grid-template-columns: repeat( 4, 1fr );
            gap: 20px;
            padding: 0 var(--nvm-content-inset);
        }



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

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

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



    .nvm-catalogues__intro {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 50px;
        align-self: center;
        padding: 40px 0;
    }

        .nvm-catalogues__icon img {
            display: block;
            width: auto;
            max-height: 90px;
        }

        /* The .nvm-catalogues prefix is needed: theme.typography.css styles
           `.responsiville h2` at one class plus one element, which outranks a
           lone class here. */

        .nvm-catalogues .nvm-catalogues__title {
            margin: 0;
            font-size: clamp( 28px, 2.6vw, 50px );
            font-weight: 800;
            line-height: 1.1;
            color: var(--nvm-color-ink);
        }

        /* The gap to the title is far tighter than the 50 above it. */

        .responsiville .nvm-catalogues__view-all {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            margin-top: -30px;
            padding: 0;
            background: none;
            color: var(--nvm-color-ink);
            font-size: 14px;
            font-weight: 700;
            line-height: 1.5;
            text-transform: uppercase;
            transition: opacity 0.2s ease-in-out;
        }

        .responsiville .nvm-catalogues__view-all:hover {
            background: none;
            opacity: 0.6;
        }



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

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

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



    /*
        The covers are 345 x 490 and fill the band's full height, so they meet
        its top and bottom edges. The ratio is held so an upload of the wrong
        shape is cropped rather than reshaping the band.
    */

    .responsiville .nvm-catalogues__cover {
        position: relative;
        display: block;
        padding: 0;
        background: var(--nvm-color-sand);
        overflow: hidden;
        aspect-ratio: 345 / 490;
    }

    .responsiville .nvm-catalogues__cover:hover {
        background: var(--nvm-color-sand);
        opacity: 1;
    }

        .responsiville .nvm-catalogues__cover-image {
            display: block;
            width: 100%;
            height: 100% !important;
            object-fit: cover;
            transition: transform 0.5s ease-in-out;
        }

        .nvm-catalogues__cover:hover .nvm-catalogues__cover-image {
            transform: scale(1.03);
        }

        /* The gold square with the eye, centred on the cover. */

        .nvm-catalogues__cover-hover {
            position: absolute;
            top: 50%;
            left: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 105px;
            height: 105px;
            margin: -52.5px 0 0 -52.5px;
            background: var(--nvm-color-gold);
            color: var(--nvm-color-ink);
            opacity: 0;
            transform: scale(0.9);
            transition: opacity 0.25s ease-in-out, transform 0.25s ease-in-out;
        }

        .nvm-catalogues__cover:hover .nvm-catalogues__cover-hover,
        .nvm-catalogues__cover:focus-visible .nvm-catalogues__cover-hover {
            opacity: 1;
            transform: scale(1);
        }

            .nvm-catalogues__cover-hover svg {
                display: block;
                width: 71px;
                height: 36px !important;
            }

    @media ( prefers-reduced-motion: reduce ) {

        .responsiville .nvm-catalogues__cover-image,
        .nvm-catalogues__cover:hover .nvm-catalogues__cover-image {
            transition: none;
            transform: none;
        }

    }



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

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

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



    /*
        No tablet or mobile artboard exists for this section. Four columns
        become two below `desktop` and one on a phone, with the title taking a
        row of its own — a 345 cover in a quarter of a phone screen would be
        unreadable.
    */

    /*
        Two covers a row everywhere below `desktop`.

        One per row turned the section into a very long scroll of very large
        pictures — a catalogue cover carries its title in the artwork, so it
        stays legible at half the width, and two a row lets a reader take in
        the set rather than meeting them one at a time.
    */

    .small .nvm-catalogues__grid,
    .tablet .nvm-catalogues__grid {
        grid-template-columns: repeat( 2, 1fr );
        gap: 15px;
    }

    .small .nvm-catalogues__grid {
        gap: 10px;
    }

    .small .nvm-catalogues__intro,
    .tablet .nvm-catalogues__intro {
        grid-column: 1 / -1;
        gap: 25px;
        padding: 30px 0;
    }

    .small .responsiville .nvm-catalogues__view-all,
    .tablet .responsiville .nvm-catalogues__view-all {
        margin-top: -12px;
    }

    .small .nvm-catalogues__icon img,
    .tablet .nvm-catalogues__icon img {
        max-height: 60px;
    }

    .small .nvm-catalogues__cover-hover,
    .tablet .nvm-catalogues__cover-hover {
        width: 72px;
        height: 72px;
        margin: -36px 0 0 -36px;
    }

        .small .nvm-catalogues__cover-hover svg,
        .tablet .nvm-catalogues__cover-hover svg {
            width: 48px;
            height: 24px !important;
        }

    .desktop .nvm-catalogues__grid {
        grid-template-columns: repeat( 4, 1fr );
        gap: 20px;
    }

    .desktop .nvm-catalogues__intro {
        grid-column: auto;
        gap: 50px;
        padding: 40px 0;
    }

    .desktop .responsiville .nvm-catalogues__view-all {
        margin-top: -30px;
    }

    .desktop .nvm-catalogues__icon img {
        max-height: 90px;
    }

    .desktop .nvm-catalogues__cover-hover {
        width: 105px;
        height: 105px;
        margin: -52.5px 0 0 -52.5px;
    }

        .desktop .nvm-catalogues__cover-hover svg {
            width: 71px;
            height: 36px !important;
        }



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

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

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



    /*
        The Catalogues archive — archive-catalogue.php.

        The same covers as the block on the home page, without the title cell
        that sits in its first column, and arranged as the CATALOGUES
        artboard has them. Read off the design: the grid is 1440 inside the
        content inset, the covers 345 by 490, the step across 365 and down
        560 — twenty between columns and seventy between rows — with the page
        numbers seventy under the last of them.

        auto-fit rather than a flat four, so the row keeps its shape on the
        way down to a phone without a rule at every breakpoint: the columns
        are as wide as they can be up to 345, and when two no longer fit the
        grid drops to one on its own.
    */

    .nvm-catalogues-page {
        padding: 70px var(--nvm-content-inset) clamp( 70px, 7.29vw, 140px );
    }

        /*
            Five across, and counted rather than fitted.

            This was auto-fit against the artboard's 345, which asks the
            browser how many covers of that width will go — and the answer
            was poor at every size but the widest. Measured: one cover on a
            768 tablet with 708 pixels of room beside it, two at 1024, three
            on the 1366 laptop the shop uses. The covers kept their drawn
            width and the page kept the space left over.

            The shop asked for five, so the row is told five. The number is
            what changes with the screen and the cover takes whatever a
            column gives it, which is what it was already built to do —
            width: 100% against a fixed aspect ratio, just below.

            Two on a phone and the tablet, four from the laptop, five
            from 1280 up — 237 wide on the 1366 laptop the shop uses, 252 at
            1440, 272 at 1920.

            Five does not go lower than that. Nothing breaks if it does:
            there is no caption under these cards, the name is printed on
            the cover itself. That is exactly why it stops — the only thing
            carrying the title is the artwork, and at the 169 a fifth column
            would leave at 1024 the words on the cover stop being readable.

            minmax( 0, 1fr ) rather than 1fr: a grid column's default
            minimum is its content, and a wide cover would otherwise push
            its column past its share and the row off centre.
        */

        /*
            The grid brings its own air when it stands in a page.

            The listing used to be a post type archive, and the template
            around it carried the spacing. Moved into an ordinary page — so
            that Polylang could give it an address in each language — that
            wrapper is gone, and the section it now sits in has no padding of
            its own: measured at 0 above and 0 below, against 82.5 on the
            contact and stores pages.

            The figures are the site's own. .nvm-contact__intro in
            theme.contact.css sets clamp( 40px, 5.73vw, 110px ), and the
            stores page reads the same, so a page that borrowed from the old
            archive instead — 70 and a 7.29vw bottom — came out a stranger
            next to them. Same clamp here, same rhythm.

            Written here rather than against a class on the section, because
            that class would have to be typed into the editor and would be
            gone the day somebody rebuilds the page. The grid cannot lose it.

            The child combinator keeps it out of the archive's way: there the
            grid sits straight inside .nvm-catalogues-page, which has padding
            already, and only in a page does it sit in a .column-content.
        */

        .column-content > .nvm-catalogues-page__grid {

            margin-top: clamp( 40px, 5.73vw, 110px );
            margin-bottom: clamp( 40px, 5.73vw, 110px );

            /*
                And it starts where the title starts.

                The row the shortcode sits in is a full width panel, so the
                only thing between the covers and the screen edge was the
                column's 10px gutter: measured at 1200, the first cover began
                at x=10 while the heading above it began at 50, and the grid
                hung 40px out to the left of its own title. The shop does not
                do that — its filters begin at 50, level with the heading.

                max-width and auto margins did the centring before, and they
                have to go for the padding to mean anything: at 1920 the two
                together would have indented the covers twice, once to centre
                a 1440 box and again inside it.

                The inset is the shop's, not the content column's, and the
                difference is visible: measured against the heading, the
                content inset lands 10px out at 1440 and 120 out at 1920,
                because the band over this page is a shop band and takes
                --nvm-shop-inset. The two are declared on the same breakpoint
                classes, so either is available anywhere; this page wants the
                one its own title uses.

                It is the pair .nvm-shop itself uses — clamp( 40px, 5.73vw,
                110px ) down the sides of the shop and this inset across —
                so the catalogues now sit on the same grid as the products.

                Less the gutter, because the column has already paid 10 of it.
            */

            max-width: none;
            margin-left: 0;
            margin-right: 0;
            padding-left: calc( var(--nvm-shop-inset) - var(--nvm-grid-gutter) );
            padding-right: calc( var(--nvm-shop-inset) - var(--nvm-grid-gutter) );

        }

        /*
            Two on a phone, not one.

            The shop asked for it, and it is what the home page block already
            does below `desktop`: a single column on a phone made the page a
            long scroll of very large covers. Two at 375 leaves each one about
            160 wide, the size the home page shows them at, and a closer gap
            keeps the pair reading as one row.
        */

        .nvm-catalogues-page__grid {
            display: grid;
            grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
            gap: 50px 20px;
            max-width: var(--nvm-panel-medium-width);
            margin: 0 auto;
        }

        .small .nvm-catalogues-page__grid {
            gap: 30px 10px;
        }

        .tablet .nvm-catalogues-page__grid {
            grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
        }

        .laptop .nvm-catalogues-page__grid {
            grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
        }

        .desktop .nvm-catalogues-page__grid {
            grid-template-columns: repeat( 5, minmax( 0, 1fr ) );
        }

        /*
            345 is still the ceiling, as it was under auto-fit.

            Counting the columns took the cap away with it, and the single
            column of a phone is the whole width: measured 480 wide against
            the 345 the cover is drawn at, half as big again as anywhere
            else on the site. A column may be narrower than the artboard —
            it is at every size from the laptop up — but never wider.

            Centred, so the one column of a phone sits in the middle of the
            page rather than against its left edge.
        */

        .nvm-catalogues-page__grid > * {
            width: 100%;
            max-width: 345px;
            margin-left: auto;
            margin-right: auto;
        }

        /*
            The covers are a fixed 345 wide in the design and the grid above
            will not give them more than that, but it will give them less —
            so the picture is told to fill whatever it is given and keep the
            A4 the artboard draws it at.
        */

        .nvm-catalogues-page__grid .nvm-catalogues__cover {
            width: 100%;
            aspect-ratio: 345 / 490;
        }

        .nvm-catalogues-page__pagination {
            display: flex;
            justify-content: center;
            margin-top: 70px;
        }

        .nvm-catalogues-page__empty {
            margin: 0;
            text-align: center;
        }
