/*
 * Prozess-Schritte ALB element - kl_process_steps.php
 *
 * >= 1100px: header row (heading + intro left, button right), then one row of cards
 *            (--kl-steps-cols = number of steps, max 5; more wrap into further rows).
 * 768-1099px: cards wrap into 3 columns.
 * < 768px:   header stacks; cards become a horizontal swipe row (CSS scroll-snap, the
 *            next card peeks in), as allowed by the Figma note "Mobile: slider", with the
 *            Karten-Slider's orange prev/next arrows below it (kl_process_steps.js).
 *
 * Self-contained (fonts, colors, button) so it also looks right without "Neues Design".
 * Selectors use "html #top #wrap_all .kl-steps" to beat Enfold's theme-option CSS.
 */

@font-face {
	font-family: 'Host Grotesk';
	src: url('../../assets/fonts/host-grotesk-latin.woff2') format('woff2');
	font-weight: 300 800;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.kl-steps {
	--kl-steps-orange: #f08400;
	--kl-steps-edge: #d06200;
	--kl-steps-orange-hover: #d97700;
	--kl-steps-ink: #222;
	--kl-steps-ink-strong: #171717;
	--kl-steps-text: #444;
	--kl-steps-border: rgba(0, 0, 0, 0.3);
	--kl-steps-font: 'Host Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;

	font-family: var(--kl-steps-font);
}

/* Header row */

.kl-steps__header {
	display: flex;
	align-items: center;
	gap: 50px;
	margin-bottom: 40px;
}

.kl-steps__intro {
	flex: 1 1 auto;
	min-width: 0;
}

html #top #wrap_all .kl-steps :is(h2, h3).kl-steps__title {
	margin: 0;
	padding: 0;
	font-family: var(--kl-steps-font);
	font-size: clamp(30px, 1.25rem + 1.95vw, 48px);
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 1px;
	text-transform: none;
	color: var(--kl-steps-ink);
}

html #top #wrap_all .kl-steps p.kl-steps__lead {
	margin: 8px 0 0;
	padding: 0;
	font-family: var(--kl-steps-font);
	font-size: 16px;
	line-height: 26.4px;
	color: var(--kl-steps-text);
}

html #top #wrap_all .kl-steps .kl-steps__btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 139px;
	max-width: 355px;
	height: 42px;
	padding: 0 26px;
	background: var(--kl-steps-orange);
	border: 0;
	border-bottom: 1px solid var(--kl-steps-edge);
	border-radius: 99px;
	font-family: var(--kl-steps-font);
	font-size: 13px;
	font-weight: 500;
	line-height: 15.6px;
	text-decoration: none;
	white-space: nowrap;
	color: #fff;
	transition: background-color 0.2s ease;
}

html #top #wrap_all .kl-steps a.kl-steps__btn:is(:hover, :focus-visible) {
	background: var(--kl-steps-orange-hover);
}

html #top #wrap_all .kl-steps a.kl-steps__btn:focus-visible {
	outline: 2px solid var(--kl-steps-ink);
	outline-offset: 3px;
}

/* Cards */

html #top #wrap_all .kl-steps .kl-steps__list {
	display: grid;
	grid-template-columns: repeat(var(--kl-steps-cols, 5), minmax(0, 1fr));
	grid-auto-rows: 1fr; /* all cards as tall as the tallest, also when they wrap into rows */
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

html #top #wrap_all .kl-steps .kl-steps__card {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 40px;
	box-sizing: border-box;
	min-height: 340px;
	margin: 0;
	padding: 24px 22px 24px 24px; /* 2px less on the right: browsers set the 18px text a hair wider than Figma */
	border: 1px solid var(--kl-steps-border);
	border-radius: 16px;
	list-style: none;
	background: transparent;
}

.kl-steps__number {
	display: block;
	font-size: 74px;
	font-weight: 500;
	line-height: 1;
	color: var(--kl-steps-orange);
	font-variant-numeric: tabular-nums;
}

.kl-steps__body {
	display: flex;
	flex-direction: column;
	gap: 13px;
}

html #top #wrap_all .kl-steps :is(h3, h4).kl-steps__card-title {
	margin: 0;
	padding: 0;
	font-family: var(--kl-steps-font);
	font-size: 24px;
	font-weight: 500;
	line-height: 25.2px;
	letter-spacing: 0;
	text-transform: none;
	color: var(--kl-steps-ink-strong);
	overflow-wrap: break-word;
}

html #top #wrap_all .kl-steps p.kl-steps__card-text {
	margin: 0;
	padding: 0;
	font-family: var(--kl-steps-font);
	font-size: 18px;
	line-height: 26.4px;
	color: var(--kl-steps-ink-strong);
	overflow-wrap: break-word; /* whole words like in Figma; only split a word that can't fit at all */
}

/* Arrows (phones only): the Karten-Slider's two 36px orange squares, 4.5px apart */

.kl-steps__nav,
.kl-steps__nav[hidden] {
	display: none;
}

html #top #wrap_all .kl-steps .kl-steps__arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36.36px;
	height: 36.36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: var(--kl-steps-orange);
	cursor: pointer;
	transition: background-color 0.2s ease, opacity 0.2s ease;
}

html #top #wrap_all .kl-steps .kl-steps__arrow img {
	display: block;
	width: 7.1px;
	height: 15.16px;
	max-width: none;
}

html #top #wrap_all .kl-steps .kl-steps__arrow:is(:hover, :focus-visible) {
	background: var(--kl-steps-orange-hover);
}

html #top #wrap_all .kl-steps .kl-steps__arrow:focus-visible {
	outline: 2px solid var(--kl-steps-ink);
	outline-offset: 2px;
}

html #top #wrap_all .kl-steps .kl-steps__arrow:disabled {
	opacity: 0.4;
	cursor: default;
	background: var(--kl-steps-orange);
}

/* Tablet: 3 columns */

@media (max-width: 1099px) {
	html #top #wrap_all .kl-steps .kl-steps__list {
		grid-template-columns: repeat(min(var(--kl-steps-cols, 5), 3), minmax(0, 1fr));
	}

	html #top #wrap_all .kl-steps .kl-steps__card {
		min-height: 280px;
	}
}

/* Mobile: stacked header, swipeable card row */

@media (max-width: 767px) {
	.kl-steps {
		container-type: inline-size;
	}

	.kl-steps__header {
		flex-direction: column;
		align-items: flex-start;
		gap: 24px;
		margin-bottom: 32px;
	}

	html #top #wrap_all .kl-steps .kl-steps__list {
		display: flex;
		gap: 16px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scroll-behavior: smooth;
		overscroll-behavior-x: contain;
		scrollbar-width: none;
		/* Bleed to the screen edges so cards swipe in from outside the column, but snap the
		   first card to the column's edge. 100cqw = column width (.kl-steps is the container);
		   a % in scroll-padding would refer to the scroller itself, so it can't be used here. */
		--kl-steps-gutter: calc((100vw - 100cqw) / 2);
		margin-inline: calc(-1 * var(--kl-steps-gutter));
		padding-inline: var(--kl-steps-gutter);
		scroll-padding-inline: var(--kl-steps-gutter);
	}

	html #top #wrap_all .kl-steps .kl-steps__list::-webkit-scrollbar {
		display: none;
	}

	html #top #wrap_all .kl-steps .kl-steps__card {
		flex: 0 0 78%;
		min-height: 260px;
		scroll-snap-align: start;
	}

	.kl-steps__nav:not([hidden]) {
		display: flex;
		justify-content: flex-end;
		gap: 4.5px;
		margin-top: 24px;
	}

	.kl-steps__number {
		font-size: 56px;
	}

	html #top #wrap_all .kl-steps :is(h3, h4).kl-steps__card-title {
		font-size: 20px;
	}

	html #top #wrap_all .kl-steps p.kl-steps__card-text {
		font-size: 16px;
		line-height: 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	html #top #wrap_all .kl-steps .kl-steps__list {
		scroll-behavior: auto;
	}
}
