/* Layout: Step detail */

/*
 * Each step is a card in the container: image and panel share the
 * styleguide radius. Edge to edge («Volle Breite») they are a band again,
 * square at the corners.
 */
.step-detail__row {
	display: grid;
	align-items: stretch;
	overflow: hidden;
	border-radius: var(--radius-ui);
}

.container--full .step-detail__row {
	border-radius: var(--radius-section);
}

/* Breathing room between the steps, so each reads as its own block. */
.step-detail__row + .step-detail__row {
	margin-top: var(--space-l);
}

@media (min-width: 860px) {
	/*
	 * minmax(0, 1fr), not 1fr: a bare 1fr may grow past its half, and the
	 * square image column did — once the text beside it ran taller than the
	 * square, the image widened with the row height, the text got narrower and
	 * taller still, and the image ended up 1325px wide over the text.
	 */
	.step-detail__row {
		/* Image about 45 %, text 55 % — the proportions of the original design. */
		grid-template-columns: minmax(0, 9fr) minmax(0, 11fr);
	}

	/* Flipped, the wider track has to follow the text to the left. */
	.step-detail__row--flipped {
		grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
	}

	/*
	 * Flipping swaps the columns with `order`, not with a reversed
	 * grid-template — that keeps the DOM order (image, then text) intact, so
	 * the reading order stays the same in both directions.
	 */
	.step-detail__row--flipped .step-detail__media {
		order: 2;
	}

	.step-detail__row--flipped .step-detail__content {
		order: 1;
	}

	/*
	 * The image column is square-ish; the panel beside it stretches to match.
	 * The width is pinned to the column: stretched to a taller row, the
	 * aspect ratio would otherwise widen the image past its half again.
	 */
	.step-detail__media {
		width: 100%;
		aspect-ratio: 1 / 1;
	}
}

/*
 * Square on a phone too, stacked above the text: the images are square
 * crops, and the old 18rem strip cut them to a landscape slice.
 */
.step-detail__media {
	position: relative;
	aspect-ratio: 1 / 1;
	background-color: var(--color-surface-alt);
}

.step-detail__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/*
 * The big number sits in the image's bottom corner. It is decorative and
 * aria-hidden; the heading beside it carries the meaning.
 */
.step-detail__number {
	position: absolute;
	right: var(--space-m);
	bottom: var(--space-2xs);
	color: #ffffff;
	font-family: var(--font-heading);
	font-size: clamp(4rem, 2rem + 7vw, 7.5rem);
	font-weight: 800;
	line-height: 1;
	opacity: 0.92;
	pointer-events: none;
}

.step-detail__row--flipped .step-detail__number {
	right: auto;
	left: var(--space-m);
}

/*
 * Padding and type a step below the old full-bleed band: in the 660px
 * panel the long first step would otherwise run far taller than the square
 * image beside it, and the image would be cropped to a narrow strip.
 */
.step-detail__content {
	display: flex;
	align-items: center;
	padding: clamp(var(--space-l), 1rem + 2.5vw, 3.5rem);
	background-color: var(--color-surface-strong);
}

.step-detail__inner {
	width: 100%;
	max-width: 46rem;
	margin-inline: auto;
	text-align: center;
}

.step-detail__inner > :last-child {
	margin-bottom: 0;
}

/*
 * The repeated lead-in ("Ganz einfach") takes its own line above the step
 * name: serif and large, the sans title a size below it.
 */
.step-detail__title {
	margin-bottom: var(--space-m);
	font-size: var(--text-2xl);
	line-height: var(--leading-tight);
}

.step-detail__title .section__title-lead {
	display: block;
	margin-bottom: var(--space-3xs);
	font-size: var(--text-3xl);
}

/* The prose helper caps at 68ch; here the column already limits the measure. */
.step-detail__text {
	max-width: none;
	margin-bottom: var(--space-m);
	font-size: var(--text-base);
	line-height: var(--leading-snug);
}

.step-detail__text > * + * {
	margin-top: var(--space-xs);
}

.step-detail__action {
	margin-bottom: 0;
}
