/* 5th Axis — Our Milestones (snake timeline, CSS only) */

.axis5th-milestones {
	--axis5th-ms-columns: 4;
	--axis5th-ms-col-gap: 12px;
	--axis5th-ms-row-gap: 56px;
	--axis5th-ms-dot-size: 10px;
	--axis5th-ms-stem-height: 20px;
	--axis5th-ms-track: 2px;

	box-sizing: border-box;
	width: 100%;
	padding: 1.5rem 0 2rem;
	color: var(--e-global-color-e735d4d);
	background: var(--e-global-color-272eb31);
}

.axis5th-milestones *,
.axis5th-milestones *::before,
.axis5th-milestones *::after {
	box-sizing: border-box;
}

/* ── Timeline ─────────────────────────────────────────────── */

.axis5th-milestones__timeline {
	position: relative;
}

.axis5th-milestones__row {
	position: relative;
	margin-bottom: var(--axis5th-ms-row-gap);
	height: 280px;
}

.axis5th-milestones__row:last-child {
	margin-bottom: 0;
}

/* Horizontal tracks through the dots (not a full rectangle) */
.axis5th-milestones__frame {
	position: absolute;
	left: 0;
	right: 40px;
	top: 50%;
	bottom: auto;
	height: var(--axis5th-ms-track);
	margin-top: calc(var(--axis5th-ms-track) / -2);
	border: 0;
	pointer-events: none;
	z-index: 0;
}

.axis5th-milestones__frame--a {
	background: #ffffff;
}

.axis5th-milestones__frame--b {
	background: var(--e-global-color-primary);
}

.axis5th-milestones__frame--none {
	display: none;
}

/* Right-side connector: white → red, from top track to bottom track */
.axis5th-milestones__row:first-child::after {
	content: '';
	position: absolute;
	top: 50%;
	right: 40px;
	width: var(--axis5th-ms-track);
	height: calc(50% + var(--axis5th-ms-row-gap) + 50%);
	background: linear-gradient(
		to bottom,
		#ffffff 0%,
		#ffffff 18%,
		var(--e-global-color-primary) 82%,
		var(--e-global-color-primary) 100%
	);
	pointer-events: none;
	z-index: 0;
}

.axis5th-milestones__cols {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: repeat(var(--axis5th-ms-columns), minmax(0, 1fr));
	gap: var(--axis5th-ms-col-gap);
	align-items: stretch;
	height: 100%;
}

.axis5th-milestones__col {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	height: 100%;
	padding: 0 8px;
}

/* Dots sit on the track at 50% */
.axis5th-milestones__dot-wrap {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--axis5th-ms-dot-size);
	height: var(--axis5th-ms-dot-size);
	margin: 0;
	transform: translate(-50%, -50%);
}

.axis5th-milestones__dot-wrap::before,
.axis5th-milestones__dot-wrap::after {
	content: '';
	position: absolute;
	left: 50%;
	width: 1px;
	height: var(--axis5th-ms-stem-height);
	background: var(--e-global-color-primary);
	transform: translateX(-50%);
}

.axis5th-milestones__dot-wrap::before {
	bottom: 100%;
}

.axis5th-milestones__dot-wrap::after {
	top: 100%;
}

.axis5th-milestones__dot {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: var(--e-global-color-primary);
}

/* Odd columns: year above the line, title + desc below */
.axis5th-milestones__col:nth-child(odd) .axis5th-milestones__year {
	flex: 0 0 50%;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	width: 100%;
	padding-bottom: calc(var(--axis5th-ms-stem-height) + var(--axis5th-ms-dot-size) / 2 + 4px);
}

.axis5th-milestones__col:nth-child(odd) .axis5th-milestones__title {
	width: 100%;
	padding-top: calc(var(--axis5th-ms-stem-height) + var(--axis5th-ms-dot-size) / 2 + 4px);
}

.axis5th-milestones__col:nth-child(odd) .axis5th-milestones__desc {
	flex: 1 1 auto;
	width: 100%;
}

/* Even columns: title + desc above the line, year below */
.axis5th-milestones__col:nth-child(even) .axis5th-milestones__title {
	flex: 1 1 auto;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	width: 100%;
}

.axis5th-milestones__col:nth-child(even) .axis5th-milestones__desc {
	width: 100%;
	padding-bottom: calc(var(--axis5th-ms-stem-height) + var(--axis5th-ms-dot-size) / 2 + 4px);
}

.axis5th-milestones__col:nth-child(even) .axis5th-milestones__year {
	flex: 0 0 50%;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	width: 100%;
	padding-top: calc(var(--axis5th-ms-stem-height) + var(--axis5th-ms-dot-size) / 2 + 4px);
}

.axis5th-milestones__year {
	color: var(--e-global-color-primary);
	font-size: 24px;
	font-weight: 700;
	line-height: 1.1;
}

.axis5th-milestones__title {
	font-family: var(--e-global-typography-accent-font-family);
	color: var(--e-global-color-e735d4d);
	font-size: 20px;
	font-weight: 500;
	line-height: 1.3;
	margin-bottom: 4px;
}

.axis5th-milestones__desc {
	color: var(--e-global-color-e235f34);
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
	max-width: 220px;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 1100px) {
	.axis5th-milestones__title {
		font-size: 15px;
	}

	.axis5th-milestones__year {
		font-size: 22px;
	}
}

@media (max-width: 1024px) {
	.axis5th-milestones {
		--axis5th-ms-row-gap: 40px;
	}

	.axis5th-milestones__cols {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		row-gap: 36px;
	}

	.axis5th-milestones__frame,
	.axis5th-milestones__row:first-child::after {
		display: none;
	}

	.axis5th-milestones__row,
	.axis5th-milestones__col {
		height: auto;
		min-height: 0;
	}

	.axis5th-milestones__dot-wrap {
		position: relative;
		top: auto;
		left: auto;
		transform: none;
		margin: 8px auto;
	}

	.axis5th-milestones__col:nth-child(odd) .axis5th-milestones__year,
	.axis5th-milestones__col:nth-child(even) .axis5th-milestones__year,
	.axis5th-milestones__col:nth-child(even) .axis5th-milestones__title,
	.axis5th-milestones__col:nth-child(odd) .axis5th-milestones__desc {
		flex: none;
		display: block;
		padding: 0;
	}

	.axis5th-milestones__col:nth-child(odd) .axis5th-milestones__title,
	.axis5th-milestones__col:nth-child(even) .axis5th-milestones__desc {
		padding: 0;
	}

	.axis5th-milestones__timeline {
		padding-left: 22px;
	}

	.axis5th-milestones__timeline::before {
		content: '';
		position: absolute;
		top: 8px;
		bottom: 8px;
		left: 4px;
		width: var(--axis5th-ms-track);
		background: linear-gradient(
			to bottom,
			#ffffff 0%,
			var(--e-global-color-primary) 100%
		);
		border-radius: 2px;
	}

	.axis5th-milestones__col {
		align-items: flex-start;
		text-align: left;
		padding: 0 0 8px 8px;
	}

	.axis5th-milestones__dot-wrap {
		margin-left: 0;
		display: none;
	}

	.axis5th-milestones__desc {
		max-width: none;
		order: 3;
	}
	.axis5th-milestones__year{
		order: 1;
		margin-bottom: 10px;
	}
	.axis5th-milestones__title{
		order: 2;
	}
}

@media (max-width: 575px) {
	.axis5th-milestones {
		padding: 1rem 0 1.5rem;
	}

	.axis5th-milestones__cols {
		grid-template-columns: 1fr;
		row-gap: 28px;
	}

	.axis5th-milestones__year {
		font-size: 22px;
	}

	.axis5th-milestones__title {
		font-size: 16px;
	}

	.axis5th-milestones__dot-wrap::before,
	.axis5th-milestones__dot-wrap::after {
		display: none;
	}
}

