/* =========================================================
   Our Story Scroll — Elementor widget styles
   Scoped to .story; colors/typography/spacing are overridden
   by Elementor controls via {{WRAPPER}} selectors.
   ========================================================= */

.story {
	--steps: 3;
	--step-travel: 100vh;
	--anim-scale: 1.14;
	--fade-dur: 0.9s;
	--zoom-dur: 1.2s;
	--ease: cubic-bezier(0.16, 1, 0.3, 1);
	--_ink: #f2efe9;
	--_dim: #a29e97;
	--_line: #2a2a2c;

	position: relative;
	background: #0b0b0c;
	color: var(--_ink);
	/* travel = (steps + 1) viewports of scroll */
	height: calc((var(--steps) + 1) * var(--step-travel));
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.story__pin {
	position: sticky;
	top: 0;
	height: 100vh;
	overflow: hidden;
}

.story__grid {
	height: 100%;
	display: grid;
	grid-template-columns: 49% 1fr;
}

/* image-left variant */
.story--media-left .story__grid { grid-template-columns: 1fr 49%; }
.story--media-left .story__content { order: 2; }
.story--media-left .story__media { order: 1; }

/* ---- content ---- */
.story__content {
	position: relative;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: clamp(40px, 5vw, 88px) clamp(32px, 4vw, 72px);
}

.story__eyebrow {
	display: inline-block;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--_dim);
}

.story__title {
	margin-top: clamp(16px, 1.6vw, 24px);
	max-width: 14ch;
	font-family: "Playfair Display", Georgia, "Times New Roman", serif;
	font-weight: 500;
	font-size: clamp(38px, 4.4vw, 76px);
	line-height: 1.02;
	letter-spacing: -0.01em;
	color: var(--_ink);
}

.story__lede {
	margin-top: clamp(18px, 2vw, 28px);
	max-width: 46ch;
	font-size: clamp(15px, 1.05vw, 18px);
	line-height: 1.6;
	color: var(--_dim);
}

/* ---- stepping caption ---- */
.story__steps {
	position: relative;
	min-height: clamp(190px, 24vh, 250px);
}
.story__step {
	position: absolute;
	inset: auto auto 0 0;
	width: 100%;
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
	pointer-events: none;
}
.story__step.is-active {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.story__num {
	display: grid;
	place-items: center;
	width: clamp(56px, 4.5vw, 74px);
	height: clamp(56px, 4.5vw, 74px);
	margin-bottom: clamp(18px, 2vw, 28px);
	border: 1px solid var(--_line);
	font-family: "Playfair Display", Georgia, serif;
	font-size: clamp(26px, 2.4vw, 38px);
	font-weight: 400;
	color: var(--_ink);
}

.story__step-title {
	font-weight: 600;
	font-size: clamp(22px, 2vw, 32px);
	letter-spacing: -0.01em;
	color: var(--_ink);
}

.story__step-text {
	margin-top: clamp(10px, 1vw, 16px);
	max-width: 44ch;
	font-size: clamp(14px, 1vw, 17px);
	line-height: 1.6;
	color: var(--_dim);
}

/* ---- media ---- */
.story__media {
	position: relative;
	height: 100%;
	overflow: hidden;
	background: #000;
}
.story__stage { position: absolute; inset: 0; }

.story__slide {
	position: absolute;
	inset: 0;
	margin: 0;
	z-index: 0;
	transform: scale(0);
	transform-origin: center center;
	transition: transform var(--zoom-dur) var(--ease);
	pointer-events: none;
	will-change: transform;
}
.story__slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

/* animation variants ------------------------------------------------ */
/* reveal (default): every image at/below the current step is full-size
   (higher index stacks on top via JS z-index). The current image grows from
   the centre over the ones below on scroll-down, and shrinks away to reveal
   them on scroll-up — works for every image, both directions. */
.story[data-anim="reveal"] .story__slide.is-shown { transform: scale(1); }

/* fade: simple cross-fade, no scale */
.story[data-anim="fade"] .story__slide {
	transform: scale(1);
	opacity: 0;
	transition: opacity var(--fade-dur) var(--ease);
}
.story[data-anim="fade"] .story__slide.is-shown { opacity: 1; }

/* zoom-in: incoming fades in while easing from a slight over-scale */
.story[data-anim="zoom-in"] .story__slide {
	transform: scale(var(--anim-scale));
	opacity: 0;
	transition: opacity var(--fade-dur) var(--ease), transform var(--zoom-dur) var(--ease);
}
.story[data-anim="zoom-in"] .story__slide.is-shown { transform: scale(1); opacity: 1; }

/* ken burns: slow continuous drift on the active image */
.story[data-anim="kenburns"] .story__slide {
	transform: scale(1);
	opacity: 0;
	transition: opacity var(--fade-dur) var(--ease);
}
.story[data-anim="kenburns"] .story__slide.is-shown { opacity: 1; }
.story[data-anim="kenburns"] .story__slide.is-current {
	animation: oss-kenburns calc(var(--step-travel) / 12 + 6s) linear forwards;
}
@keyframes oss-kenburns { from { transform: scale(1); } to { transform: scale(var(--anim-scale)); } }

/* ---- segmented progress bar ---- */
.story__progress {
	position: absolute;
	left: clamp(20px, 3vw, 44px);
	right: clamp(20px, 3vw, 44px);
	bottom: clamp(20px, 3vw, 40px);
	z-index: 2;
	display: flex;
	gap: clamp(10px, 1.4vw, 22px);
}
.story__seg {
	position: relative;
	flex: 1;
	height: 2px;
	background: rgba(255, 255, 255, 0.28);
	overflow: hidden;
}
.story__seg i {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0%;
	background: #fff;
	transition: width 0.1s linear;
}

/* =========================================================
   Mobile / tablet — horizontal grab-to-drag carousel
   (desktop > 1024px is untouched: the carousel is hidden and
    the pinned scroll story stays exactly as-is)
   ========================================================= */
.story__cards { display: none; }

@media (max-width: 1024px) {
	/* turn off the pinned scroll story */
	.story { height: auto; }
	.story__pin { display: none; }

	.story__cards {
		display: block;
		padding: clamp(20px, 5vw, 40px) 0 clamp(24px, 5vw, 40px);
	}

	.story__cards-track {
		display: flex;
		gap: clamp(16px, 3vw, 28px);
		padding-inline: clamp(20px, 5vw, 40px);
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		cursor: grab;
		scrollbar-width: none;            /* hide native bar — we draw our own */
		user-select: none;
	}
	.story__cards-track::-webkit-scrollbar { display: none; }
	.story__cards-track.is-dragging { cursor: grabbing; scroll-snap-type: none; }
	.story__cards-track.is-dragging .story__card { pointer-events: none; }

	.story__card {
		flex: 0 0 46%;
		scroll-snap-align: start;
		display: flex;
		flex-direction: column;
	}

	.story__card-media {
		aspect-ratio: 3 / 4;
		overflow: hidden;
		background: #000;
		margin-bottom: clamp(16px, 2vw, 22px);
	}
	.story__card-media img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		object-position: center;
		display: block;
		-webkit-user-drag: none;
	}

	.story__card-index {
		align-self: flex-start;
		padding: 5px 11px;
		margin-bottom: clamp(12px, 1.6vw, 18px);
		border: 1px solid var(--_line);
		border-radius: var(--radius-sm, 6px);
		font-size: 14px;
		font-weight: 500;
		color: var(--_ink);
	}
	.story__card-title {
		font-family: "Playfair Display", Georgia, "Times New Roman", serif;
		font-weight: 500;
		font-size: clamp(26px, 3.4vw, 38px);
		line-height: 1.05;
		letter-spacing: -0.01em;
		color: var(--_ink);
	}
	.story__card-text {
		margin-top: clamp(8px, 1.2vw, 14px);
		font-size: clamp(14px, 1.6vw, 17px);
		line-height: 1.55;
		color: var(--_dim);
	}

	/* draggable progress underline */
	.story__cards-bar {
		position: relative;
		height: 3px;
		margin: clamp(24px, 4vw, 40px) clamp(20px, 5vw, 40px) 0;
		background: rgba(148, 163, 184, 0.28);
		border-radius: 999px;
	}
	.story__cards-thumb {
		position: absolute;
		top: 0;
		left: 0;
		height: 100%;
		width: 33%;
		background: var(--_ink);
		border-radius: 999px;
	}
}

/* Phones: one card at a time */
@media (max-width: 640px) {
	.story__card { flex-basis: 82%; }
	.story__cards-track { scroll-snap-type: x mandatory; }
}

@media (prefers-reduced-motion: reduce) {
	.story__step { transition: opacity 0.2s linear; }
	.story__slide { transition: none !important; animation: none !important; }
}
