.wp-block-gallery img {
  height: 300px;
  width: 100%;
  object-fit: cover;
}

/* NextGEN Gallery: force default-view galleries into a clean 3-column grid */
.ngg-galleryoverview.default-view {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 50px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* remove old float-based layout */
.ngg-galleryoverview.default-view .ngg-gallery-thumbnail-box {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* thumbnail wrapper */
.ngg-galleryoverview.default-view .ngg-gallery-thumbnail {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    background: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

/* make the link fill the box */
.ngg-galleryoverview.default-view .ngg-gallery-thumbnail a {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #282220 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* show full image without cropping */
.ngg-galleryoverview.default-view .ngg-gallery-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
    margin: 0 !important;
    max-width: none !important;
    max-height: none !important;
}

/* kill plugin clear break */
.ngg-galleryoverview.default-view > br {
    display: none !important;
}

/* responsive */
@media (max-width: 1024px) {
    .ngg-galleryoverview.default-view {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    .ngg-galleryoverview.default-view {
        grid-template-columns: 1fr !important;
    }
}