/* Background Gallery Styles */

/* Base styles for sections with gallery */
.bg-gallery {
    position: relative;
    overflow: hidden;
}

/* Background image container */
.bg-gallery-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Higher than default Divi background */
}

/* Individual background images */
.bg-gallery-background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    will-change: transform;
}

/* Active image is visible */
.bg-gallery-background-image.active {
    opacity: 1;
    z-index: 2; /* Higher than other images */
}

/* Previous image stays visible behind the active one */
.bg-gallery-background-image.previous {
    opacity: 1;
    z-index: 1; /* Lower than active, higher than others */
}

/* Zoom animations */
.bg-gallery-background-image.very-slow {
    transition-duration: 20s;
}

.bg-gallery-background-image.slow {
    transition-duration: 15s;
}

.bg-gallery-background-image.medium {
    transition-duration: 10s;
}

.bg-gallery-background-image.fast {
    transition-duration: 7s;
}

/* Transform scale for zoom effect */
.bg-gallery-background-image {
    transform: scale(1);
    transition: transform 0s linear, opacity 1.5s ease-in-out;
}

.bg-gallery-background-image.zooming {
    transform: scale(var(--zoom-level, 1.1));
    transition: transform var(--transition-duration, 15s) linear, opacity 1.5s ease-in-out;
}
