/* =========================================================
   Scroll Story Section — base styles
   Editable colors/typography come from Elementor Style controls
   via {{WRAPPER}} selectors; this file only handles layout,
   sticky behaviour, and transitions.
   ========================================================= */

.cfw-story-wrapper {
	position: relative;
	height: calc(var(--cfw-total-steps, 3) * var(--cfw-vh-per-step, 100vh));
}

.cfw-sticky-inner {
	position: sticky;
	top: 0;
	height: 100vh;
	overflow: hidden;
	display: flex;
	align-items: center;
}

.cfw-story-grid {
	width: 100%;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: stretch;
	box-sizing: border-box;
	/* max-width, padding, and gap are set via Elementor's
	   "Container Layout" style controls on the widget */
}

.cfw-story-left {
	position: relative;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.cfw-story-top {
	/* holds eyebrow + heading + subtitle at the top of the column */
}

.cfw-eyebrow {
	font-size: 12px;
	letter-spacing: 3px;
	text-transform: uppercase;
	margin-bottom: 18px;
}

.cfw-story-heading {
	font-size: 42px;
	line-height: 1.15;
	font-weight: 500;
	margin: 0 0 18px;
}

.cfw-story-sub {
	font-size: 14px;
	line-height: 1.6;
	max-width: 420px;
	margin: 0;
}

.cfw-steps-holder {
	position: relative;
	min-height: 160px;
}

.cfw-story-step {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	opacity: 0;
	visibility: hidden;
	transform: translateY(14px);
	transition: opacity 0.5s ease, transform 0.5s ease, visibility 0.5s;
}

.cfw-story-step.active {
	position: relative;
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.cfw-step-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	font-size: 20px;
	margin-bottom: 22px;
}

.cfw-step-title {
	font-size: 20px;
	font-weight: 600;
	margin: 0 0 10px;
}

.cfw-step-desc {
	font-size: 14px;
	line-height: 1.6;
	max-width: 420px;
	margin: 0;
}

/* ---------------- right image stack ---------------- */
.cfw-story-right {
	position: relative !important;
	width: 100%;
	height: 560px; /* fallback; overridden by the widget's Width/Height style controls */
	overflow: hidden !important;
	background: #1a1a1a;
	box-sizing: border-box;
}

.cfw-story-img {
	position: absolute !important;
	inset: 0 !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.7s ease, transform 0.7s ease;
}

.cfw-story-img.active {
	opacity: 1;
}

/* ---------------- image transition variants ---------------- */

/* Fade: only opacity changes, no movement */
.cfw-transition-fade .cfw-story-img {
	transform: none;
}
.cfw-transition-fade .cfw-story-img.active {
	transform: none;
}

/* Zoom In: starts smaller, grows to full size as it becomes active */
.cfw-transition-zoom-in .cfw-story-img {
	transform: scale(0.9);
}
.cfw-transition-zoom-in .cfw-story-img.active {
	transform: scale(1);
}

/* Zoom Out: starts larger, shrinks to full size as it becomes active */
.cfw-transition-zoom-out .cfw-story-img {
	transform: scale(1.12);
}
.cfw-transition-zoom-out .cfw-story-img.active {
	transform: scale(1);
}

/* Slide Up: rises into place from below */
.cfw-transition-slide-up .cfw-story-img {
	transform: translateY(30px);
}
.cfw-transition-slide-up .cfw-story-img.active {
	transform: translateY(0);
}

/* Slide Down: drops into place from above */
.cfw-transition-slide-down .cfw-story-img {
	transform: translateY(-30px);
}
.cfw-transition-slide-down .cfw-story-img.active {
	transform: translateY(0);
}

/* ---------------- progress bar (overlaid inside the image) ---------------- */
.cfw-story-progress {
	position: absolute;
	left: 24px;
	right: 24px;
	bottom: 24px;
	z-index: 3;
	display: flex;
	gap: 8px;
}

.cfw-progress-item {
	flex: 1;
	height: 2px;
	border-radius: 999px;
	overflow: hidden;
	position: relative;
}

.cfw-progress-item::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 0%;
	border-radius: 999px;
}

.cfw-progress-item.filled::after {
	width: 100%;
	transition: width 0.4s ease;
}

.cfw-progress-item.current::after {
	width: var(--current-fill, 0%);
}

/* ---------------- responsive ---------------- */
@media (max-width: 860px) {
	.cfw-story-grid {
		grid-template-columns: 1fr;
		gap: 32px;
	}
	.cfw-story-heading {
		font-size: 30px;
	}
	.cfw-story-right {
		order: -1;
	}
	.cfw-story-left {
		height: auto;
		display: block;
	}
	.cfw-story-top {
		margin-bottom: 32px;
	}
}
