/* Main Gallery Styles */
.custom-gallery {
    display: grid;
    width: 100%;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.gallery-item img {
    width: 100%;
    height: 100% !important;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item a {
    display: block;
    height: 100%;
    width: 100%;
}

.gallery-item a:hover img {
    transform: scale(1.1);
}

/* Object fit styles based on maintain_aspect_ratio setting */
.custom-gallery[data-object-fit="contain"] .gallery-item img {
    object-fit: contain;
}

.custom-gallery[data-object-fit="cover"] .gallery-item img {
    object-fit: cover;
}

/* Responsive Styles using Elementor breakpoints */
@media (max-width: 767px) {
    .custom-gallery.elementor-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .custom-gallery.elementor-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .custom-gallery.elementor-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* PhotoSwipe Lightbox Styles */
.pswp {
    z-index: 9999;
}

/* Add animation for lightbox opening */
.pswp__bg {
    background: rgba(0, 0, 0, 0.85);
    transition: opacity 0.3s ease;
}

.pswp__button {
    background-color: transparent;
}

/* Improve accessibility */
.gallery-item a:focus {
    outline: 2px solid #5b9dd9;
}