/*
Elementor Scroll Storytell Updates v1.0.0
Use these classes in Elementor > Advanced > CSS Classes.
*/

:root {
	--ess-sticky-offset: 100px;
	--ess-duration: 0.8s;
	--ess-ease: cubic-bezier(.22, 1, .36, 1);
	--ess-bg-light: #FCF1E5;
	--ess-card-light: #FFF8F1;
	--ess-card-warm: #F7E8D9;
	--ess-dark: #2F3127;
	--ess-green: #3A4200;
	--ess-accent: #E2722C;
	--ess-shadow: 0 24px 70px rgba(47, 49, 39, .12);
}

/* Base reveal states */
.ess-fade-up,
.ess-line-reveal,
.ess-focus-statement,
.ess-active-card,
.ess-badge-pop,
.ess-parallax-media {
	will-change: transform, opacity;
}

.ess-fade-up {
	opacity: 0;
	transform: translateY(48px);
}

.ess-line-reveal {
	opacity: 0;
	transform: translateY(28px);
}

.ess-focus-statement {
	opacity: 0;
	transform: translateY(36px) scale(.98);
}

.ess-badge-pop {
	opacity: 0;
	transform: scale(.86) rotate(-2deg);
	transform-origin: center;
}

.ess-parallax-media {
	overflow: hidden;
}

.ess-parallax-media img,
.ess-parallax-media .elementor-widget-container,
.ess-parallax-media .swiper-slide-inner,
.ess-parallax-media .elementor-carousel-image {
	will-change: transform;
}

/* Sticky storytelling */
.ess-story-section {
	position: relative;
}

.ess-sticky-panel {
	position: sticky;
	top: var(--ess-sticky-offset, 100px);
	align-self: start;
	z-index: 2;
}

.ess-story-step {
	position: relative;
	min-height: clamp(420px, 72vh, 760px);
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.ess-story-step.is-ess-active {
	z-index: 3;
}

.ess-story-step.is-ess-active :is(h1, h2, h3, h4, p, a) {
	transition: color .25s ease;
}

/* Active cards */
.ess-active-card {
	transition: transform var(--ess-duration) var(--ess-ease), opacity var(--ess-duration) var(--ess-ease), box-shadow var(--ess-duration) var(--ess-ease), background-color var(--ess-duration) var(--ess-ease);
}

.ess-active-card.is-ess-active {
	transform: translateY(-8px) scale(1.015);
	box-shadow: var(--ess-shadow);
	background-color: var(--ess-card-light);
}

.ess-active-card.is-ess-dimmed {
	opacity: .52;
	transform: scale(.985);
}

/* Card stack */
.ess-card-stack {
	position: sticky;
	top: var(--ess-sticky-offset, 100px);
	transition: transform .6s var(--ess-ease), box-shadow .6s var(--ess-ease), opacity .6s var(--ess-ease);
	will-change: transform;
}

.ess-card-stack.is-ess-active {
	box-shadow: var(--ess-shadow);
}

/* Number focus */
.ess-number-focus {
	transition: transform .6s var(--ess-ease), filter .6s var(--ess-ease), opacity .6s var(--ess-ease);
	will-change: transform;
}

.ess-number-focus.is-ess-active {
	transform: scale(1.07);
	filter: saturate(1.15);
}

/* Optional progress rail */
.ess-progress-rail {
	position: relative;
}

.ess-progress-rail::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 2px;
	background: rgba(58, 66, 0, .16);
}

.ess-progress-rail::after {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	width: 2px;
	height: var(--ess-progress, 0%);
	background: var(--ess-accent);
	transition: height .12s linear;
}

/* Elementor editing safety */
.elementor-editor-active .ess-fade-up,
.elementor-editor-active .ess-line-reveal,
.elementor-editor-active .ess-focus-statement,
.elementor-editor-active .ess-badge-pop {
	opacity: 1 !important;
	transform: none !important;
}

.elementor-editor-active .ess-sticky-panel,
.elementor-editor-active .ess-card-stack {
	position: relative !important;
	top: auto !important;
}

@media (max-width: 767px) {
	.ess-sticky-panel,
	.ess-card-stack {
		position: relative;
		top: auto;
	}

	.ess-story-step {
		min-height: auto;
		padding-top: 48px;
		padding-bottom: 48px;
	}

	.ess-active-card.is-ess-dimmed {
		opacity: 1;
		transform: none;
	}
}
