/*
    Block: Before & After Grid Preview
    Note: Selectors must start with .block-before-after-grid
*/

@layer blocks {
    .block-before-after-grid .text-content {
        max-width: 54rem;
        margin-inline: auto;
    }

    .block-before-after-grid .text-content > :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) {
        max-width: 90%;
        margin-inline: auto;
    }

    .block-before-after-grid .grid-wrapper {
        display: grid;
        grid-template-columns: repeat(4,1fr);
        gap: 3.125rem 1.25rem;
        padding-top: 4.375rem;
        z-index: 1;
    }

    .block-before-after-grid .buttons {
        position: relative;
        z-index: 3;
    }

    .block-before-after-grid .buttons::before {
        content:'';
        position: absolute;
        bottom: 6.25rem;
        left: 50%;
        transform: translateX(-50%);
        width: var(--page-size);
        height: 300px;
        background: linear-gradient(180deg, rgba(246, 246, 245, 0) 0%, #F6F6F5 100%);
        z-index: -1;
        pointer-events: none;
    }

    .block-before-after-grid .buttons::after {
        content:'';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: var(--page-size);
        height: 6.25rem;
        background: var(--c-grey-beige);
        z-index: -1;
        pointer-events: none;
    }

    @media screen and (width <= 1024px) {
        .block-before-after-grid .grid-wrapper {
            grid-template-columns: repeat(3,1fr);
        }
        .block-before-after-grid .text-content {
            max-width: 85%;
        }
    }

    @media screen and (width <= 620px) {
        .block-before-after-grid .text-content {
            max-width: 100%;
        }
        .block-before-after-grid .grid-wrapper {
            grid-template-columns: repeat(2,1fr);
            gap: 1.875rem 0.625rem;
        }

        .block-before-after-grid .grid-wrapper > :nth-child(n + 11) {
            display: none;
        }
        
    }
}
