.custom-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 0 auto;
    padding: 0 16px;
    max-width: 1200px;
}

.gallery-item {
    aspect-ratio: 3 / 4;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f3f3f3;
}

.gallery-thumb-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.gallery-item img,
.gallery-item video,
.gallery-thumb-wrapper img,
.gallery-thumb-wrapper video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
    -o-object-fit: cover;
    -o-object-position: center;
    display: block;
}

.gallery-link {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* RESPONSIVE: Reduce columns on smaller screens */
@media (max-width: 992px) {
    .custom-gallery-grid {
        /* grid-template-columns: repeat(3, 1fr); */
        gap: 10px;
        padding: 0 12px;
    }
}

@media (max-width: 600px) {
    .custom-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        padding: 0 8px;
    }
}

.img_filter {
    /* filter: brightness(80%) contrast(200%); */
    filter: brightness(80%);
}

.align-left {
    margin-right: auto;
}

.align-right {
    margin-left: auto;
}


/* Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-thumb-wrapper:hover .gallery-overlay {
    opacity: 1;
}

.overlay-icon {
    font-size: 32px;
    color: #000;
    user-select: none;
    pointer-events: none;
}

.play-icon {
    font-size: 32px;
    color: #000;
    background: #fff;
    border-radius: 12px;
    padding: 3px 14px 3px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.image-icon {
    color: #000;
    background: #fff;
    border-radius: 12px;
    padding: 10px 12px 3px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* end Overlay styles */

/* Badge styles */
.gallery-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    gap: 6px;
    width: calc(100% - 16px);
    display: flex;
    justify-content: space-between;
    z-index: 2;
}

.gallery-badge {
    background-color: rgba(255, 255, 255, 0.9);
    color: #000;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.video-badge {
    background-color: rgba(255, 255, 255, 0.9);
    color: #000;
    font-size: 12px;
    padding: 2px 2px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: end;
    z-index: 10;
}

/* end Badge styles */


/* Fancy box */
.fancybox__nav {
    display: flex !important;
}

/* end Fancy box */

/* Homepage, Gallery section styles */
.gallery_shortcode_home .custom-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 0 0px;
}

.gallery_shortcode_home .gallery-item {
    aspect-ratio: 4/3;
}

@media (max-width: 600px) {
    .gallery_shortcode_home .custom-gallery-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 30px 0px;
        padding: 0 0px;
    }

    .gallery_shortcode_home .gallery-item {
        aspect-ratio: 5/3;
        border-radius: 24px;
    }
}

/* end Homepage, Gallery section styles */