/* =========================================================
   SPA Timeline — Divi module
   All selectors are scoped under .mw_spa_timeline so this CSS
   cannot collide with anything else on the site. Brand tokens
   are sampled from the live /who-we-are/ stylesheet so it
   blends with the rest of the page.
   ========================================================= */

.mw_spa_timeline {
	--mwspa-navy:      #203d71;
	--mwspa-navy-2:    #40589c;
	--mwspa-blue:      #3d5898;
	--mwspa-green:     #92d050;
	--mwspa-green-2:   #6fa432;
	--mwspa-sky:       #a3dff9;
	--mwspa-sky-deep:  #2da3e7;
	--mwspa-ink:       #222222;
	--mwspa-body:      #333333;
	--mwspa-slate:     #4a5468;
	--mwspa-rule:      #e6e9f0;
	--mwspa-paper:     #ffffff;
	--mwspa-bar:       10px;
	--mwspa-ease:      cubic-bezier(.2,.7,.2,1);
}

.mw_spa_timeline,
.mw_spa_timeline * {
	box-sizing: border-box;
}

/* ---------------------------------------------------------
 * Free position:sticky from Divi's overflow trap.
 *
 * Divi (and a couple of MakeWeb-stack plugins) drop an inline
 * `overflow-y: hidden` on #page-container — sometimes from the
 * preloader on first paint, sometimes from a smooth-scroll
 * handler that re-applies on window.load. Either way, any
 * non-visible overflow on a strict ancestor of the sticky rail
 * destroys its scroll context. CSS specificity + !important
 * lets us outweigh that without a JS race.
 *
 * The :has() selector only fires when a timeline is actually
 * on the page, so we never affect unrelated layouts.
 * --------------------------------------------------------- */
#page-container:has(.mw_spa_timeline),
body:has(.mw_spa_timeline) #page-container {
	overflow-y: visible !important;
}
html:has(.mw_spa_timeline),
body:has(.mw_spa_timeline) {
	overflow-y: visible !important;
}

/* ---------------------------------------------------------
 * Defensive reset.
 *
 * Divi and the parent theme target generic ol, ul, li, h2-h6,
 * p, and a inside content areas. Those rules override our
 * resets if we only set them once. Lock the structural ones
 * down with !important inside our namespace so the timeline
 * can never inherit a decimal list marker, link colour, etc.
 * --------------------------------------------------------- */
.mw_spa_timeline ol,
.mw_spa_timeline ul {
	list-style-type: none !important;
	list-style-position: inside !important;
	list-style-image: none !important;
	margin: 0 !important;
	padding: 0 !important;
}
.mw_spa_timeline li {
	list-style-type: none !important;
	/* Note: do NOT reset margin/padding here. The era and milestone classes
	 * own their own vertical rhythm; setting `li { margin: 0 }` would have
	 * higher specificity (0,1,1) than `.mw_spa_timeline__era` (0,1,0) and
	 * collapse all chapter spacing. */
}
.mw_spa_timeline li::marker { content: '' !important; color: transparent; }
.mw_spa_timeline a {
	text-decoration: none;
	color: inherit;
}
.mw_spa_timeline img {
	max-width: 100%;
	height: auto;
	display: block;
}
.mw_spa_timeline h2,
.mw_spa_timeline h3,
.mw_spa_timeline h4 {
	margin: 0;
	padding: 0;
}

/* =========================================================
   Shell
   ========================================================= */
.mw_spa_timeline__inner {
	position: relative;
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 24px;
}
.mw_spa_timeline--has-rail .mw_spa_timeline__inner {
	display: grid;
	grid-template-columns: 120px minmax(0, 1fr);
	gap: 40px;
}

/* =========================================================
   Sticky decade rail
   ========================================================= */
.mw_spa_timeline__rail {
	position: sticky;
	/* `--mwspa-rail-top` is set by spa-timeline.js once it has measured the
	 * site's actual fixed-header height (Divi Theme Builder header, admin
	 * bar, etc.). 96px is a sensible fallback for first paint. */
	top: var(--mwspa-rail-top, 96px);
	align-self: start;
	height: max-content;
}
.mw_spa_timeline__rail-list {
	list-style: none;
	margin: 0;
	padding: 0;
	border-left: 4px solid var(--mwspa-rule);
}
.mw_spa_timeline__rail-list li + li { margin-top: 4px; }
.mw_spa_timeline__rail-link {
	display: block;
	padding: 12px 0 12px 18px;
	margin-left: -4px;
	border-left: 4px solid transparent;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: #93a0b8;
	text-decoration: none;
	transition: color .25s var(--mwspa-ease),
	            border-color .25s var(--mwspa-ease),
	            background .25s var(--mwspa-ease);
}
.mw_spa_timeline__rail-link:hover { color: var(--mwspa-navy); }
.mw_spa_timeline__rail-link.is-active {
	color: var(--mwspa-navy);
	border-left-color: var(--mwspa-green);
	background: linear-gradient(90deg, rgba(146,208,80,.10), transparent 80%);
}

/* =========================================================
   Track + central spine
   ========================================================= */
.mw_spa_timeline__track {
	position: relative;
	list-style: none;
	margin: 0;
	padding: 0;
}
.mw_spa_timeline__track::before {
	content: "";
	position: absolute;
	left: 50%; top: 0; bottom: 0;
	width: 4px;
	transform: translateX(-2px);
	background: linear-gradient(
		to bottom,
		transparent 0,
		var(--mwspa-rule) 60px,
		var(--mwspa-rule) calc(100% - 80px),
		transparent 100%
	);
	z-index: 0;
}

/* =========================================================
   Era headers
   ========================================================= */
.mw_spa_timeline__era {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 16px;
	justify-content: center;
	margin: 64px 0 36px;
}
.mw_spa_timeline__era:first-child { margin-top: 0; }
.mw_spa_timeline__era-label {
	display: inline-block;
	background: var(--mwspa-navy);
	color: #fff;
	padding: 8px 16px;
	font-weight: 700;
	font-size: clamp(20px, 2.4vw, 26px);
	letter-spacing: .02em;
	box-shadow: 0 0 0 8px var(--mwspa-paper);
	position: relative;
	z-index: 2;
}
.mw_spa_timeline__era-title {
	background: var(--mwspa-paper);
	padding: 4px 12px;
	font-weight: 600;
	font-size: 14px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--mwspa-slate);
	position: relative;
	z-index: 2;
}

/* The decade suffix (e.g. the "s" in "1980s") looks awkward at the same
 * weight + size as the four big digits. Smaller, lighter, and lifted a hair
 * gives it a tasteful superscript feel without committing to <sup>. Used in
 * both the era label pill and the sticky rail links — em-based sizing means
 * it scales correctly against either parent font-size. */
.mw_spa_timeline__era-suffix {
	font-size: 0.7em;
	font-weight: 500;
	letter-spacing: 0;
	vertical-align: 0.18em;
	margin-left: 1px;
	opacity: 0.85;
}

/* =========================================================
   Milestone
   ========================================================= */
.mw_spa_timeline__milestone {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 60px 1fr;
	align-items: stretch;
	margin: 36px 0;
	opacity: 0;
	transform: translateY(20px);
	transition: opacity .55s var(--mwspa-ease), transform .55s var(--mwspa-ease);
}
.mw_spa_timeline__milestone.is-visible {
	opacity: 1;
	transform: none;
}

/* Alternating sides */
.mw_spa_timeline__milestone:nth-child(even) .mw_spa_timeline__media { grid-column: 1; }
.mw_spa_timeline__milestone:nth-child(even) .mw_spa_timeline__body  { grid-column: 3; }
.mw_spa_timeline__milestone:nth-child(odd)  .mw_spa_timeline__media { grid-column: 3; order: 2; }
.mw_spa_timeline__milestone:nth-child(odd)  .mw_spa_timeline__body  { grid-column: 1; order: 1; }

/* Central spine node */
.mw_spa_timeline__milestone::before {
	content: "";
	position: absolute;
	left: 50%; top: 50%;
	transform: translate(-50%, -50%);
	width: 18px; height: 18px;
	background: var(--mwspa-paper);
	border: 4px solid var(--mwspa-blue);
	box-shadow: 0 0 0 6px var(--mwspa-paper);
	z-index: 1;
	transition: background .35s var(--mwspa-ease), border-color .35s var(--mwspa-ease);
}
.mw_spa_timeline__milestone.is-visible::before {
	background: var(--mwspa-green);
	border-color: var(--mwspa-green);
}

/* Media */
.mw_spa_timeline__media {
	overflow: hidden;
	aspect-ratio: 16 / 10;
	background: transparent;
	position: relative;
}
.mw_spa_timeline__media img {
	width: 100%; height: 100%; object-fit: contain;
	display: block;
	transition: transform 1.1s var(--mwspa-ease);
}
.mw_spa_timeline__milestone:hover .mw_spa_timeline__media img {
	transform: scale(1.04);
}

/* Body — coloured top bar */
.mw_spa_timeline__body {
	background: var(--mwspa-paper);
	padding: 22px 26px 24px;
	border-top: var(--mwspa-bar) solid var(--mwspa-navy-2);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
}
.mw_spa_timeline__milestone:nth-child(4n+1) .mw_spa_timeline__body { border-top-color: var(--mwspa-navy-2); }
.mw_spa_timeline__milestone:nth-child(4n+2) .mw_spa_timeline__body { border-top-color: var(--mwspa-blue); }
.mw_spa_timeline__milestone:nth-child(4n+3) .mw_spa_timeline__body { border-top-color: var(--mwspa-green); }
.mw_spa_timeline__milestone:nth-child(4n)   .mw_spa_timeline__body { border-top-color: var(--mwspa-sky-deep); }

.mw_spa_timeline__year {
	font-weight: 700;
	font-size: clamp(36px, 4.4vw, 56px);
	line-height: 1;
	color: var(--mwspa-navy-2);
	letter-spacing: -.01em;
}
.mw_spa_timeline__milestone:nth-child(4n+2) .mw_spa_timeline__year { color: var(--mwspa-blue); }
.mw_spa_timeline__milestone:nth-child(4n+3) .mw_spa_timeline__year { color: var(--mwspa-green-2); }
.mw_spa_timeline__milestone:nth-child(4n)   .mw_spa_timeline__year { color: var(--mwspa-sky-deep); }

.mw_spa_timeline__body h3 {
	font-weight: 700;
	font-size: clamp(18px, 2vw, 22px);
	line-height: 1.25;
	color: var(--mwspa-ink);
	margin: 6px 0 2px;
}
.mw_spa_timeline__body p,
.mw_spa_timeline__text p {
	margin: 0 0 .6em;
	color: var(--mwspa-body);
	font-size: 15px;
	line-height: 1.55;
	max-width: 50ch;
}
.mw_spa_timeline__text > :last-child { margin-bottom: 0; }
.mw_spa_timeline__text ul,
.mw_spa_timeline__text ol {
	margin: 0 0 .6em 1.1em;
	padding: 0;
	font-size: 15px;
	line-height: 1.55;
	color: var(--mwspa-body);
}

/* Badge — matches the .boxed.green family used on the rest of the site */
.mw_spa_timeline__badge {
	display: inline-block;
	padding: 4px 10px;
	font-weight: 700;
	font-size: 11px;
	letter-spacing: .12em;
	text-transform: uppercase;
	background: var(--mwspa-green);
	color: #fff;
}
.mw_spa_timeline__badge--now {
	background: var(--mwspa-navy);
}

/* Feature variant */
.mw_spa_timeline__milestone--feature .mw_spa_timeline__media { aspect-ratio: 4 / 3; }

/* "Now" variant — pulsing node */
.mw_spa_timeline__milestone--now::before {
	background: var(--mwspa-green);
	border-color: var(--mwspa-green);
}
.mw_spa_timeline__milestone--now::after {
	content: "";
	position: absolute;
	left: 50%; top: 50%;
	width: 28px; height: 28px;
	transform: translate(-50%, -50%);
	border: 3px solid var(--mwspa-green);
	opacity: .55;
	animation: mw_spa_pulse 2.6s var(--mwspa-ease) infinite;
}
@keyframes mw_spa_pulse {
	0%   { transform: translate(-50%,-50%) scale(.8); opacity: .7; }
	100% { transform: translate(-50%,-50%) scale(2.4); opacity: 0; }
}

/* =========================================================
   CTA endcap
   The footer below this section is brand-navy, so we keep
   the endcap on a light background to stop the two from
   blending into a single dark block. Brand colour is carried
   through the green top bar, the headline, and the button.
   ========================================================= */
.mw_spa_timeline__endcap {
	background: #eceff1;
	color: var(--mwspa-ink);
	border-top: var(--mwspa-bar) solid var(--mwspa-green);
	padding: clamp(36px, 6vw, 64px) 24px;
	margin: clamp(40px, 6vw, 72px) 0 0 ;
}
.mw_spa_timeline__endcap-inner {
	max-width: 1080px;
	margin: 0 auto;
	text-align: center;
}
.mw_spa_timeline__endcap .boxed {
	display: inline-block;
	padding: 7px 12px;
	margin: 0 0 18px;
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: uppercase;
	font-size: 16px;
	line-height: 1.2;
	color: #fff;
}
.mw_spa_timeline__endcap .boxed.green { background: var(--mwspa-green); }
/* Doubled namespace bumps specificity past the defensive
 * `.mw_spa_timeline h3 { margin: 0 }` reset above. */
.mw_spa_timeline .mw_spa_timeline__endcap-title {
	color: var(--mwspa-navy);
	font-weight: 700;
	font-size: clamp(22px, 2.8vw, 32px);
	line-height: 1.2;
	margin: 0 0 22px;
}
/* Doubled namespace bumps specificity to (0,2,0) so the defensive
 * `a { color: inherit }` reset above can't repaint the button. */
.mw_spa_timeline .mw_spa_timeline__btn {
	display: inline-block;
	background: var(--mwspa-navy);
	color: #fff;
	font-weight: 700;
	font-size: 16px;
	padding: 14px 22px;
	letter-spacing: .02em;
	text-decoration: none;
	border: 0;
	transition: background .25s var(--mwspa-ease), color .25s var(--mwspa-ease);
}
.mw_spa_timeline .mw_spa_timeline__btn:hover {
	background: var(--mwspa-blue);
	color: #fff;
}

/* =========================================================
   Tablet
   ========================================================= */
@media (max-width: 980px) {
	.mw_spa_timeline--has-rail .mw_spa_timeline__inner {
		grid-template-columns: 1fr;
		gap: 0;
	}
	.mw_spa_timeline__inner {
		padding-left: 16px;
		padding-right: 16px;
	}
	.mw_spa_timeline__rail { display: none; }

	.mw_spa_timeline__track::before {
		left: 18px;
		transform: none;
	}

	.mw_spa_timeline__era {
		justify-content: flex-start;
		padding-left: 44px;
	}

	.mw_spa_timeline__milestone {
		grid-template-columns: 1fr;
		gap: 0;
		padding-left: 44px;
		margin: 28px 0;
	}
	.mw_spa_timeline__milestone .mw_spa_timeline__media,
	.mw_spa_timeline__milestone .mw_spa_timeline__body {
		grid-column: 1 !important;
		order: initial !important;
	}

	.mw_spa_timeline__milestone::before {
		left: 18px; top: 32px;
		transform: translate(-50%, 0);
	}
	.mw_spa_timeline__milestone--now::after {
		left: 18px; top: 32px;
		transform: translate(-50%, 0) scale(.8);
	}
}

/* =========================================================
   Mobile
   ========================================================= */
@media (max-width: 600px) {
	.mw_spa_timeline__year { font-size: 40px; }
	.mw_spa_timeline__body { padding: 18px 18px 20px; }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
	.mw_spa_timeline__milestone,
	.mw_spa_timeline__media img,
	.mw_spa_timeline__btn {
		transition: none;
	}
	.mw_spa_timeline__milestone {
		opacity: 1;
		transform: none;
	}
	.mw_spa_timeline__milestone--now::after {
		animation: none;
	}
}
