/* Page Sections — Timeline */

.ps-timeline {
	background: var(--cream);
	/* Pre-reveal items are translated ±24px on the x-axis; keep that from
	   creating a horizontal scrollbar. */
	overflow-x: hidden;
	overflow-x: clip;
}

.ps-timeline__head {
	text-align: center;
	justify-content: center;
	margin-bottom: 48px;
}

.ps-timeline__head h2 {
	margin: 0 0 12px;
}

.ps-timeline__intro {
	margin: 0 auto;
	max-width: 60ch;
	color: var(--grey-700, #555);
	font-size: 1rem;
	line-height: 1.55;
}

/* List wrapper holds the vertical line */
.ps-timeline__list {
	list-style: none;
	margin: 0 auto;
	padding: 0;
	position: relative;
	max-width: 980px;
}

.ps-timeline__list::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--sand);
	border-radius: 2px;
}

/* Centered: line down the middle */
.ps-timeline--centered .ps-timeline__list::before {
	left: 50%;
	transform: translateX(-50%);
}

/* Left: line near the left edge */
.ps-timeline--left .ps-timeline__list::before {
	left: 24px;
}

/* Item is a grid row positioned around the line */
.ps-timeline__item {
	position: relative;
	margin: 0 0 48px;
	display: flex;
	width: 100%;
}

.ps-timeline__item:last-child {
	margin-bottom: 0;
}

/* Centered layout — zigzag left / right */
.ps-timeline--centered .ps-timeline__item--left {
	justify-content: flex-start;
	padding-right: calc(50% + 32px);
}

.ps-timeline--centered .ps-timeline__item--right {
	justify-content: flex-end;
	padding-left: calc(50% + 32px);
}

/* Left layout — every card sits to the right of the line */
.ps-timeline--left .ps-timeline__item {
	justify-content: flex-start;
	padding-left: 72px;
}

/* Marker on the line */
.ps-timeline__marker {
	position: absolute;
	top: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--teal);
	color: var(--cream);
	border-radius: 50%;
	z-index: 2;
}

.ps-timeline__marker--dot {
	width: 16px;
	height: 16px;
}

.ps-timeline__marker--icon {
	width: 36px;
	height: 36px;
	background: var(--cream);
	border: 2px solid var(--teal);
	color: var(--teal);
	box-shadow: 0 0 0 4px var(--cream);
}

.ps-timeline__icon {
	width: 18px;
	height: 18px;
	display: block;
}

.ps-timeline--centered .ps-timeline__marker {
	left: 50%;
	transform: translateX(-50%);
}

.ps-timeline--left .ps-timeline__marker {
	left: 24px;
	transform: translateX(-50%);
}

/* Card */
.ps-timeline__card {
	position: relative;
	background: #fff;
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-card);
	padding: 24px;
	max-width: 460px;
	width: 100%;
}

/* Cap card width to half the rail in centered mode */
.ps-timeline--centered .ps-timeline__card {
	max-width: 100%;
}

/* Notch pointing toward the line (centered mode only) */
.ps-timeline--centered .ps-timeline__item--left .ps-timeline__card::after,
.ps-timeline--centered .ps-timeline__item--right .ps-timeline__card::after {
	content: "";
	position: absolute;
	top: 24px;
	width: 0;
	height: 0;
	border-style: solid;
}

.ps-timeline--centered .ps-timeline__item--left .ps-timeline__card::after {
	right: -10px;
	border-width: 8px 0 8px 10px;
	border-color: transparent transparent transparent #fff;
}

.ps-timeline--centered .ps-timeline__item--right .ps-timeline__card::after {
	left: -10px;
	border-width: 8px 10px 8px 0;
	border-color: transparent #fff transparent transparent;
}

/* Notch for left layout (always points left) */
.ps-timeline--left .ps-timeline__card::after {
	content: "";
	position: absolute;
	top: 24px;
	left: -10px;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 8px 10px 8px 0;
	border-color: transparent #fff transparent transparent;
}

.ps-timeline__figure {
	margin: 0 0 16px;
	border-radius: 6px;
	overflow: hidden;
	background: var(--sand);
}

.ps-timeline__img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 6px;
}

.ps-timeline__year {
	display: inline-block;
	font-family: var(--font-heading);
	color: var(--red);
	font-size: 1.1rem;
	line-height: 1;
	margin: 0 0 8px;
	letter-spacing: 0.01em;
}

.ps-timeline__title {
	font-family: var(--font-heading);
	font-size: clamp(1.3rem, 1.6vw, 1.5rem);
	line-height: 1.25;
	color: var(--teal);
	margin: 0 0 8px;
	font-weight: 400;
}

.ps-timeline__text {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.55;
	color: var(--grey-700, #555);
}

/* Desktop — roomier cards, more breathing room between line and content */
@media (min-width: 1024px) {
	.ps-timeline__head { margin-bottom: 44px; }
	.ps-timeline__intro { font-size: 1.04rem; }
	.ps-timeline__item { margin-bottom: 44px; }
	.ps-timeline__card { padding: 26px; }
	.ps-timeline--centered .ps-timeline__item--left { padding-right: calc(50% + 36px); }
	.ps-timeline--centered .ps-timeline__item--right { padding-left: calc(50% + 36px); }
	.ps-timeline--left .ps-timeline__item { padding-left: 80px; }
	.ps-timeline__text { font-size: 0.98rem; }
}

@media (min-width: 1280px) {
	.ps-timeline__list { max-width: 1040px; }
	.ps-timeline__card { padding: 30px; }
	.ps-timeline--centered .ps-timeline__item--left { padding-right: calc(50% + 44px); }
	.ps-timeline--centered .ps-timeline__item--right { padding-left: calc(50% + 44px); }
}

/* Tablet portrait/landscape — keep centered mode but tighten gap; cards stay readable */
@media (min-width: 861px) and (max-width: 1023px) {
	.ps-timeline--centered .ps-timeline__item--left { padding-right: calc(50% + 24px); }
	.ps-timeline--centered .ps-timeline__item--right { padding-left: calc(50% + 24px); }
	.ps-timeline__card { padding: 22px; }
}

/* Reveal animation (JS adds .is-revealed) */
@media (prefers-reduced-motion: no-preference) {
	.ps-timeline__item {
		opacity: 0;
		transform: translateY(24px);
		transition: opacity .6s ease-out, transform .6s ease-out;
	}

	.ps-timeline--centered .ps-timeline__item--left {
		transform: translate(-24px, 0);
	}

	.ps-timeline--centered .ps-timeline__item--right {
		transform: translate(24px, 0);
	}

	.ps-timeline__item.is-revealed {
		opacity: 1;
		transform: translate(0, 0);
	}
}

/* Tablet: collapse centered into left-aligned mode */
@media (max-width: 860px) {
	.ps-timeline--centered .ps-timeline__list::before,
	.ps-timeline--left .ps-timeline__list::before {
		left: 20px;
		transform: none;
	}

	.ps-timeline--centered .ps-timeline__item,
	.ps-timeline--left .ps-timeline__item {
		justify-content: flex-start;
		padding: 0 0 0 60px;
	}

	.ps-timeline--centered .ps-timeline__marker,
	.ps-timeline--left .ps-timeline__marker {
		left: 20px;
		transform: translateX(-50%);
	}

	.ps-timeline--centered .ps-timeline__marker--dot,
	.ps-timeline--left .ps-timeline__marker--dot {
		width: 14px;
		height: 14px;
	}

	.ps-timeline--centered .ps-timeline__marker--icon,
	.ps-timeline--left .ps-timeline__marker--icon {
		width: 32px;
		height: 32px;
		box-shadow: 0 0 0 3px var(--cream);
	}

	/* Always point left when collapsed */
	.ps-timeline--centered .ps-timeline__item--left .ps-timeline__card::after,
	.ps-timeline--centered .ps-timeline__item--right .ps-timeline__card::after,
	.ps-timeline--left .ps-timeline__card::after {
		right: auto;
		left: -10px;
		border-width: 8px 10px 8px 0;
		border-color: transparent #fff transparent transparent;
	}

	.ps-timeline__card {
		max-width: 100%;
	}

	/* Reset reveal X-offset on small screens — slide from below only */
	@media (prefers-reduced-motion: no-preference) {
		.ps-timeline--centered .ps-timeline__item--left,
		.ps-timeline--centered .ps-timeline__item--right {
			transform: translateY(24px);
		}
		.ps-timeline__item.is-revealed {
			transform: translate(0, 0);
		}
	}
}

@media (max-width: 479px) {
	.ps-timeline__item {
		margin-bottom: 32px;
	}

	.ps-timeline--centered .ps-timeline__item,
	.ps-timeline--left .ps-timeline__item {
		padding-left: 48px;
	}

	.ps-timeline--centered .ps-timeline__list::before,
	.ps-timeline--left .ps-timeline__list::before {
		left: 16px;
	}

	.ps-timeline--centered .ps-timeline__marker,
	.ps-timeline--left .ps-timeline__marker {
		left: 16px;
	}

	.ps-timeline__card {
		padding: 18px;
	}

	.ps-timeline__year {
		font-size: 1rem;
	}

	.ps-timeline__title {
		font-size: 1.15rem;
	}

	.ps-timeline__text {
		font-size: 0.9rem;
	}
}
