/* ==========================================================================
   Centered Vertical Timeline — Library History page
   Single ordered flow (chronological, alternating left/right) — condensed
   and overlapped so consecutive entries visually interleave/stagger
   instead of stacking full-height one after another. Left and right cards
   occupy opposite horizontal halves, so vertical overlap between them
   never visually collides — this compresses total page height while
   preserving strict document order (no read-order confusion).
   ========================================================================== */

.gp-timeline {
	position: relative;
	max-width: 900px;
	margin: 2rem auto;
	padding: 1rem 0;
}

/* Center vertical line */
.gp-timeline::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 2px;
	background: #e2e2e2;
	transform: translateX(-50%);
}

.timeline-item {
	position: relative;
	width: 100%;
	display: flex;
	margin-top: -2.75rem; /* pulls each entry up into the previous one's space to stagger/overlap */
}

.timeline-item:first-child {
	margin-top: 0;
}

.timeline-item.is-left {
	justify-content: flex-start;
}
.timeline-item.is-right {
	justify-content: flex-end;
}

.timeline-item-content {
	width: calc(50% - 3rem);
	background: #fff;
	border-radius: 10px;
	padding: 0.85rem 1.1rem;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
	margin-left: 0 !important;
	margin-right: 0 !important;
	position: relative;
	z-index: 1;
}

.timeline-item-content h3 {
	margin: 0.15rem 0 0.4rem;
	font-size: 1.05rem;
}

.timeline-item-content p {
	margin: 0 0 0.4rem;
	font-size: 0.92rem;
	line-height: 1.45;
}

.timeline-item-content p:last-child {
	margin-bottom: 0;
}

.timeline-item-image img {
	border-radius: 6px;
	max-width: 100%;
	height: auto;
	margin-bottom: 0.5rem;
	max-height: 160px;
	object-fit: cover;
}

.timeline-item-year {
	display: inline-block;
	margin: 0 0 0.2rem !important;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--wp--preset--color--blue, #00498E);
}

/* Dot marker on the line */
.timeline-item-marker {
	position: absolute;
	left: 50%;
	top: 1.1rem;
	transform: translate(-50%, -50%);
	z-index: 2;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #fff;
	border: 3px solid var(--wp--preset--color--blue, #00498E);
	margin: 0 !important;
}

/* Mobile: collapse to a single left-aligned column, line moves to the left edge.
   No overlap on mobile — full-height stacked cards read more reliably at
   narrow widths where horizontal overlap protection no longer applies. */
@media (max-width: 700px) {
	.gp-timeline::before {
		left: 20px;
		transform: none;
	}

	.timeline-item {
		margin-top: 1.25rem !important;
		justify-content: flex-start;
		padding-left: 2.75rem;
	}

	.timeline-item:first-child {
		margin-top: 0 !important;
	}

	.timeline-item-content {
		width: 100%;
	}

	.timeline-item-marker {
		left: 20px;
		top: 1.1rem;
		transform: translate(-50%, -50%);
	}
}
