/* ==========================================================================
   Timeline Block
   ========================================================================== */

/* Block inner — centres the heading & textarea */
.timeline-block .block-inner {
	text-align: center;
}

/* Heading */
.timeline-block .heading {
}

/* Intro textarea below heading */
.timeline-block > .block-inner > .textarea {
	max-width: 780px;
	margin: 0 auto var(--margin-bottom-l);
}

.timeline-block .heading + .textarea {
}

/* ==========================================================================
   Timeline layout — 3-column grid
   ========================================================================== */

.timeline {
	position: relative;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	margin-top: var(--gutter-xl);
	text-align: left;
}

/* ==========================================================================
   Entry row
   ========================================================================== */

.timeline__entry {
	position: relative;
	display: grid;
	grid-template-columns: subgrid;
	grid-column: 1 / -1;
	align-items: center;
	padding: var(--gutter-xl) 0;
}

/* Continuous vertical line through the centre column */
.timeline__entry::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 0;
	bottom: 0;
	width: 2px;
	background: color-mix(in srgb, currentColor 12%, transparent);
	transform: translateX(-50%);
	z-index: 0;
}

.timeline__entry--first {
	padding-top: 0;
}

.timeline__entry--last {
	padding-bottom: 0;
}

/* ==========================================================================
   Card
   ========================================================================== */

.timeline__card {
	background: #f5f5f5;
	border-radius: var(--border-radius);
	padding: var(--gutter-l) var(--gutter-m);
	max-width: 420px;
    border: 1px solid #ececec;
}

.timeline__card-heading {
	font-size: var(--font-xl);
	font-weight: 600;
	margin-bottom: var(--margin-bottom-xs);
}
.timeline__entry--last .timeline__card-heading {
color: #244f76;
}

.timeline__card-text {
	font-size: var(--font-s);
}

.timeline__card-text *:last-child {
	margin-bottom: 0;
}

/* Last entry card — light tint */
.timeline__entry--last .timeline__card {
	background: #f3f8fe;
	border: 1px solid #244f76;
}

/* ==========================================================================
   Date — large display year
   ========================================================================== */

.timeline__date {
	font-family: "adobe-garamond-pro", serif;
	font-size: 4.8rem;
	line-height: 1;
	opacity: 0;
	color: #093e6e;
}

.timeline__date.sal-animate {
	opacity: 0.22;
}

/* ==========================================================================
   Marker — centred on the vertical line
   ========================================================================== */

.timeline__marker {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--colour-white);
	border: 2px solid color-mix(in srgb, var(--colour-dark-blue) 30%, transparent);
	justify-self: center;
}

.timeline__marker-star {
	font-size: 12px;
	line-height: 1;
	color: color-mix(in srgb, var(--colour-dark-blue) 50%, transparent);
}

/* ==========================================================================
   Alternating layout — odd entries: card LEFT, date RIGHT
   ========================================================================== */

/* Card on the left, date on the right (default / odd rows) */
.timeline__entry--left .timeline__card {
	grid-column: 1;
	justify-self: end;
	text-align: right;
}

.timeline__entry--left .timeline__marker {
	grid-column: 2;
}

.timeline__entry--left .timeline__date {
	grid-column: 3;
	padding-left: var(--gutter-l);
}

/* Even entries: date LEFT, card RIGHT */
.timeline__entry--right .timeline__date {
	grid-column: 1;
	grid-row: 1;
	text-align: right;
	padding-right: var(--gutter-l);
}

.timeline__entry--right .timeline__marker {
	grid-column: 2;
	grid-row: 1;
}

.timeline__entry--right .timeline__card {
	grid-column: 3;
	grid-row: 1;
	justify-self: start;
	text-align: left;
}

/* ==========================================================================
   Responsive — collapse to single column
   ========================================================================== */

@media all and (max-width: 768px) {

	.timeline {
		grid-template-columns: auto 1fr;
	}

	.timeline__entry::before {
		left: 12px;
		transform: none;
	}

	.timeline__entry {
		display: grid;
		grid-template-columns: auto 1fr;
		grid-template-rows: auto auto;
		column-gap: var(--gutter);
		padding: var(--gutter) 0;
	}

	.timeline__entry--first {
		padding-top: 0;
	}

	.timeline__entry--last {
		padding-bottom: 0;
	}

	/* Marker always in column 1 */
	.timeline__entry--left .timeline__marker,
	.timeline__entry--right .timeline__marker {
		grid-column: 1;
		grid-row: 1 / 3;
		align-self: start;
		margin-top: 4px;
	}

	/* Date always in column 2, row 1 */
	.timeline__entry--left .timeline__date,
	.timeline__entry--right .timeline__date {
		grid-column: 2;
		grid-row: 1;
		padding: 0;
		text-align: left;
		font-size: clamp(2rem, 8vw, 3rem);
	}

	/* Card always in column 2, row 2 */
	.timeline__entry--left .timeline__card,
	.timeline__entry--right .timeline__card {
		grid-column: 2;
		grid-row: 2;
		justify-self: start;
		text-align: left;
		max-width: 100%;
		margin-top: var(--gutter-s);
	}
}
