/* Step Reveal Timeline — frontend styles */

/*
 * Scoped reset. Elementor/theme global typography (headings, paragraphs,
 * italics, big default margins, etc.) otherwise bleeds into this widget and
 * is the #1 cause of it looking "off" when dropped into a page — this locks
 * every element inside down to a known baseline before our own rules apply.
 */
.srt-wrapper,
.srt-wrapper *,
.srt-wrapper *::before,
.srt-wrapper *::after {
	box-sizing: border-box;
}

/*
 * Default (standalone) mode: the widget owns its own scroll-pin, so it needs
 * scroll runway — one viewport per step, plus one extra for entry/exit
 * breathing room. If you wrap the shortcode in your own Elementor section
 * and give that section the class "custom-scroll-sticky", these rules are
 * turned off below and your section becomes the thing that scrolls/pins —
 * the widget just reveals steps and fills the line based on how far through
 * that section the visitor has scrolled.
 */
.srt-wrapper {
	position: relative;
	background: transparent;
	height: calc((var(--srt-steps, 3) + 1) * 100vh);
}

.srt-wrapper h1,
.srt-wrapper h2,
.srt-wrapper h3,
.srt-wrapper h4,
.srt-wrapper p,
.srt-wrapper span,
.srt-wrapper div {
	font-style: normal;
	text-transform: none;
	letter-spacing: normal;
}

.srt-sticky {
	position: sticky;
	top: 0;
	height: 100vh;
	display: flex;
	align-items: center;
	overflow: hidden;
	background: transparent;
	color: var(--srt-text, #fff);
}

/*
 * Cooperative mode: when the shortcode sits inside an element carrying
 * "custom-scroll-sticky", that ancestor stops being a normal-height section
 * and becomes the tall scroll runway instead (its exact height is set in
 * JS to (steps + 1) * 100vh, mirroring how standalone mode sizes
 * .srt-wrapper). Its own direct child — the row holding your side-by-side
 * columns — is what pins to the top of the viewport and stays there while
 * the page scrolls through that runway. The ancestor itself must NOT be
 * position:sticky: a sticky element's own top stays pinned at 0 the whole
 * time it's stuck, and the JS reads that same top value to compute scroll
 * progress — so if the ancestor were sticky, progress would freeze at 0
 * the instant it stuck (steps never activate, the line never fills, and it
 * un-sticks again almost immediately since it has no extra height of its
 * own to scroll through).
 */
.custom-scroll-sticky {
	position: relative;
}

/*
 * The direct child (Elementor's inner container / row) is what pins.
 * Sticky only works if this child is SHORTER than the tall runway parent —
 * Elementor's flex defaults (flex-grow / stretch) can silently stretch it
 * to the full runway height, which makes sticky a no-op. Pin it to its
 * natural content height explicitly.
 */
.custom-scroll-sticky > * {
	position: sticky !important;
	top: 0 !important;
	align-self: flex-start !important;
	flex-grow: 0 !important;
	flex-shrink: 0 !important;
	flex-basis: auto !important;
	height: auto !important;
	width: 100%;
}

.custom-scroll-sticky .srt-wrapper {
	height: auto;
	background: transparent;
}

/*
 * In cooperative mode the user's own Elementor row is the pinned element,
 * so the widget must NOT bring its own 100vh sticky box — that's what was
 * adding a full viewport of empty space above/below the steps. Here it
 * collapses to its natural content height and the section's own padding
 * (added by the user in Elementor) is the only spacing.
 */
.custom-scroll-sticky .srt-sticky {
	position: static;
	height: auto;
	display: block;
	overflow: visible;
	background: transparent;
}

.srt-content {
	width: 100%;
	max-width: var(--srt-max-width, 560px);
	margin: 0;
}

.srt-steps {
	position: relative;
	padding-left: calc(var(--srt-number-indent, 64px) + 28px);
	margin: 0;
}

.srt-line {
	position: absolute;
	/* Place the progress line to the left of the number column, then
	   keep the text content padded to the right. */
	left: 0;
	top: 8px;
	bottom: 8px;
	width: 2px;
	background: var(--srt-line, rgba(255,255,255,0.18));
	border-radius: 2px;
}

.srt-line-fill {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 0%;
	background: var(--srt-accent, #D2B073);
	border-radius: 2px;
	transition: height 0.15s linear;
}

.srt-step {
	position: relative;
	padding-bottom: var(--srt-step-gap, 40px);
	margin: 0;
	opacity: 0.25;
	transform: translateY(10px);
	transition: opacity 0.35s ease, transform 0.35s ease;
	font-family: inherit;
}

.srt-step:last-child {
	padding-bottom: 0;
}

.srt-step.is-active {
	opacity: 1;
	transform: translateY(0);
}

.srt-step-number {
	position: absolute;
	/* Sit in the left gutter created by .srt-steps' padding: the gutter is
	   (number-indent + 28px) wide with the line at its far left edge, so
	   pulling the number back by the full indent leaves a 28px gap between
	   the line and the number, and the indent's width between the number
	   and the text — instead of overlapping the title. */
	left: calc(-1 * var(--srt-number-indent, 64px));
	top: -2px;
	font-family: inherit;
	font-size: var(--srt-number-size, 20px);
	font-weight: 700;
	line-height: 1.2;
	color: var(--srt-accent, #D2B073);
	width: auto;
	white-space: nowrap;
}

.srt-step-body {
	margin: 0;
	padding: 0;
}

.srt-step-title {
	font-family: inherit;
	font-size: var(--srt-title-size, 19px);
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 8px;
	padding: 0;
	color: var(--srt-text, #fff);
}

.srt-step-desc {
	font-family: inherit;
	font-size: var(--srt-desc-size, 15px);
	font-weight: 400;
	line-height: 1.6;
	color: var(--srt-muted, #C9CDD1);
	margin: 0;
	padding: 0;
}

@media (max-width: 800px) {
	.srt-content {
		max-width: 100%;
	}

	.srt-sticky {
		overflow-y: auto;
	}
}

/*
 * Mobile override (up to 767px): the sticky/pin behaviour (both standalone
 * mode and the cooperative "custom-scroll-sticky" mode) is switched off
 * entirely. Nothing pins, there is no extra scroll runway, and every step
 * plus the progress line is shown fully revealed immediately, in the
 * accent color. The matching JS (frontend.js) skips its scroll listeners
 * and pin logic on this breakpoint so it doesn't fight these rules.
 * Desktop/tablet behaviour above 767px is untouched.
 */
@media (max-width: 767px) {
	.srt-wrapper {
		height: auto !important;
	}

	.custom-scroll-sticky {
		height: auto !important;
	}

	.custom-scroll-sticky > * {
		position: static !important;
		transform: none !important;
		top: auto !important;
	}

	.srt-sticky,
	.custom-scroll-sticky .srt-sticky {
		position: static !important;
		height: auto !important;
		display: block !important;
		overflow: visible !important;
	}

	.srt-step {
		opacity: 1 !important;
		transform: none !important;
	}

	.srt-line {
		background: #D2B073 !important;
	}

	.srt-line-fill {
		height: 100% !important;
		background: #D2B073 !important;
	}

	.srt-step-number,
	.srt-step-title {
		color: #D2B073 !important;
	}
}
