/* ClickTraces – Milestones List (ct-milestones)
 * Colours are CSS variables on .ct-ms so Elementor controls override them (incl. hover).
 * Layout follows the widget's own width (container queries): 3 columns → 2 → stacked.
 * The scroll reveal uses opacity/transform only and is armed by JS for rows below the fold. */

.ct-ms {
	--ms-c1: 28.5%;
	--ms-c2: 39.2%;
	--ms-line: #d9d9d9;
	--ms-line-h: var(--ms-line);
	--ms-line-w: 1px;
	--ms-year: #0a0a0a;
	--ms-year-h: #5d32ff;
	--ms-eyebrow: #5d32ff;
	--ms-title: #0a0a0a;
	--ms-title-h: var(--ms-title);
	--ms-text: #0a0a0a;
	--ms-row-bg: transparent;
	--ms-row-bg-h: var(--ms-row-bg);
	--ms-dur: 0.8s;
	--ms-stagger: 90ms;
	--ms-dist: 18px;
	--ms-slide: 0px;
	position: relative;
	width: 100%;
	container-type: inline-size;
	container-name: ctms;
}

/* Full width when placed directly in an Elementor row container. */
.elementor-widget-ct-milestones {
	width: 100%;
}

.ct-ms .ct-ms__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ct-ms .ct-ms__row {
	position: relative;
	box-sizing: border-box;
	display: grid;
	grid-template-columns: var(--ms-c1) var(--ms-c2) minmax(0, 1fr);
	grid-template-areas: "year head text";
	align-items: center;
	column-gap: 0;
	row-gap: 8px;
	min-height: 114px;
	margin: 0;
	padding: 0 36px;
	list-style: none;
	background-color: var(--ms-row-bg);
	transition: background-color 0.35s ease;
}

.ct-ms .ct-ms__row::marker {
	content: none;
}

/* Divider lines (pseudo elements so they can "draw" in with a GPU transform). */
.ct-ms .ct-ms__row::before,
.ct-ms .ct-ms__row:last-child::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	width: auto;
	height: var(--ms-line-w);
	margin: 0;
	border: 0;
	border-radius: 0;
	background-color: var(--ms-line);
	transform-origin: left center;
	pointer-events: none;
	transition: background-color 0.35s ease;
}

.ct-ms .ct-ms__row::before {
	top: 0;
}

.ct-ms .ct-ms__row:last-child::after {
	bottom: 0;
}

.ct-ms--no-top .ct-ms__row:first-child::before,
.ct-ms--no-between .ct-ms__row + .ct-ms__row::before,
.ct-ms--no-bottom .ct-ms__row:last-child::after {
	display: none;
}

/* ---------- Columns ---------- */

.ct-ms .ct-ms__year {
	grid-area: year;
	position: relative;
	top: -0.085em;
	min-width: 0;
	margin: 0;
	padding: 0;
	font-size: 47px;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: 0;
	color: var(--ms-year);
	transition: color 0.35s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.ct-ms .ct-ms__head {
	grid-area: head;
	position: relative;
	top: 0;
	min-width: 0;
}

.ct-ms .ct-ms__eyebrow {
	position: relative;
	top: 2px;
	margin: 0 0 2px;
	font-size: 17.9px;
	font-weight: 400;
	line-height: 1.6;
	color: var(--ms-eyebrow);
}

.ct-ms .ct-ms__title {
	margin: 0;
	padding: 0;
	font-size: 24.3px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ms-title);
	transition: color 0.35s ease;
}

.ct-ms .ct-ms__title a {
	color: inherit;
	text-decoration: none;
}

/* Sits slightly above the row middle, as in the design. */
.ct-ms .ct-ms__text {
	grid-area: text;
	position: relative;
	top: -0.27em;
	min-width: 0;
	margin: 0;
	font-size: 19px;
	font-weight: 400;
	line-height: 1.64;
	color: var(--ms-text);
}

/* ---------- Hover ---------- */

.ct-ms--hover .ct-ms__row:hover {
	background-color: var(--ms-row-bg-h);
}

.ct-ms--hover .ct-ms__row:hover::before {
	background-color: var(--ms-line-h);
}

.ct-ms--hover .ct-ms__row:hover .ct-ms__year {
	color: var(--ms-year-h);
	transform: translateX(var(--ms-slide));
}

.ct-ms--hover .ct-ms__row:hover .ct-ms__title {
	color: var(--ms-title-h);
}

/* ---------- Auto layout by available width ---------- */

@container ctms (max-width: 880px) {
	.ct-ms .ct-ms__row {
		grid-template-columns: var(--ms-c1) minmax(0, 1fr);
		grid-template-areas: "year head" "year text";
		min-height: 0;
		padding: 26px 24px;
	}

	.ct-ms .ct-ms__year {
		font-size: 40px;
	}

	.ct-ms .ct-ms__title {
		font-size: 22px;
	}

	.ct-ms .ct-ms__text {
		top: 0;
		font-size: 18px;
		line-height: 1.6;
	}

	.ct-ms .ct-ms__eyebrow {
		font-size: 16px;
	}
}

@container ctms (max-width: 560px) {
	.ct-ms .ct-ms__row {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas: "year" "head" "text";
		row-gap: 6px;
		padding: 22px 0;
	}

	.ct-ms .ct-ms__year {
		top: 0;
		font-size: 34px;
	}

	.ct-ms .ct-ms__title {
		font-size: 20px;
	}

	.ct-ms .ct-ms__text {
		font-size: 16px;
	}

	.ct-ms .ct-ms__eyebrow {
		font-size: 15px;
	}
}

/* ---------- Scroll reveal (rows below the fold only; armed by JS) ---------- */

.ct-ms .ct-ms__row.is-armed > * {
	transition: opacity var(--ms-dur) cubic-bezier(0.22, 1, 0.36, 1), transform var(--ms-dur) cubic-bezier(0.22, 1, 0.36, 1), color 0.35s ease;
	transition-delay: calc(var(--ms-d, 0) * 120ms + var(--k, 0) * var(--ms-stagger)), calc(var(--ms-d, 0) * 120ms + var(--k, 0) * var(--ms-stagger)), 0s;
}

.ct-ms .ct-ms__row.is-armed > .ct-ms__head {
	--k: 1;
}

.ct-ms .ct-ms__row.is-armed > .ct-ms__text {
	--k: 2;
}

.ct-ms .ct-ms__row.is-armed:not(.is-in) > * {
	opacity: 0;
	transform: translate3d(0, var(--ms-dist), 0);
}

.ct-ms .ct-ms__row.is-armed::before,
.ct-ms .ct-ms__row.is-armed:last-child::after {
	transition: transform calc(var(--ms-dur) * 1.4) cubic-bezier(0.65, 0, 0.35, 1) calc(var(--ms-d, 0) * 120ms), background-color 0.35s ease;
}

.ct-ms .ct-ms__row.is-armed:not(.is-in)::before,
.ct-ms .ct-ms__row.is-armed:not(.is-in):last-child::after {
	transform: scaleX(0);
}

.ct-ms--static-lines .ct-ms__row.is-armed:not(.is-in)::before,
.ct-ms--static-lines .ct-ms__row.is-armed:not(.is-in):last-child::after {
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.ct-ms .ct-ms__row > *,
	.ct-ms .ct-ms__row::before,
	.ct-ms .ct-ms__row::after {
		transition: none !important;
	}
}

.ct-ms.is-instant .ct-ms__row > *,
.ct-ms.is-instant .ct-ms__row::before,
.ct-ms.is-instant .ct-ms__row::after {
	transition: none !important;
}
