/* Generated by astro-product/scripts/sync-core.mjs from packages/foundation/components/timeline. Do not edit. */
/*
 * Timeline, the HTML reference. WP: rtthemes-blocks' Timeline block (plugins/rtthemes-blocks/src/blocks/timeline),
 * whose layout, markers and colours are options; Furnica's patterns pick the accent markers and the line colour. The
 * entries' type and colours are block settings. The line is a background of the list placed against its content box,
 * the dots each entry's ::before; a badge (theme icon in an accent circle) replaces the dot. With scroll-driven
 * animations an accent line fills the line up to the middle of the screen and the dots light up as their entry passes.
 */
@property --rt-timeline-fill {
	syntax: "<number>";
	inherits: false;
	initial-value: 0;
}

.rt-timeline {
	--rt-timeline-room: 3rem;
	--rt-timeline-dot: 1rem;
	--rt-timeline-dot-top: 0.4375rem;
	--rt-timeline-width: 2px;
	--rt-timeline-fade: 4rem;
	--rt-timeline-x: calc(var(--rt-timeline-room) / 2 - var(--rt-timeline-width) / 2);
	--rt-timeline-top: calc(var(--rt-timeline-dot-top) + var(--rt-timeline-dot) / 2);
	--rt-timeline-length: calc(100% - var(--rt-timeline-top));
	display: flex;
	flex-direction: column;
	gap: var(--rt-spacing-60);
	margin: 0;
	padding: 0;
	list-style: none;
	background-image:
		linear-gradient(var(--rt-color-accent), var(--rt-color-accent)),
		linear-gradient(to bottom, var(--rt-color-line) calc(100% - var(--rt-timeline-fade)), transparent);
	background-repeat: no-repeat;
	background-origin: content-box;
	background-position: var(--rt-timeline-x) var(--rt-timeline-top);
	background-size:
		var(--rt-timeline-width) calc((var(--rt-timeline-length) - var(--rt-timeline-fade)) * var(--rt-timeline-fill)),
		var(--rt-timeline-width) var(--rt-timeline-length);
}

.rt-timeline__entry {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: var(--rt-spacing-20);
	box-sizing: border-box;
	margin-inline-start: var(--rt-timeline-room);
}

.rt-timeline__entry::before {
	content: "";
	position: absolute;
	top: var(--rt-timeline-dot-top);
	inset-inline-start: calc(var(--rt-timeline-room) / -2 - var(--rt-timeline-dot) / 2);
	width: var(--rt-timeline-dot);
	height: var(--rt-timeline-dot);
	box-sizing: border-box;
	border: var(--rt-timeline-width) solid var(--rt-color-accent);
	border-radius: 50%;
	background-color: var(--rt-color-accent);
}

.rt-timeline__entry:has(> .rt-timeline__badge)::before {
	content: none;
}

.rt-timeline__badge {
	position: absolute;
	top: 0;
	inset-inline-start: calc(var(--rt-timeline-room) * -1);
	z-index: 1;
	display: flex;
	justify-content: center;
	width: var(--rt-timeline-room);
	line-height: 0;
}

.rt-timeline__badge svg {
	box-sizing: border-box;
	width: 2.75rem;
	height: auto;
	aspect-ratio: 1;
	padding: 0.625rem;
	border-radius: 50%;
	background-color: var(--rt-color-accent);
	color: var(--rt-color-on-accent);
	fill: currentColor;
}

.rt-timeline__date,
.rt-timeline__title,
.rt-timeline__text {
	margin: 0;
}

.rt-timeline__date {
	color: var(--rt-color-contrast);
	font-family: var(--rt-font-family-heading);
	font-size: var(--rt-font-size-large);
	font-weight: var(--rt-font-weight-bold);
	line-height: 1.25;
}

.rt-timeline__title {
	font-size: var(--rt-font-size-medium);
}

/* Alternating: the line in the middle, odd entries before it (text towards the line), even entries after it */
.rt-timeline--alternating {
	--rt-timeline-x: calc(50% - var(--rt-timeline-width) / 2);
}

.rt-timeline--alternating > .rt-timeline__entry {
	width: calc(50% - var(--rt-timeline-room) / 2);
	margin-inline: 0 auto;
}

.rt-timeline--alternating > .rt-timeline__entry:nth-child(even) {
	margin-inline: auto 0;
}

.rt-timeline--alternating > .rt-timeline__entry:nth-child(odd) {
	text-align: end;
}

.rt-timeline--alternating > .rt-timeline__entry:nth-child(odd)::before {
	inset-inline: auto calc(var(--rt-timeline-room) / -2 - var(--rt-timeline-dot) / 2);
}

.rt-timeline--alternating > .rt-timeline__entry:nth-child(odd) > .rt-timeline__badge {
	inset-inline: auto calc(var(--rt-timeline-room) * -1);
}

@media (max-width: 37.5rem) {
	.rt-timeline--alternating {
		--rt-timeline-x: calc(var(--rt-timeline-room) / 2 - var(--rt-timeline-width) / 2);
	}

	.rt-timeline--alternating > .rt-timeline__entry,
	.rt-timeline--alternating > .rt-timeline__entry:nth-child(even) {
		width: auto;
		margin-inline: var(--rt-timeline-room) 0;
	}

	.rt-timeline--alternating > .rt-timeline__entry:nth-child(odd) {
		text-align: start;
	}

	.rt-timeline--alternating > .rt-timeline__entry:nth-child(odd)::before {
		inset-inline: calc(var(--rt-timeline-room) / -2 - var(--rt-timeline-dot) / 2) auto;
	}

	.rt-timeline--alternating > .rt-timeline__entry:nth-child(odd) > .rt-timeline__badge {
		inset-inline: calc(var(--rt-timeline-room) * -1) auto;
	}
}

@supports (animation-timeline: view()) {
	@media (prefers-reduced-motion: no-preference) {
		.rt-timeline {
			animation: rt-timeline-fill linear both;
			animation-timeline: view();
			animation-range: cover 50vh cover calc(100% - 50vh);
		}

		.rt-timeline__entry {
			view-timeline: --rt-timeline-entry block;
		}

		.rt-timeline__entry::before {
			animation: rt-timeline-dot linear both;
			animation-timeline: --rt-timeline-entry;
			animation-range: cover calc(50vh - var(--rt-timeline-dot)) cover 50vh;
		}
	}
}

@keyframes rt-timeline-fill {
	from {
		--rt-timeline-fill: 0;
	}

	to {
		--rt-timeline-fill: 1;
	}
}

@keyframes rt-timeline-dot {
	from {
		opacity: 0.35;
		scale: 0.75;
	}
}
