/*
 * Scroll story. Colors come from the surrounding section's scheme
 * (--color-scheme-*, --qo-accent-text from qo-child), so the widget works on
 * any scheme in light and dark.
 */
.qo-scroll-story {
	display: grid;
	gap: 3rem;
}

.qo-scroll-story__eyebrow {
	margin: 0 0 0.75rem;
	font-family: var(--font-body);
	font-weight: 600;
}

.qo-scroll-story__heading {
	margin: 0 0 1.25rem;
}

.qo-scroll-story__intro {
	margin: 0;
}

.qo-scroll-story__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 1.5rem;
	margin-top: 1.5rem;
}

.qo-scroll-story__link {
	font-weight: 500;
}

.qo-scroll-story__link::after {
	content: " \203A"; /* › */
}

/* The step index only helps when the steps scroll past a pinned column. */
.qo-scroll-story__index {
	display: none;
}

.qo-scroll-story__steps {
	display: grid;
	gap: 3rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.qo-scroll-story__step {
	scroll-margin-top: 6rem; /* clear the header when jumped to */
}

.qo-scroll-story__step:focus {
	outline: none; /* focused programmatically by the index links; the index shows the current step */
}

.qo-scroll-story__image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	margin-bottom: 1.5rem;
	background: var(--color-scheme-foreground);
}

.qo-scroll-story__title {
	margin: 0 0 0.5rem;
}

.qo-scroll-story__num {
	color: var(--qo-accent-text);
	font-variant-numeric: tabular-nums;
}

.qo-scroll-story__text {
	margin: 0;
}

@media (min-width: 768px) {
	.qo-scroll-story {
		grid-template-columns: 1fr 1fr;
		align-items: start;
		gap: 5rem;
	}

	.qo-scroll-story__aside {
		position: sticky;
		top: 6rem;
	}

	.qo-scroll-story__index {
		display: block;
		margin-top: 2.5rem;
	}

	.qo-scroll-story__index ol {
		margin: 0;
		padding: 0;
		list-style: none;
		border-left: 1px solid var(--color-scheme-border);
	}

	.qo-scroll-story__index a {
		display: block;
		padding: 0.5rem 0 0.5rem 1rem;
		margin-left: -1px;
		border-left: 2px solid transparent;
		color: var(--color-scheme-text);
		text-decoration: none;
	}

	.qo-scroll-story__index a:hover {
		color: var(--qo-accent-text);
	}

	.qo-scroll-story__index a[aria-current="true"] {
		border-left-color: var(--qo-accent-text);
		font-weight: 600;
	}

	.qo-scroll-story__steps {
		gap: 6rem;
	}
}

/* Entrance slide, only once the script has run and only if motion is welcome. Content is never hidden. */
@media (prefers-reduced-motion: no-preference) {
	.qo-scroll-story.is-enhanced .qo-scroll-story__step {
		transform: translateY(1.5rem);
		transition: transform 0.6s ease-out;
	}

	.qo-scroll-story.is-enhanced .qo-scroll-story__step.is-seen {
		transform: none;
	}
}
