figure.wp-block-gallery.has-nested-images.is-style-galerie-01 {
    display: flex;
    flex-wrap: wrap;
}

figure.wp-block-gallery.has-nested-images.is-style-galerie-01 figure {
    width: 30%;
}

figure.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) {
    display: grid;
    gap: 8px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

figure.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) figure:nth-child(1n + 2), 
figure.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) figure:nth-child(2n + 3), 
figure.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) figure:nth-child(3n + 4)  {    
    aspect-ratio: 6/3.25;
    grid-column: span 2;
    object-fit: cover;
}

figure.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) figure:first-child,
figure.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) figure:nth-child(4n + 5) {    
    aspect-ratio: 1/1.1; 
    grid-column: span 2;
    grid-row: span 2;
    object-fit: cover;
}

.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) figure.wp-block-image img {
    max-width: unset !important;
}

figure.wp-block-gallery.has-nested-images.is-style-galerie-01 figure img {
    margin-bottom: 15px;
}

@media (min-width: 600px) {
    .wp-block-gallery.has-nested-images {
        gap: 10px;
    }
    .wp-block-gallery.has-nested-images.columns-3 figure.wp-block-image:not(#individual-image) {
        width: 30%;
    }
    .wp-block-gallery.has-nested-images.columns-2 figure.wp-block-image:not(#individual-image) {
        width: 49%;
    }
}

@media screen and (max-width: 600px) {
    figure.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) {
        display: inline-flex;
        flex-direction: row;
        width: 100%;
        max-width: none;
        padding-left: 3%;
        overflow-x: scroll;
        flex-wrap: nowrap;
        padding-right: 3%;
    }

    figure.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) figure, 
    figure.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) figure:first-child,
    figure.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) figure:nth-child(2n + 1), 
    figure.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) figure:nth-child(1n + 2), 
    figure.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) figure:nth-child(2n + 3), 
    figure.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) figure:nth-child(3n + 4),
    figure.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) figure:first-child,
    figure.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) figure:nth-child(4n + 5),
    figure.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) figure:nth-child(1n + 2), 
    figure.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) figure:nth-child(2n + 3), 
    figure.wp-block-gallery.has-nested-images:not(.is-style-galerie-01) figure:nth-child(3n + 4)
     {
        display: inline-flex;
        min-width: 300px;
        height: 400px;
        width: fit-content;
        aspect-ratio: initial;
        min-width: fit-content;
        max-width: unset;
    }

    .wp-block-gallery.has-nested-images.is-cropped:not(.is-style-galerie-01) figure.wp-block-image:not(#individual-image) a, 
    .wp-block-gallery.has-nested-images.is-cropped:not(.is-style-galerie-01) figure.wp-block-image:not(#individual-image) img {
        width: auto !important;
        max-width: auto !important;
    }

    .wp-block-gallery.has-nested-images:not(.is-style-galerie-01) figure.wp-block-image img {
        max-width: unset !important;
        margin-bottom: 15px;
    }

    figure.wp-block-gallery.has-nested-images.is-style-galerie-01 figure img {
        margin-bottom: 15px;
    }

}

