/* ==========================================================================
 * Timeline block (Community Process) — from DOC_Alewife_R1.xd, 2026-11-19
 * Desktop grid: [date column | 48px rail with line + dots | content]
 * XD at 1920: dates 30/38 bold, titles 30/35 bold, links 22/30 medium,
 * descriptions 20/28 regular, years 44 bold, photo box 370x230.
 * ========================================================================== */

.block-timeline {
	--tl-date-w: 32%;
	--tl-rail: 48px;
	--tl-line: 2px;
	--tl-bg: #f4f4f4;
	padding: 40px 20px !important;
	color: #000;
}
@media (min-width: 1025px) {
	.block-timeline {
		/* XD: 210px gutters at 1920 -> scale with the screen so it fills full-width windows the same way */
		padding: 6rem clamp(40px, 10.94vw, 210px) !important;
	}
}

.tl-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Header ---------- */
.block-timeline__head {
	display: grid;
	grid-template-columns: var(--tl-date-w) var(--tl-rail) minmax(0, 1fr);
	align-items: start;
	/* XD: ~62px from the button to the first year marker at 1920 */
	margin-bottom: clamp(40px, 3.2vw, 62px);
}
.block-timeline__title {
	grid-column: 1;
	margin: 0;
	font-family: "Cera-Bold";
	font-size: clamp(32px, 2.3vw, 44px);
	line-height: 1.1;
	text-align: right;
	color: #000;
}
.block-timeline__intro {
	grid-column: 3;
	padding-top: 6px;
}
.block-timeline__intro p {
	margin: 0 0 clamp(16px, 1.1vw, 21px);
	font-family: "Cera-Light";
	font-weight: normal;
	font-size: clamp(18px, 1.35vw, 26px);
	line-height: 1.35;
	color: #000;
	text-align: left;
}
.block-timeline__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 208px;
	min-height: 64px;
	padding: 0 24px;
	border: 2px solid #000;
	background: #fff;
	color: #000;
	font-family: "Cera-Bold";
	font-size: 15px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color 0.2s, color 0.2s;
}
.block-timeline__button:hover,
.block-timeline__button:focus-visible {
	background: #000;
	color: #fff;
}

/* ---------- List + vertical line ---------- */
.block-timeline__list {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}
.block-timeline__list::before {
	content: "";
	position: absolute;
	/* start at the centre of the first year marker (half the year font size) so it never peeks above it */
	top: clamp(14px, 1.15vw, 22px);
	bottom: 0;
	left: calc(var(--tl-date-w) + var(--tl-rail) / 2 - var(--tl-line) / 2);
	width: var(--tl-line);
	background: #000;
}

.tl-year,
.tl-event {
	position: relative;
	display: grid;
	grid-template-columns: var(--tl-date-w) var(--tl-rail) minmax(0, 1fr);
	align-items: start;
}

/* ---------- Year markers ---------- */
.tl-year {
	margin: clamp(32px, 3vw, 56px) 0 clamp(8px, 0.6vw, 12px);
}
.tl-year:first-child {
	margin-top: 0;
}
.tl-year__label {
	grid-column: 1;
	grid-row: 1;
	margin: 0;
	font-family: "Cera-Bold";
	font-size: clamp(28px, 2.3vw, 44px);
	line-height: 1;
	text-align: right;
	color: #000;
}
.tl-year__marker {
	grid-column: 2;
	grid-row: 1;
	justify-self: center;
	position: relative;
	z-index: 1;
	width: 20px;
	height: 20px;
	margin-top: calc((1em - 20px) / 2);
	border: 2px solid #000;
	border-radius: 50%;
	background: var(--tl-bg);
	font-size: clamp(28px, 2.3vw, 44px);
}

/* ---------- Events ---------- */
.tl-event {
	margin-bottom: clamp(32px, 2.6vw, 50px);
}
.tl-event__date {
	grid-column: 1;
	font-family: "Cera-Bold";
	font-size: clamp(18px, 1.6vw, 30px);
	line-height: 1.27;
	text-align: right;
}
.tl-event__dot {
	grid-column: 2;
	justify-self: center;
	position: relative;
	z-index: 1;
	width: 10px;
	height: 10px;
	margin-top: calc(clamp(18px, 1.6vw, 30px) * 1.27 / 2 - 5px);
	border-radius: 50%;
	background: #000;
}
/* End the rail at the last event's dot: mask the line below that dot's centre */
.tl-event:last-child::after {
	content: "";
	position: absolute;
	top: calc(clamp(18px, 1.6vw, 30px) * 1.27 / 2);
	bottom: 0;
	left: calc(var(--tl-date-w) + var(--tl-rail) / 2 - var(--tl-line));
	width: calc(var(--tl-line) * 2);
	background: var(--tl-bg);
}
.tl-event__body {
	grid-column: 3;
	min-width: 0;
}
.tl-event.has-photos .tl-event__body {
	display: flex;
	align-items: flex-start;
	gap: 40px;
}
.tl-event__text {
	flex: 1 1 auto;
	min-width: 0;
}
/* "Links below photo": resource rows span the full content width under photo + copy */
.tl-event.links-below .tl-event__body {
	flex-wrap: wrap;
	row-gap: 0;
}
.tl-event.links-below .tl-event__text {
	flex: 1 1 0;
}
.tl-event.links-below .tl-event__body > .tl-event__resources {
	flex: 0 0 100%;
	margin-top: 28px;
}
.tl-event__title {
	margin: 0 0 6px;
	font-family: "Cera-Bold";
	font-size: clamp(20px, 1.6vw, 30px);
	line-height: 1.17;
	color: #000;
}
.tl-event__desc {
	margin: 0 0 16px;
	font-family: "Cera-Light";
	font-weight: normal;
	color: #000;
	text-align: left;
	font-size: clamp(15px, 1.05vw, 20px);
	line-height: 1.4;
}

/* ---------- Resource rows (download / external link) ---------- */
.tl-event__resources {
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}
.tl-event__resources li {
	margin: 0;
	border-top: 1px solid #000;
}
.tl-event__resources li:last-child {
	border-bottom: 1px solid #000;
}
.tl-resource {
	display: block;
	padding: 14px 0;
	color: #000;
	font-family: "Cera-Medium";
	font-size: clamp(16px, 1.15vw, 22px);
	line-height: 1.36;
	text-decoration: none;
	transition: opacity 0.2s;
}
.tl-resource__main {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}
.tl-resource .tl-icon {
	flex: 0 0 auto;
	/* 32px, same as the Resources block icons */
	width: 32px;
	height: 32px;
	transition: transform 0.2s;
}
.tl-resource__desc {
	display: block;
	padding-top: 6px;
	font-family: "Cera-Light";
	font-size: 0.9em;
}
.tl-resource:hover {
	color: #000;
	opacity: 0.55;
}
.tl-resource:hover .tl-icon {
	transform: translate3d(0, 2px, 0);
}
.tl-resource:focus-visible,
.block-timeline__button:focus-visible,
.tl-slider__dots button:focus-visible {
	outline: 2px solid #000;
	outline-offset: 3px;
}

/* ---------- Photo box + mini slider (no autoplay) ---------- */
.tl-event__media {
	flex: 0 0 370px;
	max-width: 370px;
}
.tl-photo {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 370 / 230;
	object-fit: cover;
	background: #e5e5e5;
}
.tl-slider .slick-slide {
	line-height: 0;
}
.tl-slider__dots .slick-dots {
	display: flex;
	justify-content: center;
	gap: 0;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}
.tl-slider__dots .slick-dots li {
	margin: 0;
}
.tl-slider__dots .slick-dots button {
	position: relative;
	display: block;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	background: transparent;
	color: transparent;
	font-size: 0;
	cursor: pointer;
}
.tl-slider__dots .slick-dots button::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #bfbfbf;
	transform: translate(-50%, -50%);
	transition: background-color 0.2s;
}
.tl-slider__dots .slick-dots li.slick-active button::before,
.tl-slider__dots .slick-dots button:hover::before {
	background: #404040;
}

/* ---------- Tablet ---------- */
@media (max-width: 1199px) {
	.block-timeline {
		--tl-date-w: 28%;
	}
	.tl-event.has-photos .tl-event__body {
		flex-direction: column;
		gap: 20px;
	}
	.tl-event__media {
		flex-basis: auto;
		width: 100%;
	}
	.tl-event.links-below .tl-event__body > .tl-event__resources {
		flex-basis: auto;
		margin-top: 0;
	}
}

/* ---------- Mobile: rail on the left, date above the title ---------- */
@media (max-width: 767px) {
	.block-timeline {
		--tl-rail: 28px;
	}
	.block-timeline__head {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 16px;
	}
	.block-timeline__title {
		text-align: left;
	}
	.block-timeline__intro {
		grid-column: 1;
		padding-top: 0;
	}
	.block-timeline__list::before {
		left: calc(var(--tl-rail) / 2 - var(--tl-line) / 2);
	}
	.tl-year,
	.tl-event {
		grid-template-columns: var(--tl-rail) minmax(0, 1fr);
		column-gap: 12px;
	}
	.tl-year__label {
		grid-column: 2;
		text-align: left;
	}
	.tl-year__marker {
		grid-column: 1;
	}
	.tl-event__date {
		grid-column: 2;
		grid-row: 1;
		margin-bottom: 4px;
		text-align: left;
		font-size: 17px;
	}
	.tl-event__date-br {
		display: none;
	}
	.tl-event__dot {
		grid-column: 1;
		grid-row: 1;
		margin-top: calc(17px * 1.27 / 2 - 5px);
	}
	.tl-event:last-child::after {
		top: calc(17px * 1.27 / 2);
		left: calc(var(--tl-rail) / 2 - var(--tl-line));
	}
	.tl-event__body {
		grid-column: 2;
		grid-row: 2;
	}
	.tl-event__media {
		max-width: none;
	}
}
