.fg-ff1048e3-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    perspective: 1000px;
}

.fg-ff1048e3-grid {
    display: grid;
    /* Grid template overridden by inline elementor settings */
}

/* Structural cells holding the animating items */
.fg-ff1048e3-cell {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* Keep a square box for stable layout if images aren't loaded */
}
/* Allow images to determine cell height naturally if needed */
.fg-ff1048e3-cell > div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.fg-ff1048e3-item {
    opacity: 0;
    width: 100%;
    height: 100%;
    will-change: transform, opacity;
}

.fg-ff1048e3-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Animations based on effect class */
/* 1. Fade */
.fg-effect-fade.is-exiting {
    animation: effectFadeOut_ff1048e3 0.8s forwards;
    z-index: 1;
}
.fg-effect-fade.is-active {
    animation: effectFadeIn_ff1048e3 0.8s forwards;
    z-index: 2;
}
@keyframes effectFadeIn_ff1048e3 {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes effectFadeOut_ff1048e3 {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* 2. Slide Up */
.fg-effect-slide-up.is-exiting {
    animation: effectSlideUpOut_ff1048e3 0.8s forwards;
    z-index: 1;
}
.fg-effect-slide-up.is-active {
    animation: effectSlideUpIn_ff1048e3 0.8s forwards;
    z-index: 2;
}
@keyframes effectSlideUpIn_ff1048e3 {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes effectSlideUpOut_ff1048e3 {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-40px); }
}

/* 3. Scale */
.fg-effect-scale.is-exiting {
    animation: effectScaleOut_ff1048e3 0.8s forwards;
    z-index: 1;
}
.fg-effect-scale.is-active {
    animation: effectScaleIn_ff1048e3 0.8s forwards;
    z-index: 2;
}
@keyframes effectScaleIn_ff1048e3 {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes effectScaleOut_ff1048e3 {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(1.1); }
}

/* 4. Flip */
.fg-effect-flip {
    transform-style: preserve-3d;
    backface-visibility: hidden;
}
.fg-effect-flip.is-exiting {
    animation: effectFlipOut_ff1048e3 0.8s forwards;
    z-index: 1;
}
.fg-effect-flip.is-active {
    animation: effectFlipIn_ff1048e3 0.8s forwards;
    z-index: 2;
}
@keyframes effectFlipIn_ff1048e3 {
    from { opacity: 0; transform: rotateY(90deg); }
    to { opacity: 1; transform: rotateY(0deg); }
}
@keyframes effectFlipOut_ff1048e3 {
    from { opacity: 1; transform: rotateY(0deg); }
    to { opacity: 0; transform: rotateY(-90deg); }
}