/**
 * Variant CSS: history--milestone-timeline
 *
 * Company history as a vertical timeline. Each node = a big year on the left and a
 * milestone title + one line on the right, threaded onto a single connector line
 * with accent dots. The final "Dziś" node gets a filled dot to read as the present.
 * Text stays --ink (polarity-aware); year, dots and the em take --accent. The track
 * collapses to a tighter left rail on mobile, no horizontal overflow. First variant
 * of the new `history` role.
 */

body.aibt-universal .universal-history--milestone-timeline {
	padding-block: calc(clamp(3rem, 7vw, 5rem) * var(--density, 1));
}

/* Intro. */
body.aibt-universal .universal-history--milestone-timeline .universal-history__intro {
	margin-bottom: clamp(2rem, 4.5vw, 3rem);
}

body.aibt-universal .universal-history--milestone-timeline .universal-history__kicker {
	font-family: var(--font-body) !important;
	font-size: var(--text-xs) !important;
	font-weight: 600 !important;
	letter-spacing: var(--tracking-widest) !important;
	text-transform: uppercase !important;
	color: var(--accent) !important;
	margin: 0 0 var(--space-sm) 0 !important;
}

body.aibt-universal .universal-history--milestone-timeline .universal-history__headline {
	font-family: var(--font-display) !important;
	color: var(--ink) !important;
	margin: 0 0 var(--space-sm) 0 !important;
}

body.aibt-universal .universal-history--milestone-timeline .universal-history__headline em {
	color: var(--accent) !important;
	font-style: italic;
}

body.aibt-universal .universal-history--milestone-timeline .universal-history__deck {
	font-family: var(--font-body) !important;
	font-size: var(--text-base) !important;
	color: var(--ink) !important;
	opacity: 0.74;
	margin: 0 !important;
}

/* Track — the connector line sits behind the node dots. */
body.aibt-universal .universal-history--milestone-timeline .universal-history__track {
	position: relative;
}

body.aibt-universal .universal-history--milestone-timeline .universal-history__track::before {
	content: "";
	position: absolute;
	top: 0.55rem;
	bottom: 0.55rem;
	/* Aligns with the dot centre: year column width + gap, then half the dot. */
	left: calc(96px + clamp(1.2rem, 3vw, 2rem));
	width: 2px;
	background: color-mix(in srgb, var(--ink) 14%, transparent);
}

/* Node row. */
body.aibt-universal .universal-history--milestone-timeline .universal-history__node {
	position: relative;
	gap: clamp(1.2rem, 3vw, 2rem) !important;
	align-items: flex-start !important;
	flex-wrap: nowrap !important;
	padding-block: calc(clamp(1rem, 2.6vw, 1.6rem) * var(--density, 1));
}

/* The dot on the connector line, centred over the line at the body's edge. */
body.aibt-universal .universal-history--milestone-timeline .universal-history__node::before {
	content: "";
	position: absolute;
	top: calc(clamp(1rem, 2.6vw, 1.6rem) + 0.45rem);
	left: calc(96px + clamp(1.2rem, 3vw, 2rem) - 5px);
	width: 12px;
	height: 12px;
	border-radius: var(--decor-radius-pill, 999px);
	background: var(--background, #fff);
	border: 2px solid var(--accent);
	box-sizing: border-box;
}

body.aibt-universal .universal-history--milestone-timeline .universal-history__node--now::before {
	background: var(--accent);
}

/* Year. */
body.aibt-universal .universal-history--milestone-timeline .universal-history__year {
	flex: 0 0 auto !important;
	width: 96px;
	text-align: right;
	font-family: var(--font-display) !important;
	font-size: clamp(1.3rem, 2.6vw, 1.7rem) !important;
	font-weight: 700 !important;
	line-height: 1.1 !important;
	color: var(--accent) !important;
	margin: 0 !important;
}

/* Body. */
body.aibt-universal .universal-history--milestone-timeline .universal-history__node-body {
	flex: 1 1 auto;
	min-width: 0;
	/* Push the text clear of the connector line + dot. */
	padding-left: clamp(1.2rem, 3vw, 2rem);
}

body.aibt-universal .universal-history--milestone-timeline .universal-history__node-title {
	font-family: var(--font-display) !important;
	font-size: clamp(1.15rem, 2.2vw, 1.45rem) !important;
	font-weight: 600 !important;
	line-height: 1.25 !important;
	color: var(--ink) !important;
	margin: 0 0 0.35rem 0 !important;
}

body.aibt-universal .universal-history--milestone-timeline .universal-history__node-desc {
	font-family: var(--font-body) !important;
	font-size: var(--text-sm) !important;
	line-height: var(--leading-relaxed) !important;
	color: var(--ink) !important;
	opacity: 0.72;
	margin: 0 !important;
	max-width: 58ch;
}

/* Mobile: thin left rail, year above the body. */
@media (max-width: 640px) {
	/* A5: drop wide kicker tracking so the uppercase label never crowds the edge. */
	body.aibt-universal .universal-history--milestone-timeline .universal-history__kicker {
		letter-spacing: 0 !important;
	}
	body.aibt-universal .universal-history--milestone-timeline .universal-history__track::before {
		left: 5px;
	}
	body.aibt-universal .universal-history--milestone-timeline .universal-history__node {
		flex-wrap: wrap !important;
		gap: 0.35rem 0 !important;
		padding-left: 1.6rem;
	}
	body.aibt-universal .universal-history--milestone-timeline .universal-history__node::before {
		left: 0;
	}
	body.aibt-universal .universal-history--milestone-timeline .universal-history__year {
		width: auto;
		flex-basis: 100%;
		text-align: left;
	}
	body.aibt-universal .universal-history--milestone-timeline .universal-history__node-body {
		flex-basis: 100%;
		padding-left: 0;
	}
}
