/* ==========================================================================
   Timeline Element
   ========================================================================== */

.tl-timeline {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 40px;
}

/* ---------- Vertical line (per-item segments) ---------- */

.tl-item::before {
	content: "";
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	width: 3px;
	background: #d1d5db;
	top: 0;
	bottom: -40px; /* extend through the gap to connect with next item */
	z-index: 0;
}

.tl-item:first-child::before {
	top: 38px; /* start at first dot center */
}

.tl-item:last-child::before {
	bottom: calc(100% - 38px); /* stop at last dot center */
}

.tl-item:only-child::before {
	display: none;
}

/* ---------- Single item row (3-col grid) ---------- */

.tl-item {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: start;
	position: relative;
}

/* Right-side cards (even: 0, 2, 4…) */
.tl-item--right .tl-card-wrapper {
	grid-column: 3;
	grid-row: 1;
	justify-self: start;
	position: relative;
}

.tl-item--right .tl-dot-col {
	grid-column: 2;
	grid-row: 1;
}

/* Left-side cards (odd: 1, 3, 5…) */
.tl-item--left .tl-card-wrapper {
	grid-column: 1;
	grid-row: 1;
	justify-self: end;
	position: relative;
}

.tl-item--left .tl-dot-col {
	grid-column: 2;
	grid-row: 1;
}

.tl-item--left .tl-card {
	text-align: right;
}

/* ---------- Card ---------- */

.tl-card {
	border-radius: 12px;
	padding: 28px 32px;
	max-width: 420px;
	width: 100%;
	box-sizing: border-box;
}

.tl-card-title {
	margin: 0 0 8px;
	font-weight: 700;
}

.tl-card-desc {
	margin: 0;
	opacity: 0.92;
}

/* ---------- Arrow ---------- */

.tl-arrow {
	--tl-arrow-color: #6b7280;
	position: absolute;
	top: 28px;
	width: 0;
	height: 0;
	border-top: 10px solid transparent;
	border-bottom: 10px solid transparent;
}

/* Right-side card: arrow on the left edge, pointing left toward the dot */
.tl-item--right .tl-arrow {
	left: -10px;
	border-right: 10px solid var(--tl-arrow-color);
}

/* Left-side card: arrow on the right edge, pointing right toward the dot */
.tl-item--left .tl-arrow {
	right: -10px;
	border-left: 10px solid var(--tl-arrow-color);
}

/* ---------- Dot ---------- */

.tl-dot-col {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 0 20px;
	padding-top: 30px;
	z-index: 1;
}

.tl-dot {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #6b7280;
	flex-shrink: 0;
	box-sizing: border-box;
}

/* ---------- Mobile: all cards on the right ---------- */

@media (max-width: 767px) {
	.tl-timeline {
		padding-right: 20px;
	}

	.tl-item::before {
		left: 28px;
	}

	.tl-item {
		grid-template-columns: auto 1fr;
	}

	.tl-item--left .tl-card-wrapper {
		grid-column: 2;
		grid-row: 1;
		justify-self: start;
	}

	.tl-item--left .tl-dot-col {
		grid-column: 1;
		grid-row: 1;
	}

	.tl-item--right .tl-card-wrapper {
		grid-column: 2;
	}

	.tl-item--right .tl-dot-col {
		grid-column: 1;
	}

	.tl-item--left .tl-card {
		text-align: left;
	}

	/* All arrows point left on mobile */
	.tl-item--left .tl-arrow {
		right: auto;
		left: -10px;
		border-left: none;
		border-right: 10px solid var(--tl-arrow-color);
	}
}
