/* Galleries */

/* Lightbox Gallery Captions */
.lg-outer .custom-caption {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent black background */
    color: #fff;
    text-align: center;
}

.lg-outer.lg-components-open:not(.lg-zoomed) .lg-sub-html {
    font-weight: bold;
    font-family: var(--font-headings);
    font-size: 24px;
}

.wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
    font-size: 15px;
    font-weight: bold;
    line-height: 1.1;
    font-family: var(--font-headings);
    text-transform: uppercase;
}

/* Ensure gallery items display in a grid */
.wp-block-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5em; /* Adjusts spacing between items */
}

.wp-block-gallery .gallery-item {
    width: calc(33.33% - 1.5em); /* For a 3-column layout */
    margin: 0;
}

/* Force images to fully cover the gallery-item box */
.wp-block-gallery .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 768px) {
    .wp-block-gallery .gallery-item {
        width: calc(50% - 1.5em); /* 2-column layout on smaller screens */
    }
}

@media (max-width: 480px) {
    .wp-block-gallery .gallery-item {
        width: 100%; /* 1-column layout on very small screens */
    }
}