.container-offers-grid {
    container-type: inline-size;
    container-name: offers-grid;
    & .kmg.offers-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 30px;
        @container offers-grid (width >= 767px) {
            grid-template-columns: 1fr 1fr;
        }
        @container offers-grid (width >= 991px) {
            grid-template-columns: repeat(6, 1fr);
        }
        /* @container offers-grid (width >= 1024px) {
            grid-template-columns: 1fr 1fr 1fr 1fr;
        } */
        & .item {
            @container offers-grid (width >= 991px) {
                grid-column: span 2;
            }
            background: white;
            & .image-wrapper {
                width: 100%;
                aspect-ratio: 1/1;
                position: relative;
                & img {
                    position: absolute;
                    inset: 0;
                    object-fit: cover;
                    width: 100%;
                    height: 100%;
                }
            }
            & .content {
                padding: 0 30px 30px 30px;
                position: relative;
                float: left;
                width: 100%;
                & .title {
                    margin: 1.5em 0 .5em;
                }
                &>*:not(.title) {
                    position:relative;
                    float: left;
                    width: 100%;
                    margin-bottom: 13px;
                }
                & .read-more {
                    background: white;
                    border: 1px solid black;
                    box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
                    color: black;
                    font-style: normal;
                    font-weight: 500;
                    font-size: 15px;
                    text-transform: uppercase;
                    text-decoration: none;
                    border-radius: 0px;
                    padding: 10px 24px 10px 24px;
                    width: auto;
                    margin-top: 4px;
                    &:hover {
                        border: 1px solid black;
                        background: black;
                        color: white;
                    }
                }
            }   
            /* Dealing with 2 orphan items */
            &:last-child:nth-child(3n - 1) {
                @container offers-grid (width >= 991px) {
                    grid-column-end: -2;
                    grid-column: span 3;
                }
            }
            &:nth-last-child(2):nth-child(3n + 1) {
                @container offers-grid (width >= 991px) {
                    grid-column-end: 4;
                    grid-column: span 3;
                }
            }  
            /* Dealing with single orphan */
            &:last-child:nth-child(3n - 2) {
                
                @container offers-grid (width >= 991px) {
                    grid-column-end: 5;
                    grid-column: span 6;
                    display: grid;
                    grid-template-columns: 1fr 1fr;
                    align-items: center;
                }
            }
            &:last-child:nth-child(2n - 1) { 
                @container offers-grid (991px > width >= 767px) {
                    grid-column: span 2;
                    display: grid;
                    grid-template-columns: 1fr 1fr;
                    align-items: center;
                }
            }
        }
    }
}





.acf-block-preview .kmg.offers-grid {
    float: none;
}

.acf-block-preview .kmg.offers-grid a {
    pointer-events: none;
}
