/* Apotypoma Timeline */

.apt {
	/* Colours */
	--apt-light: #29abe2;          /* ridges + circles */
	--apt-dark: #0b5aa6;           /* logo, track, active circle, date */
	--apt-text: #0b5aa6;
	--apt-title: #12263f;
	--apt-bg: #fff;
	/* Past events fade strength (only when past="fade") */
	--apt-past-opacity: 0.4;
	/* Past circles use solid lighter tints (so the fingerprint doesn't show through) */
	--apt-past-light: #b3e3f7;
	--apt-past-dark: #9db9d9;
	/* Offset for a fixed/sticky site header on desktop, e.g. 80px */
	--apt-sticky-top: 0px;
	--apt-font: inherit;
	/* Desktop: height of the fingerprint (the whole component scales with it) */
	--apt-size: min(74vh, 760px);

	position: relative;
	background: var(--apt-bg);
	color: var(--apt-text);
	font-family: var(--apt-font);
}

/* ---- Without JS / reduced motion: only the list ----------------------- */
.apt__scroller { display: none; }
.apt--ready .apt__scroller { display: block; }

.apt--ready .apt__list {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ---- Stage ------------------------------------------------------------ */
.apt__stage {
	display: grid;
	/* info column | fingerprint - centred as a group */
	grid-template-columns: minmax(220px, 340px) auto;
	justify-content: center;
	align-items: center;
	column-gap: clamp(8px, 1.5vw, 28px);
	overflow: hidden;
}

.apt--desktop .apt__stage {
	position: sticky;
	top: var(--apt-sticky-top);
	height: calc(100vh - var(--apt-sticky-top));
}

.apt__visual {
	min-width: 0;
	display: flex;
	align-items: center;
	touch-action: pan-y;
	-webkit-user-select: none;
	user-select: none;
}

.apt__svg {
	display: block;
	/* Desktop size of the fingerprint: change --apt-size to zoom the whole component */
	height: var(--apt-size);
	width: auto;
	max-width: calc(100vw - 260px);
	overflow: hidden;
}

/* Fingerprint artwork (traced from the design) */
.apt__ridges { fill: var(--apt-light); }
.apt__logo { fill: var(--apt-dark); }
.apt__track { fill: none; stroke: none; } /* invisible guide the circles move along */

/* Circles */
.apt-node { cursor: pointer; }
.apt-node__circle {
	fill: var(--apt-light);
	stroke: var(--apt-bg);
	stroke-width: 7;
	transition: fill .35s ease;
}
.apt-node.is-active .apt-node__circle { fill: var(--apt-dark); }
.apt-node.is-active:not(.has-link) { cursor: default; }
.apt-node.is-faded .apt-node__circle { fill: var(--apt-past-light); }
.apt-node.is-faded.is-active .apt-node__circle { fill: var(--apt-past-dark); }
.apt-node__label {
	fill: #fff;
	font-family: var(--apt-font);
	font-weight: 800;
	letter-spacing: .02em;
	pointer-events: none;
}

/* ---- Info panel ------------------------------------------------------- */
.apt__info {
	padding: 0;
	text-align: right;
	min-width: 0;
}
.apt__info-inner.is-faded { opacity: var(--apt-past-opacity); }
.apt__info-inner.is-in { animation: apt-in .45s ease both; }

@keyframes apt-in {
	from { opacity: 0; transform: translateY(12px); }
}
.apt__info-inner.is-faded.is-in { animation-name: apt-in-faded; }
@keyframes apt-in-faded {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: var(--apt-past-opacity); }
}

.apt__date {
	margin: 0;
	color: var(--apt-dark);
	font-weight: 800;
	line-height: .9;
	font-variant-numeric: tabular-nums;
}
.apt__day {
	display: block;
	font-size: clamp(2.8rem, 5.4vw, 5.6rem);
	letter-spacing: -.04em;
}
.apt__year {
	display: block;
	font-size: clamp(1.4rem, 2.6vw, 2.7rem);
	margin-top: .15em;
	padding-right: .1em;
}

.apt__badge {
	display: inline-block;
	margin-top: 1rem;
	padding: .25em .8em;
	border-radius: 999px;
	background: var(--apt-light);
	color: #fff;
	font-size: .8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
}
.apt__badge[hidden] { display: none; }

.apt__title {
	margin: 1rem 0 0 auto;
	max-width: 22ch;
	color: var(--apt-title);
	font-size: clamp(1rem, 1.3vw, 1.3rem);
	font-weight: 600;
	line-height: 1.3;
}
.apt__title.is-link { cursor: pointer; }
.apt__title.is-link:hover { color: var(--apt-dark); }

.apt__meta {
	margin: .5rem 0 0;
	color: var(--apt-light);
	font-size: .9rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
}

.apt__more {
	display: inline-block;
	margin-top: 1.1rem;
	color: var(--apt-dark);
	font-weight: 700;
	text-decoration: none;
	border-bottom: 2px solid var(--apt-light);
	padding-bottom: 2px;
}
.apt__more::after { content: " \2192"; }
.apt__more[hidden] { display: none; }

/* Arrows - mobile only */
.apt__nav { display: none; }

/* ---- Mobile ----------------------------------------------------------- */
.apt--mobile .apt__stage {
	display: flex;
	flex-direction: column;
	padding: 1rem 0 2rem;
}
.apt--mobile .apt__visual {
	order: 1;
	width: 100%;
	height: auto;
}
.apt--mobile .apt__svg {
	width: 100%;
	height: auto;
	max-width: none;
	max-height: 60vh;
	max-height: 60svh;
	margin: 0 auto;
}
.apt--mobile .apt__info {
	order: 2;
	width: 100%;
	padding: 0 16px;
	text-align: center;
	box-sizing: border-box;
}
.apt--mobile .apt__info-inner { min-height: 11.5rem; margin-top: .75rem; }
.apt--mobile .apt__day { font-size: clamp(2.8rem, 15vw, 4rem); display: inline; }
.apt--mobile .apt__year { font-size: clamp(1.2rem, 6vw, 1.6rem); display: inline; margin-left: .35em; }
.apt--mobile .apt__title { margin: .75rem auto 0; max-width: 28ch; font-size: 1.1rem; }

.apt--mobile .apt__nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.25rem;
	margin-top: 1rem;
	font-weight: 700;
	color: var(--apt-dark);
	font-variant-numeric: tabular-nums;
}
.apt__btn {
	width: 44px; height: 44px;
	border: 2px solid var(--apt-light);
	border-radius: 50%;
	background: transparent;
	color: var(--apt-dark);
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}
.apt__btn:disabled { opacity: .3; cursor: default; }

/* ---- Plain list (no JS / reduced motion / screen readers) ------------- */
.apt__list {
	list-style: none;
	margin: 0 0 0 14px;
	padding: 1rem 16px 1rem 2rem;
	border-left: 4px solid var(--apt-light);
}
.apt__item { position: relative; padding: .75rem 0; }
.apt__item::before {
	content: "";
	position: absolute;
	left: calc(-2rem - 12px);
	top: 1.05rem;
	width: 20px; height: 20px;
	border-radius: 50%;
	background: var(--apt-light);
	border: 3px solid var(--apt-bg);
}
.apt__item.is-today::before { background: var(--apt-dark); }
.apt__item.is-faded { opacity: var(--apt-past-opacity); }
.apt__item time { color: var(--apt-dark); font-weight: 800; }
.apt__item-title { margin: .2rem 0; font-size: 1.1rem; color: var(--apt-title); }
.apt__item-title a { color: inherit; }
.apt__item-loc { color: var(--apt-light); font-weight: 700; text-transform: uppercase; font-size: .85rem; letter-spacing: .05em; }
