/* =========================================
   Default state: editor-friendly
   Everything stays visible in normal flow
========================================= */

.scroll-alt-story {
	position: relative;
}

.scroll-alt-story .fusion-image-element {
	position: relative;
	opacity: 1;
	z-index: auto;
}

.scroll-alt-story .fusion-image-element .fusion-imageframe,
.scroll-alt-story .fusion-image-element img {
	display: block;
	width: 100%;
	height: auto;
}

/* =========================================
   Live / preview enhanced state only
========================================= */

.scroll-alt-story.is-enhanced {
	position: relative;
}

.scroll-alt-story.is-enhanced > .fusion-builder-row {
	position: sticky;
	top: 0;
	height: 100vh;
	min-height: 100vh;
	align-items: stretch !important;
}

.scroll-alt-story.is-enhanced .scroll-alt-story__col--left,
.scroll-alt-story.is-enhanced .scroll-alt-story__col--right {
	position: relative;
	height: 100vh;
	min-height: 100vh;
	overflow: hidden;
	margin-bottom: 0 !important;
}

.scroll-alt-story.is-enhanced .scroll-alt-story__col--left > .fusion-column-wrapper,
.scroll-alt-story.is-enhanced .scroll-alt-story__col--right > .fusion-column-wrapper {
	position: relative;
	height: 100%;
	min-height: 100%;
	padding: 0 !important;
}

/* stack Avada image elements and center them vertically */
.scroll-alt-story.is-enhanced .scroll-alt-story__col--left .fusion-image-element,
.scroll-alt-story.is-enhanced .scroll-alt-story__col--right .fusion-image-element {
	position: absolute !important;
	top: 50%;
	left: 0;
	width: 100%;
	margin: 0 !important;
	opacity: 0;
	z-index: 1;
	pointer-events: none;
	will-change: opacity;
	backface-visibility: hidden;
	transform: translateY(-50%) !important;
}

/* first image visible at load */
.scroll-alt-story.is-enhanced .scroll-alt-story__col--left .fusion-image-element:first-of-type,
.scroll-alt-story.is-enhanced .scroll-alt-story__col--right .fusion-image-element:first-of-type {
	opacity: 1;
	z-index: 2;
	pointer-events: auto;
}

.scroll-alt-story.is-enhanced .scroll-alt-story__col--left .fusion-image-element .fusion-imageframe,
.scroll-alt-story.is-enhanced .scroll-alt-story__col--right .fusion-image-element .fusion-imageframe {
	display: block;
	width: 100%;
	height: auto !important;
	margin: 0 !important;
}

/* keep image proportions natural */
.scroll-alt-story.is-enhanced .scroll-alt-story__col--left .fusion-image-element img,
.scroll-alt-story.is-enhanced .scroll-alt-story__col--right .fusion-image-element img {
	display: block;
	width: 100%;
	height: auto !important;
	max-width: 100%;
	object-fit: contain;
}

/* optional: captions stay attached to the image frame */
.scroll-alt-story.is-enhanced .fusion-image-element .awb-imageframe-caption-container {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
}

/* mimic hover when JS detects mouse is resting over the active frame */
.scroll-alt-story.is-enhanced .fusion-imageframe.is-rest-hover .awb-imageframe-caption-container,
.scroll-alt-story.is-enhanced .fusion-imageframe.is-rest-hover .awb-imageframe-caption,
.scroll-alt-story.is-enhanced .fusion-imageframe.is-rest-hover .awb-imageframe-hover-type {
	opacity: 1 !important;
	visibility: visible !important;
}

.scroll-alt-story.is-enhanced .fusion-imageframe.is-rest-hover:before,
.scroll-alt-story.is-enhanced .fusion-imageframe.is-rest-hover:after {
	opacity: 1 !important;
}

/* optional safety cleanup if Avada injects spacing */
.scroll-alt-story.is-enhanced .scroll-alt-story__col--left .fusion-image-element,
.scroll-alt-story.is-enhanced .scroll-alt-story__col--right .fusion-image-element,
.scroll-alt-story.is-enhanced .scroll-alt-story__col--left .fusion-image-element .fusion-imageframe,
.scroll-alt-story.is-enhanced .scroll-alt-story__col--right .fusion-image-element .fusion-imageframe {
	padding: 0 !important;
}