/**
 * Custom Gallery Styles
 */

/* Container */
.custom-gallery-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 30px;
    padding: 0 40px; /* Add padding for arrows */
}

/* Make sure the gallery respects its container */
.custom-gallery-swiper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Slide styles */
.custom-gallery-swiper .swiper-slide {
    height: auto;
    aspect-ratio: 4/3; /* Maintain aspect ratio for all slides */
    overflow: hidden;
}

/* Make images equal size */
.custom-gallery-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

/* Image styling */
.custom-gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This ensures images cover the area without distortion */
    display: block;
    transition: transform 0.3s ease;
}

/* Hover effect */
.custom-gallery-image-wrapper:hover {
    transform: scale(1.03);
}

/* Caption styles */
.custom-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.3;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-gallery-image-wrapper:hover .custom-gallery-caption {
    opacity: 1;
}

/* Navigation arrows */
.custom-gallery-swiper .swiper-button-next,
.custom-gallery-swiper .swiper-button-prev {
    color: #0073aa;
    background-color: rgba(255, 255, 255, 0.7);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-gallery-swiper .swiper-button-next:after,
.custom-gallery-swiper .swiper-button-prev:after {
    font-size: 16px;
    font-weight: bold;
}

.custom-gallery-swiper .swiper-button-disabled {
    opacity: 0.35;
    cursor: auto;
    pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .custom-gallery-container {
        padding: 0 30px; /* Smaller padding on tablets */
    }
    
    .custom-gallery-swiper .swiper-button-next,
    .custom-gallery-swiper .swiper-button-prev {
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 576px) {
    .custom-gallery-container {
        padding: 0 25px; /* Smaller padding on mobile */
    }
    
    .custom-gallery-swiper .swiper-button-next:after,
    .custom-gallery-swiper .swiper-button-prev:after {
        font-size: 14px;
    }
}

/* Empty gallery message */
.custom-gallery-empty {
    padding: 20px;
    background-color: #f1f1f1;
    border-radius: 4px;
    text-align: center;
    color: #666;
}

/* GLightbox customization */
.glightbox-container {
    z-index: 9999;
}

.gslide-description {
    background-color: rgba(0, 0, 0, 0.7);
}

.gdesc-inner {
    padding: 15px;
}

.gslide-title {
    color: #fff;
    font-size: 16px;
    margin-bottom: 5px;
}