/* ================================================================
   Sun Pumps – Milestones Timeline Widget  v1.0.0
   Mirrors the design tokens and layout from the Sun Pumps about page.
   ================================================================ */

/* ----------------------------------------------------------------
   Design tokens (scoped to widget wrapper)
   ---------------------------------------------------------------- */
.sp-tl-section {
	--sp-brand-red:    #ED1C2B;
	--sp-ink-1:        #0F1A1F;
	--sp-ink-2:        #1F2D34;
	--sp-ink-3:        #37464E;
	--sp-ink-4:        #5C6B73;
	--sp-ink-5:        #8A969D;
	--sp-paper-1:      #FFFFFF;
	--sp-paper-2:      #FAFAF7;
	--sp-paper-3:      #F2F1EB;
	--sp-paper-4:      #E6E5DE;
	--sp-line-2:       rgba(15, 26, 31, 0.14);
	--sp-line-3:       rgba(15, 26, 31, 0.24);
	--sp-warm-tint:    #FFF6E8;
	--sp-font-display: 'Geist', 'Inter', system-ui, sans-serif;
	--sp-font-body:    'Inter', system-ui, sans-serif;
	--sp-font-mono:    'JetBrains Mono', ui-monospace, monospace;
	--sp-r-md:         8px;
	--sp-r-lg:         14px;
	--sp-el-1:         0 1px 2px rgba(15,26,31,.04), 0 1px 1px rgba(15,26,31,.04);

	background-color: var(--sp-paper-3);
	padding: 80px 32px;
	box-sizing: border-box;
}

/* ----------------------------------------------------------------
   Container
   ---------------------------------------------------------------- */
.sp-tl-container {
	max-width: 1250px;
	margin: 0 auto;
	width: 100%;
}

/* ----------------------------------------------------------------
   Section header
   ---------------------------------------------------------------- */
.sp-tl-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	flex-wrap: wrap;
	gap: 24px;
	margin-bottom: 48px;
}

.sp-tl-header-left {
	max-width: 44ch;
}

.sp-tl-eyebrow {
	display: block;
	font-family: var(--sp-font-mono);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--sp-brand-red);
	margin-bottom: 14px;
}

.sp-tl-heading {
	font-family: var(--sp-font-display);
	font-size: clamp(28px, 3vw, 40px);
	font-weight: 700;
	line-height: 1.15;
	color: var(--sp-ink-1);
	margin: 0 0 10px;
	padding: 0;
}

.sp-tl-subheading {
	font-family: var(--sp-font-body);
	font-size: 18px;
	line-height: 1.5;
	color: var(--sp-ink-3);
	margin: 0;
}

.sp-tl-date-range {
	font-family: var(--sp-font-mono);
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--sp-ink-5);
	white-space: nowrap;
}

/* ----------------------------------------------------------------
   Timeline track
   ---------------------------------------------------------------- */
.sp-tl {
	display: flex;
	flex-direction: column;
	position: relative;
}

/* Vertical connector line */
.sp-tl::before {
	content: '';
	position: absolute;
	top: 12px;
	bottom: 12px;
	left: 124px;         /* aligns with the dot column */
	width: 2px;
	background: linear-gradient(
		180deg,
		var(--sp-paper-4) 0%,
		var(--sp-line-3)  50%,
		var(--sp-paper-4) 100%
	);
	pointer-events: none;
}

/* ----------------------------------------------------------------
   Individual row
   ---------------------------------------------------------------- */
.sp-tl-row {
	display: grid;
	grid-template-columns: 100px 48px 1fr;
	align-items: start;
	padding: 18px 0;
	position: relative;
}

/* Year label */
.sp-tl-year {
	font-family: var(--sp-font-mono);
	font-size: 14px;
	font-weight: 600;
	color: var(--sp-ink-4);
	padding-top: 4px;
	letter-spacing: 0.02em;
}

/* Dot */
.sp-tl-dot {
	display: flex;
	justify-content: center;
	padding-top: 6px;
}

.sp-tl-dot span {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--sp-paper-2);
	border: 2px solid var(--sp-ink-3);
	box-shadow: 0 0 0 4px var(--sp-warm-tint);
	display: block;
	flex-shrink: 0;
}

/* Card */
.sp-tl-card {
	background: var(--sp-paper-1);
	border: 1px solid var(--sp-line-2);
	border-radius: var(--sp-r-lg);
	padding: 18px 22px;
	box-shadow: var(--sp-el-1);
}

.sp-tl-tag {
	font-family: var(--sp-font-mono);
	font-size: 10px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--sp-ink-5);
	font-weight: 600;
}

.sp-tl-card-title {
	font-family: var(--sp-font-display);
	font-size: 24px;
	font-weight: 600;
	color: var(--sp-ink-1);
	margin: 6px 0 8px;
	padding: 0;
	line-height: 1.3;
}

.sp-tl-card-desc {
	font-family: var(--sp-font-body);
	font-size: 15px;
	line-height: 1.6;
	color: var(--sp-ink-3);
	margin: 0;
}

/* ----------------------------------------------------------------
   Accent / highlighted row
   ---------------------------------------------------------------- */
.sp-tl-row.is-accent .sp-tl-year {
	color: var(--sp-brand-red);
}

.sp-tl-row.is-accent .sp-tl-dot span {
	background: var(--sp-brand-red);
	border-color: var(--sp-brand-red);
	box-shadow:
		0 0 0 4px var(--sp-warm-tint),
		0 0 0 9px rgba(237, 28, 43, 0.18);
}

.sp-tl-row.is-accent .sp-tl-tag {
	color: var(--sp-brand-red);
}

.sp-tl-row.is-accent .sp-tl-card {
	border-color: rgba(237, 28, 43, 0.25);
	background: linear-gradient(180deg, #FFFFFF 0%, #FFFAF6 100%);
}

/* ----------------------------------------------------------------
   Scroll-reveal animation
   ---------------------------------------------------------------- */

/*
 * Default animation: fade-up (translateY + opacity).
 * The widget PHP writes --sp-anim-duration, --sp-anim-easing,
 * --sp-stagger-ms, and --sp-anim-distance onto .sp-tl via inline style.
 * CSS reads them so the transition is fully driven by Elementor controls.
 */
.sp-tl-row {
	opacity: 0;
	transform: translateY( var(--sp-anim-distance, 28px) );
	transition:
		opacity   var(--sp-anim-duration, 0.55s) var(--sp-anim-easing, cubic-bezier(.22,.68,0,1.2)),
		transform var(--sp-anim-duration, 0.55s) var(--sp-anim-easing, cubic-bezier(.22,.68,0,1.2));
	will-change: opacity, transform;
}

/* Triggered by JS once row enters the viewport */
.sp-tl-row.sp-tl-row--visible {
	opacity: 1;
	transform: translateY(0);
}

/*
 * Editor preview: show all rows immediately so the user can see
 * and edit them without needing to scroll.
 */
.elementor-editor-active .sp-tl-row {
	opacity: 1 !important;
	transform: none !important;
	transition: none !important;
}

/* Reduced-motion: respect user OS preference */
@media (prefers-reduced-motion: reduce) {
	.sp-tl-row {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* ----------------------------------------------------------------
   Responsive — mobile
   ---------------------------------------------------------------- */
@media (max-width: 640px) {
	.sp-tl-section {
		padding: 48px 20px;
	}

	.sp-tl::before {
		left: 8px;
	}

	.sp-tl-row {
		grid-template-columns: 1fr;
		gap: 8px;
		padding: 14px 0 14px 32px;
	}

	.sp-tl-dot {
		position: absolute;
		left: 0;
		top: 18px;
		padding: 0;
	}

	.sp-tl-year {
		padding: 0;
		font-size: 12px;
	}

	.sp-tl-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
		margin-bottom: 32px;
	}

	.sp-tl-header-left {
		max-width: none;
	}

	.sp-tl-date-range {
		display: none;
	}
}

@media (max-width: 900px) and (min-width: 641px) {
	.sp-tl::before {
		left: 100px;
	}
}
