/* ==========================================================================
   Lab timeline
   Scoped under .timeline-page. Overrides the generic .timeline rules that
   live in main.css.
   ========================================================================== */

.timeline-page {
	--tl-spine: rgba(255, 255, 255, 0.16);
	--tl-panel: rgba(24, 31, 38, 0.82);
	--tl-panel-hover: rgba(30, 39, 48, 0.92);
	--tl-text: rgba(255, 255, 255, 0.9);
	--tl-pub: #3fc48a;
	--tl-levelup: #56c2e0;
	--tl-member: #ff8f8f;
	--tl-grant: #b294f5;
	--tl-award: #f2b350;
}

.timeline-page .page-header h2 {
	letter-spacing: 0.2em;
}

.timeline-page .timeline {
	padding: 1em 0 3em 0;
}

/*
   The theme pads every list item 16px/48px. With the date and badge absolutely
   positioned and the panel floated, that padding was pure dead space under
   each entry. Spacing is set by margin here instead.
*/
.timeline-page .timeline > li {
	padding: 0;
	margin-bottom: 1.3em;
}

.timeline-page .timeline > li:last-child {
	margin-bottom: 0;
}

/* --- Spine ---------------------------------------------------------------- */

/*
   A flat grey rule reads as a border; a gradient that fades at both ends reads
   as a track the events sit on.
*/
.timeline-page .timeline:before {
	width: 2px;
	margin-left: -1px;
	background: linear-gradient(
		to bottom,
		rgba(255, 255, 255, 0) 0,
		var(--tl-spine) 4%,
		var(--tl-spine) 96%,
		rgba(255, 255, 255, 0) 100%
	);
}

/* --- Year markers --------------------------------------------------------- */

/*
   Padding rather than absolute positioning: the marker has to occupy real
   height, or it collapses and the pill lands on top of the next badge.
*/
.timeline-page .timeline > li.timeline-year {
	position: relative;
	list-style: none;
	margin: 2.25em 0 1.25em 0;
	padding-left: 27%;
	line-height: 1;
}

.timeline-page .timeline > li.timeline-year:before,
.timeline-page .timeline > li.timeline-year:after {
	content: none;
}

.timeline-page .timeline > li.timeline-year > span {
	display: inline-block;
	transform: translateX(-50%);
	padding: 0.35em 1.15em;
	font-size: 0.8em;
	font-weight: 700;
	letter-spacing: 0.22em;
	color: rgba(255, 255, 255, 0.92);
	background: rgba(18, 24, 30, 0.92);
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 20px;
	white-space: nowrap;
}

.timeline-page .timeline > li.timeline-year:first-child {
	margin-top: 0;
}

/* --- Date ----------------------------------------------------------------- */

/* Aligned to the panel's first line of text rather than to a 50px band */
.timeline-page .timeline > li > .timeline-date {
	top: 0;
	height: auto;
	line-height: 1.6;
	padding: 1.1em 1.4em 0 0;
	font-size: 0.85em;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: rgba(255, 255, 255, 0.82);
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
}

/* --- Panel ---------------------------------------------------------------- */

/*
   Translucent rather than solid: the page's background image reads through the
   cards, which ties the whole column together instead of stamping 77 identical
   slate rectangles over it.
*/
.timeline-page .timeline > li > .timeline-panel {
	background: var(--tl-panel);
	-webkit-backdrop-filter: blur(8px) saturate(120%);
	backdrop-filter: blur(8px) saturate(120%);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-left: 3px solid var(--tl-accent, rgba(255, 255, 255, 0.25));
	border-radius: 10px;
	padding: 1.1em 1.3em;
	box-shadow: 0 6px 22px rgba(0, 0, 0, 0.32);
	transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.timeline-page .timeline > li > .timeline-panel:hover {
	background: var(--tl-panel-hover);
	transform: translateX(3px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42);
}

/* The Bootstrap-era arrow notch fought the rounded, translucent card */
.timeline-page .timeline > li > .timeline-panel:before,
.timeline-page .timeline > li > .timeline-panel:after,
.timeline-page .timeline > li.timeline-inverted > .timeline-panel:before,
.timeline-page .timeline > li.timeline-inverted > .timeline-panel:after {
	display: none !important;
}

.timeline-page .timeline-body {
	font-size: 0.95em;
	line-height: 1.6;
	color: var(--tl-text);
}

.timeline-page .timeline-body > p {
	margin: 0;
}

.timeline-page .timeline-body a {
	color: #8fd8f0;
	border-bottom: 1px solid rgba(143, 216, 240, 0.4);
}

.timeline-page .timeline-body a:hover {
	color: #b9e9fa;
	border-bottom-color: #b9e9fa;
}

/* --- Event type pill ------------------------------------------------------ */

/*
   Floated ahead of the paragraph so the text wraps beside it. Previously this
   sat after the paragraph and claimed a line of its own, leaving a band of
   empty panel under every entry.
*/
.timeline-page .timeline-event-type {
	float: right;
	margin: 0.15em 0 0.35em 1em;
	padding: 0.15em 0.7em;
	font-size: 0.68em;
	font-weight: 600;
	font-style: normal;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	white-space: nowrap;
	color: var(--tl-accent, rgba(255, 255, 255, 0.75));
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid var(--tl-accent, rgba(255, 255, 255, 0.25));
	border-radius: 20px;
}

/* --- Badges --------------------------------------------------------------- */

.timeline-page .timeline > li > .timeline-badge {
	width: 42px;
	height: 42px;
	line-height: 42px;
	font-size: 1.1em;
	margin-left: -21px !important;
	top: 9px;
	border: 2px solid rgba(12, 17, 22, 0.85);
	box-shadow: 0 0 0 4px rgba(12, 17, 22, 0.5), 0 4px 14px rgba(0, 0, 0, 0.4);
	transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.timeline-page .timeline > li:hover > .timeline-badge {
	transform: scale(1.12);
	box-shadow: 0 0 0 4px rgba(12, 17, 22, 0.5), 0 0 18px var(--tl-accent, rgba(255, 255, 255, 0.5));
}

/* --- Per-type accents ----------------------------------------------------- */

.timeline-page .timeline > li.tl-pub {
	--tl-accent: var(--tl-pub);
}

.timeline-page .timeline > li.tl-levelup {
	--tl-accent: var(--tl-levelup);
}

.timeline-page .timeline > li.tl-member {
	--tl-accent: var(--tl-member);
}

.timeline-page .timeline > li.tl-grant {
	--tl-accent: var(--tl-grant);
}

.timeline-page .timeline > li.tl-award {
	--tl-accent: var(--tl-award);
}

.timeline-page .timeline > li.tl-pub > .timeline-badge,
.timeline-page .timeline > li.tl-levelup > .timeline-badge,
.timeline-page .timeline > li.tl-member > .timeline-badge,
.timeline-page .timeline > li.tl-grant > .timeline-badge,
.timeline-page .timeline > li.tl-award > .timeline-badge {
	background-color: var(--tl-accent) !important;
	color: #10161c;
}

/* --- Scroll reveal -------------------------------------------------------- */

.timeline-page .timeline > li.tl-reveal {
	opacity: 0;
	transform: translateY(18px);
}

.timeline-page .timeline > li.tl-reveal.is-visible {
	opacity: 1;
	transform: none;
	transition: opacity 0.5s ease, transform 0.5s ease;
}

@media (prefers-reduced-motion: reduce) {
	.timeline-page .timeline > li.tl-reveal,
	.timeline-page .timeline > li.tl-reveal.is-visible {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.timeline-page .timeline > li > .timeline-panel,
	.timeline-page .timeline > li > .timeline-badge {
		transition: none;
	}
}

/* --- Small screens -------------------------------------------------------- */

@media screen and (max-width: 736px) {
	.timeline-page .timeline {
		padding: 0.5em 0 2em 0;
	}

	.timeline-page .timeline > li > .timeline-date {
		font-size: 0.78em;
		margin-bottom: 0.35em;
		padding-right: 0;
		color: rgba(255, 255, 255, 0.72);
	}

	/*
	   main.css sets width:68% !important outside a media query, which beats its
	   own mobile rule and left the cards in a narrow right-hand column with an
	   empty gutter beside them.
	*/
	.timeline-page .timeline > li > .timeline-panel {
		width: 100% !important;
		float: none !important;
		padding: 0.9em 1em;
	}

	.timeline-page .timeline > li {
		margin-bottom: 1.1em;
	}

	.timeline-page .timeline > li.timeline-year {
		margin: 2em 0 1em 0;
	}

	.timeline-page .timeline > li.timeline-year > span {
		position: static;
		transform: none;
		display: inline-block;
	}

	.timeline-page .timeline-event-type {
		font-size: 0.62em;
		margin-left: 0.7em;
	}
}
