/* Timeline Lite. Inherits your theme's fonts and text colour; override the custom properties below to restyle. */

.tlite {
	--tlite-accent: #ff6b6b;
	--tlite-surface: #fff; /* Ring around markers; set to your page background on dark themes. */
	--tlite-line: #d4d4d4;
	--tlite-muted: #6b6b6b;
	--tlite-card: rgba(127, 127, 127, .07);
	--tlite-gap: 2.5em;
	margin: 2em 0;
}
@supports (color: color-mix(in srgb, red, blue)) {
	.tlite {
		--tlite-line: color-mix(in srgb, currentColor 22%, transparent);
		--tlite-muted: color-mix(in srgb, currentColor 65%, transparent);
	}
}

.tlite__list { list-style: none; margin: 0; padding: 0; }
.tlite__list > li { margin: 0; }
.tlite .tlite__title { margin: 0 0 .5em; font-size: 1.5em; line-height: 1.2; }
.tlite__date {
	display: block;
	color: var(--tlite-muted);
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .18em;
	line-height: 1.4;
	text-transform: uppercase;
}
.tlite__img { margin: 0 0 1em; }
.tlite__img img { display: block; max-width: 100%; height: auto; border-radius: 5px; }
.tlite__text > :first-child { margin-top: 0; }
.tlite__text > :last-child { margin-bottom: 0; }
.tlite :focus-visible { outline: 3px solid var(--tlite-accent); outline-offset: 3px; }
.tlite-empty { padding: .75em 1em; border: 1px dashed currentColor; opacity: .7; }

/* ---------- Vertical layouts (1, 2, 3, 7): shared mobile-first base ---------- */

.tlite--vertical-1 .tlite__item,
.tlite--vertical-2 .tlite__item,
.tlite--vertical-3 .tlite__item,
.tlite--vertical-7 .tlite__item {
	display: grid;
	grid-template-columns: var(--tlite-rail, 20px) minmax(0, 1fr);
	column-gap: 1.25em;
}
.tlite__marker { position: relative; grid-column: 1; grid-row: 1 / span 2; }
.tlite__item > .tlite__date { grid-column: 2; grid-row: 1; margin-bottom: .5em; }
.tlite__item > .tlite__body { grid-column: 2; grid-row: 2; padding-bottom: var(--tlite-gap); }
.tlite__item:last-child > .tlite__body { padding-bottom: 0; }

/* Dot and dashed line. */
.tlite__marker::before {
	content: "";
	position: absolute;
	top: 1px;
	left: 50%;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--tlite-accent);
	box-shadow: 0 0 0 3px var(--tlite-surface);
	transform: translateX(-50%);
}
.tlite__marker::after {
	content: "";
	position: absolute;
	top: 22px;
	bottom: -2px;
	left: 50%;
	border-left: 1px dashed var(--tlite-line);
}
.tlite__item:last-child > .tlite__marker::after { display: none; }

/* Vertical 2: dates in their own column. */
@media (min-width: 640px) {
	.tlite--vertical-2 .tlite__item { grid-template-columns: minmax(7em, 22%) 20px minmax(0, 1fr); }
	.tlite--vertical-2 .tlite__marker { grid-column: 2; grid-row: 1; }
	.tlite--vertical-2 .tlite__item > .tlite__date { grid-column: 1; grid-row: 1; margin: 0; padding-top: .2em; text-align: right; }
	.tlite--vertical-2 .tlite__item > .tlite__body { grid-column: 3; grid-row: 1; }
}

/* Vertical 3 and 7: alternating sides. */
@media (min-width: 782px) {
	.tlite--vertical-3 .tlite__item,
	.tlite--vertical-7 .tlite__item { grid-template-columns: minmax(0, 1fr) var(--tlite-rail, 20px) minmax(0, 1fr); column-gap: 2em; }
	.tlite--vertical-3 .tlite__marker,
	.tlite--vertical-7 .tlite__marker { grid-column: 2; grid-row: 1; }
	.tlite--vertical-3 .tlite__item > .tlite__date,
	.tlite--vertical-7 .tlite__item > .tlite__date { grid-row: 1; grid-column: 1; margin: 0; padding-top: .2em; text-align: right; }
	.tlite--vertical-3 .tlite__item > .tlite__body,
	.tlite--vertical-7 .tlite__item > .tlite__body { grid-row: 1; grid-column: 3; }

	.tlite--vertical-3 .tlite__item:nth-child(even) > .tlite__date,
	.tlite--vertical-7 .tlite__item:nth-child(even) > .tlite__date { grid-column: 3; text-align: left; }
	.tlite--vertical-3 .tlite__item:nth-child(even) > .tlite__body,
	.tlite--vertical-7 .tlite__item:nth-child(even) > .tlite__body { grid-column: 1; text-align: right; }
	.tlite--vertical-3 .tlite__item:nth-child(even) .tlite__img img { margin-left: auto; }
}

/* Vertical 7: icon discs on a solid rail, content in cards. */
.tlite--vertical-7 { --tlite-rail: 44px; }
.tlite--vertical-7 .tlite__marker::before { top: 0; width: 44px; height: 44px; box-shadow: 0 0 0 4px var(--tlite-surface); }
.tlite--vertical-7 .tlite__marker::after { top: 44px; bottom: 0; border-left: 3px solid var(--tlite-line); transform: translateX(-1px); }
.tlite--vertical-7 .tlite__item:last-child > .tlite__marker::after { display: block; bottom: auto; height: 1.5em; }
.tlite--vertical-7 .tlite__marker > * {
	position: absolute;
	z-index: 1;
	top: 0;
	left: 50%;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	color: #fff;
	font-size: 18px;
	line-height: 1;
	transform: translateX(-50%);
}
.tlite--vertical-7 .tlite__item > .tlite__date { padding-top: .9em; }
.tlite--vertical-7 .tlite__item > .tlite__body {
	margin-bottom: var(--tlite-gap);
	padding: 1.25em 1.5em;
	border-radius: 6px;
	background: var(--tlite-card);
}
.tlite--vertical-7 .tlite__item:last-child > .tlite__body { margin-bottom: 0; }
@media (min-width: 782px) {
	.tlite--vertical-7 .tlite__item:nth-child(even) .tlite__img img { margin-left: auto; }
}

/* Entrance, added by timeline.js to items below the fold only. */
.tlite--vertical-7 .tlite__item.is-hidden > * { opacity: 0; }
.tlite--vertical-7 .tlite__item.is-in > .tlite__marker { animation: tlite-pop .5s ease-out both; }
.tlite--vertical-7 .tlite__item.is-in > .tlite__body,
.tlite--vertical-7 .tlite__item.is-in > .tlite__date { animation: tlite-rise .6s ease-out both; }
@keyframes tlite-pop { 0% { opacity: 0; transform: scale(.5); } 70% { transform: scale(1.12); } 100% { opacity: 1; transform: none; } }
@keyframes tlite-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- Vertical 9: expandable list (native <details>, no JS) ---------- */

.tlite--vertical-9 .tlite__item {
	position: relative;
	padding: 0 0 1.25em 2em;
	border-left: 2px solid var(--tlite-line);
}
.tlite--vertical-9 .tlite__item:last-child { padding-bottom: 0; border-left-color: transparent; }
.tlite--vertical-9 .tlite__item::before {
	content: "";
	position: absolute;
	top: .25em;
	left: -9px;
	width: 12px;
	height: 12px;
	border: 2px solid var(--tlite-accent);
	border-radius: 50%;
	background: var(--tlite-surface);
}
.tlite--vertical-9 .tlite__item:has(details[open])::before { background: var(--tlite-accent); }
.tlite--vertical-9 summary {
	position: relative;
	display: block;
	padding-right: 2em;
	cursor: pointer;
	list-style: none;
}
.tlite--vertical-9 summary::-webkit-details-marker { display: none; }
.tlite--vertical-9 summary .tlite__title { margin: .15em 0 0; }
.tlite--vertical-9 summary::after {
	content: "";
	position: absolute;
	top: .5em;
	right: .4em;
	width: .55em;
	height: .55em;
	border: solid currentColor;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	transition: transform .2s;
}
.tlite--vertical-9 details[open] summary::after { transform: translateY(.25em) rotate(-135deg); }
.tlite--vertical-9 .tlite__body { padding-top: .75em; }

/* ---------- Horizontal 6: image panels that widen on hover or focus ---------- */

.tlite--horizontal-6 .tlite__panels {
	display: flex;
	min-height: var(--tlite-panel-height, 600px);
	overflow: hidden;
	background: #111;
	color: #fff;
}
.tlite__panel {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
	overflow: hidden;
	background: center / cover no-repeat;
	transition: flex-grow .5s ease;
}
.tlite__panel::before,
.tlite__panel::after { content: ""; position: absolute; inset: 0; transition: opacity .5s ease; }
.tlite__panel::after { background: rgba(3, 22, 37, .85); }
.tlite__panel::before { z-index: 1; opacity: 0; background: linear-gradient(to bottom, transparent 20%, #000 85%); }
.tlite__panel > * { position: relative; z-index: 2; }
.tlite__panel > .tlite__date {
	padding: clamp(2rem, 10vh, 5rem) 1em 0;
	color: #fff;
	font-size: clamp(1.5rem, 3vw, 2.5rem);
	letter-spacing: .05em;
	text-align: center;
	transition: opacity .4s;
}
.tlite__panel > .tlite__body {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 1.5em;
	opacity: 0;
	transform: translateY(20px);
	transition: opacity .5s ease .15s, transform .5s ease .15s;
}
.tlite__panel .tlite__title { color: inherit; }
.tlite__panel:focus-visible { outline-offset: -3px; }
.tlite__panel:hover,
.tlite__panel:focus-within { flex-grow: 1.6; }
.tlite__panel:hover::after,
.tlite__panel:focus-within::after { opacity: 0; }
.tlite__panel:hover::before,
.tlite__panel:focus-within::before { opacity: .85; }
.tlite__panel:hover > .tlite__body,
.tlite__panel:focus-within > .tlite__body { opacity: 1; transform: none; }
.tlite__panel:hover > .tlite__date,
.tlite__panel:focus-within > .tlite__date { opacity: .9; }

/* Touch screens and narrow screens: stack, and always show the text. */
@media (max-width: 700px), (hover: none) {
	.tlite--horizontal-6 .tlite__panels { flex-direction: column; min-height: 0; }
	.tlite__panel { min-height: 340px; }
	.tlite__panel::after { opacity: .35; }
	.tlite__panel::before { opacity: .85; }
	.tlite__panel > .tlite__date { padding-top: 1.25em; text-align: left; padding-left: 1.5rem; }
	.tlite__panel > .tlite__body { opacity: 1; transform: none; }
}

/* ---------- Horizontal 9: date tabs ---------- */

.tlite__tabs { display: none; }
.tlite--horizontal-9.is-ready .tlite__tabs {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	margin-bottom: 2em;
	overflow-x: auto;
	/* The rail through the dots; "local" makes it scroll with the tabs. */
	background: linear-gradient(var(--tlite-line), var(--tlite-line)) 0 calc(1.25rem + 15px) / 100% 2px no-repeat local;
}
.tlite__tab {
	display: flex;
	flex: 1 0 6em;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0 0 .25em;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}
.tlite__tab::before {
	content: "";
	order: 2;
	width: 12px;
	height: 12px;
	border: 2px solid var(--tlite-accent);
	border-radius: 50%;
	background: var(--tlite-surface);
	transition: transform .2s, background .2s;
}
.tlite__tab-date { order: 1; height: 1.25rem; font-size: .8rem; font-weight: 700; line-height: 1.25rem; letter-spacing: .08em; }
.tlite__tab-title { order: 3; max-width: 11em; color: var(--tlite-muted); font-size: .8rem; line-height: 1.3; text-align: center; }
.tlite__tab[aria-selected="true"]::before { background: var(--tlite-accent); transform: scale(1.35); }
.tlite__tab[aria-selected="true"] .tlite__tab-date { color: var(--tlite-accent); }
.tlite__tab:focus-visible { outline-offset: 2px; }
@media (max-width: 600px) { .tlite__tab-title { display: none; } }

.tlite__pane { display: grid; gap: 1.5em 2em; margin-bottom: 2em; }
.tlite__pane[hidden] { display: none; }
.tlite__pane:has(.tlite__img) { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
.tlite__pane .tlite__img { margin: 0; }
.tlite__pane .tlite__date { margin-bottom: .4em; }
.tlite--horizontal-9.is-ready .tlite__pane { margin-bottom: 0; animation: tlite-fade .3s ease-out; }
@keyframes tlite-fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 600px) { .tlite__pane:has(.tlite__img) { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
	.tlite *, .tlite *::before, .tlite *::after { transition: none !important; animation: none !important; }
}
