/**
 * Timeline index only — loaded via <link> on timeline routes (see BaseLayout extraStylesheets).
 * Relies on design tokens from global.css (load global first).
 * Spine markers use --app-accent-secondary-color (teal, not action blue).
 */

.timeline-shell {
	max-width: 46rem;
}

.timeline-era-block + .timeline-era-block {
	margin-top: 2rem;
}

.timeline-era-title {
	margin: 1.5rem 0 0.85rem;
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--app-muted-color);
	border-bottom: 1px solid var(--app-border-color);
	padding-bottom: 0.35rem;
}

.timeline-year-jump-target {
	display: block;
	height: 0;
	width: 0;
	overflow: hidden;
	scroll-margin-top: 0.75rem;
	pointer-events: none;
}

.timeline-era-block:first-child .timeline-era-title {
	margin-top: 0.25rem;
}

.timeline-track {
	list-style: none;
	margin: 0;
	padding: 0 0 0.25rem;
	border-left: 2px solid var(--app-border-color);
	margin-left: 0.55rem;
}

.timeline-item {
	position: relative;
	padding: 0 0 1.35rem 1.2rem;
	scroll-margin-top: 0.75rem;
}

.timeline-item:last-child {
	padding-bottom: 0;
}

.timeline-item__marker {
	position: absolute;
	left: 0;
	top: 0.72rem;
	width: 11px;
	height: 11px;
	margin-left: calc(-0.55rem - -2.5px);
	border-radius: 50%;
	background: var(--app-accent-secondary-color);
	box-shadow: 0 0 0 3px var(--app-bg-color);
	z-index: 3;
}

.timeline-item__card {
	position: relative;
	overflow: visible;
	scroll-margin-top: inherit;
	margin-bottom: 0;
	border: 1px solid var(--app-border-color);
}

/* Speech-bubble “tail” toward the spine (mobile — spine left of card) */
.timeline-item__card::before {
	content: '';
	position: absolute;
	width: 9px;
	height: 9px;
	left: 0;
	top: calc(0.72rem + 5.5px - 4.5px);
	margin-left: -5px;
	box-sizing: border-box;
	background: var(--app-surface-color);
	border: 1px solid var(--app-border-color);
	border-right: none;
	border-top: none;
	transform: rotate(45deg);
	z-index: 2;
	pointer-events: none;
}

.timeline-item__date {
	margin: 0;
	font-size: 0.88rem;
}

.timeline-item__title {
	margin: 0.2rem 0 0.35rem;
	font-size: 1.12rem;
	line-height: 1.25;
	font-weight: 600;
}

.timeline-item__summary {
	margin: 0;
}

.timeline-item__related {
	margin: 0.65rem 0 0;
	padding-top: 0.55rem;
	border-top: 1px solid color-mix(in srgb, var(--app-border-color) 82%, transparent);
	font-size: 0.9rem;
}

@media (min-width: 690px) {
	.timeline-shell {
		max-width: min(56rem, 94vw);
	}

	.timeline-track {
		position: relative;
		border-left: none;
		margin-left: 0;
		padding: 0.35rem 0 0.25rem;
	}

	.timeline-track::before {
		content: '';
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
		top: 0;
		bottom: 0;
		width: 2px;
		background: var(--app-border-color);
		z-index: 0;
	}

	.timeline-item {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 2.75rem minmax(0, 1fr);
		gap: 0 0.65rem;
		align-items: start;
		padding: 0 0 1.75rem;
	}

	.timeline-item__marker {
		position: relative;
		left: auto;
		top: 0.72rem;
		margin-left: 0;
		grid-column: 2;
		grid-row: 1;
		justify-self: center;
		align-self: start;
		z-index: 3;
	}

	.timeline-item--left .timeline-item__card {
		grid-column: 1;
		grid-row: 1;
		justify-self: end;
		max-width: 22rem;
		width: 100%;
	}

	.timeline-item--right .timeline-item__card {
		grid-column: 3;
		grid-row: 1;
		justify-self: start;
		max-width: 22rem;
		width: 100%;
	}

	.timeline-item--right .timeline-item__card::before {
		left: 0;
		right: auto;
		top: calc(0.72rem + 5.5px - 4.5px);
		margin-left: -5px;
		margin-right: 0;
		border-right: none;
		border-top: none;
		border-bottom: 1px solid var(--app-border-color);
		border-left: 1px solid var(--app-border-color);
		transform: rotate(45deg);
	}

	.timeline-item--left .timeline-item__card::before {
		left: auto;
		right: 0;
		top: calc(0.72rem + 5.5px - 4.5px);
		margin-right: -5px;
		margin-left: 0;
		border-left: none;
		border-bottom: none;
		border-top: 1px solid var(--app-border-color);
		border-right: 1px solid var(--app-border-color);
		transform: rotate(45deg);
	}

	.timeline-era-title {
		text-align: center;
	}
}
