/**
 * Shared base of the full-width category pages ("category-full-width", display mode "static block only":
 * brands DBMK 34, B&Z 48, Fred Allard 50, Montblanc 51; content pages Atelier 62, Magazine 63, Pre-Owned 64,
 * Partnerringe 65) and of the CMS page Service ("cms-full-width"). Loaded only via their layout handles, before the
 * page's own CSS. The layout handles take the .container off category.view.container, so rows span the viewport.
 */

:is(.page-layout-category-full-width, .cms-service) {
    --kz-gutter: 1.5rem;
    --kz-light: #f4f1ea;
    --kz-page: 100%; /* max-width of the theme .container per breakpoint (below) */
    /* inline padding that lines full-width row text up with the contained rows (% = row width) */
    --kz-edge: max(var(--kz-gutter), (100% - var(--kz-page)) / 2 + var(--kz-gutter));

    /* Vertical rhythm: last band directly on the footer. The space above the title comes from the theme
       (page-layout.css: .page-main margin-top), so CMS pages, where #maincontent holds the title, keep their top margin. */
    & .category-view > .page-main {
        margin-block: 0;
    }

    & #maincontent {
        margin-bottom: 0;

        & .columns {
            row-gap: 0; /* empty sidebar-additional (compare/wishlist) row on desktop */
        }
    }
}

.page-layout-category-full-width {
    /* H1 as a Page Builder heading in the block (Atelier, Magazine: category title removed in the layout handle):
       the title wrapper stays empty and keeps only the space above */
    & .page-wrapper > .page-main:not(:has(.page-title)) {
        margin-bottom: 0;
    }

    /* "Static block only" leaves #maincontent empty: no space between the last band and the footer */
    & .category-view ~ #maincontent {
        margin-top: 0;
    }
}

/* Native Page Builder parallax (jarallax) stays still for reduced motion */
@media (prefers-reduced-motion: reduce) {
    :is(.page-layout-category-full-width, .cms-service) [id^="jarallax-container"] > * {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        transform: none !important;
        background-size: cover !important;
        background-position: center !important;
    }
}

/* theme .container max-widths (Tailwind breakpoints) */
@media (min-width: 40rem) {
    :is(.page-layout-category-full-width, .cms-service) {
        --kz-page: 40rem;
    }
}

@media (min-width: 48rem) {
    :is(.page-layout-category-full-width, .cms-service) {
        --kz-page: 48rem;
    }
}

@media (min-width: 64rem) {
    :is(.page-layout-category-full-width, .cms-service) {
        --kz-page: 64rem;
    }
}

@media (min-width: 80rem) {
    :is(.page-layout-category-full-width, .cms-service) {
        --kz-page: 80rem;
    }
}

@media (min-width: 96rem) {
    :is(.page-layout-category-full-width, .cms-service) {
        --kz-page: 96rem;
    }
}
