/*
 * Phasen-Leiste „So läuft eine Bauendreinigung ab“ (spezial-grund-und-bauendreinigung.php).
 * Grundzustand (ohne JS, mobil): senkrechter Zeitstrahl, alle Phasen offen.
 * .ist-reiter (JS, ab 768 px): waagrechter Strahl mit Reitern, darunter die gewählte Phase.
 */

.zy-sp-bau__leiste {
	--zy-sp-punkt: 2.25rem;
	max-width: 68rem;
	margin-inline: auto;
}

/* ---------- Grundzustand: senkrechter Zeitstrahl ---------- */
.zy-sp-bau__phasen {
	position: relative;
	display: grid;
	gap: var(--zy-abstand-md);
	margin: 0;
	padding: 0;
	list-style: none;
}

.zy-sp-bau__phase {
	position: relative;
	display: grid;
	grid-template-columns: 3.75rem minmax(0, 1fr);
	gap: var(--zy-abstand-md);
	align-items: start;
	padding: var(--zy-abstand-lg) var(--zy-abstand-lg) var(--zy-abstand-lg) var(--zy-abstand-md);
	border-radius: var(--zy-radius-karte);
	background: var(--zy-farbe-grund);
}

/* Verbindungslinie zwischen den Karten */
.zy-sp-bau__phase:not(:last-child)::after {
	content: "";
	position: absolute;
	left: calc(var(--zy-abstand-md) + 1.875rem - 1px);
	top: 100%;
	width: 2px;
	height: var(--zy-abstand-md);
	background: var(--zy-farbe-dunkel);
	opacity: .25;
}

.zy-sp-bau__bild {
	display: grid;
	place-items: center;
	width: 3.75rem;
	height: 3.75rem;
	border-radius: 18px;
	background: var(--zy-verlauf-3d);
}

.zy-sp-bau__icon img {
	display: block;
	width: auto;
	max-width: 2.9rem;
	height: auto;
	max-height: 2.9rem;
}

.zy-sp-bau__nr {
	display: flex;
	align-items: baseline;
	gap: .15em;
	margin: 0 0 var(--zy-abstand-xs);
	font-size: .875rem;
	font-weight: 600;
	color: var(--zy-farbe-text-leise);
}

.zy-sp-bau__nr-zahl {
	font-family: var(--zy-schrift-titel);
	font-size: 1.5rem;
	font-weight: var(--zy-schrift-titel-gewicht);
	line-height: 1;
	color: var(--zy-farbe-dunkel);
}

.zy-sp-bau__inhalt h3 {
	margin: 0 0 var(--zy-abstand-sm);
	font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
}

.zy-sp-bau__text {
	margin: 0;
	color: var(--zy-farbe-text-leise);
	overflow-wrap: break-word;
	hyphens: manual;
}

/* ---------- Reiter-Ansicht (JS, ab 768 px) ---------- */
.zy-sp-bau__strahl[hidden],
.zy-sp-bau__nav[hidden],
.zy-sp-bau__phase[hidden] {
	display: none;
}

.zy-sp-bau__leiste.ist-reiter .zy-sp-bau__strahl {
	position: relative;
	display: grid;
	grid-template-columns: repeat(var(--zy-sp-anzahl), minmax(0, 1fr));
	margin-bottom: var(--zy-abstand-xl);
}

/* Linie durch die Punkte, füllt sich bis zur gewählten Phase */
.zy-sp-bau__linie {
	position: absolute;
	top: calc(var(--zy-sp-punkt) / 2 - 1px);
	left: calc(50% / var(--zy-sp-anzahl));
	right: calc(50% / var(--zy-sp-anzahl));
	height: 2px;
	background: var(--zy-farbe-linie);
}

.zy-sp-bau__fuell {
	display: block;
	width: calc((var(--zy-sp-aktiv) - 1) / (var(--zy-sp-anzahl) - 1) * 100%);
	height: 100%;
	background: var(--zy-farbe-dunkel);
	transition: width .4s ease;
}

.zy-sp-bau__tab {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--zy-abstand-sm);
	padding: 0 var(--zy-abstand-xs) var(--zy-abstand-sm);
	border: 0;
	background: none;
	color: var(--zy-farbe-text-leise);
	font: inherit;
	font-weight: 600;
	text-align: center;
	cursor: pointer;
}

.zy-sp-bau__punkt {
	display: grid;
	place-items: center;
	width: var(--zy-sp-punkt);
	height: var(--zy-sp-punkt);
	border: 2px solid var(--zy-farbe-linie);
	border-radius: 50%;
	background: var(--zy-farbe-grund);
	color: var(--zy-farbe-text-leise);
	font-family: var(--zy-schrift-titel);
	font-size: 1.125rem;
	font-weight: var(--zy-schrift-titel-gewicht);
	transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}

.zy-sp-bau__tab-icon img {
	display: block;
	width: auto;
	height: 3.25rem;
	opacity: .55;
	filter: saturate(.6);
	transition: opacity .25s ease, filter .25s ease;
}

.zy-sp-bau__tab-name {
	font-size: .9375rem;
	line-height: 1.25;
}

.zy-sp-bau__tab.ist-erledigt .zy-sp-bau__punkt {
	border-color: var(--zy-farbe-dunkel);
	background: var(--zy-farbe-dunkel);
	color: var(--zy-farbe-auf-dunkel);
}

.zy-sp-bau__tab[aria-selected="true"] {
	color: var(--zy-farbe-dunkel);
}

.zy-sp-bau__tab[aria-selected="true"] .zy-sp-bau__punkt {
	border-color: var(--zy-farbe-dunkel);
	background: var(--zy-farbe-akzent-auf-dunkel);
	color: var(--zy-farbe-dunkel);
}

.zy-sp-bau__tab[aria-selected="true"] .zy-sp-bau__tab-icon img,
.zy-sp-bau__tab:hover .zy-sp-bau__tab-icon img {
	opacity: 1;
	filter: none;
}

.zy-sp-bau__tab:hover {
	color: var(--zy-farbe-dunkel);
}

.zy-sp-bau__tab:focus-visible {
	outline: 2px solid var(--zy-farbe-fokus);
	outline-offset: 4px;
	border-radius: var(--zy-radius);
}

/* gewählte Phase als große Karte */
.zy-sp-bau__leiste.ist-reiter .zy-sp-bau__phase {
	grid-template-columns: minmax(12rem, 2fr) minmax(0, 3fr);
	gap: 0;
	padding: 0;
	overflow: hidden;
	box-shadow: 0 12px 32px rgba(20, 39, 74, .08);
}

/* Einblenden nur beim Wechsel, nicht beim ersten Laden */
.zy-sp-bau__leiste.ist-gewechselt .zy-sp-bau__phase {
	animation: zy-sp-bau-ein .35s ease both;
}

.zy-sp-bau__leiste.ist-reiter .zy-sp-bau__phase::after {
	display: none;
}

.zy-sp-bau__leiste.ist-reiter .zy-sp-bau__bild {
	width: auto;
	height: 100%;
	min-height: 17rem;
	border-radius: 0;
}

.zy-sp-bau__leiste.ist-reiter .zy-sp-bau__icon img {
	max-width: 9rem;
	max-height: 9rem;
}

.zy-sp-bau__leiste.ist-reiter .zy-sp-bau__inhalt {
	display: flex;
	flex-direction: column;
	padding: var(--zy-abstand-2xl) var(--zy-abstand-2xl) var(--zy-abstand-xl);
}

.zy-sp-bau__leiste.ist-reiter .zy-sp-bau__text {
	font-size: 1.0625rem;
	max-width: 40rem;
}

.zy-sp-bau__nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: var(--zy-abstand-md);
	margin-top: auto;
	padding-top: var(--zy-abstand-xl);
}

.zy-sp-bau__schritt {
	display: inline-flex;
	align-items: center;
	gap: var(--zy-abstand-sm);
	padding: .5rem 0;
	border: 0;
	background: none;
	color: var(--zy-farbe-blau);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.zy-sp-bau__schritt:first-child svg {
	transform: scaleX(-1);
}

.zy-sp-bau__schritt:disabled {
	visibility: hidden;
}

.zy-sp-bau__schritt:hover {
	color: var(--zy-farbe-dunkel);
}

.zy-sp-bau__schritt--weiter {
	margin-left: auto;
}

.zy-sp-bau__schritt:focus-visible {
	outline: 2px solid var(--zy-farbe-fokus);
	outline-offset: 2px;
	border-radius: var(--zy-radius);
}

@keyframes zy-sp-bau-ein {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.zy-sp-bau__fuell,
	.zy-sp-bau__punkt,
	.zy-sp-bau__tab-icon img {
		transition: none;
	}

	.zy-sp-bau__leiste.ist-gewechselt .zy-sp-bau__phase {
		animation: none;
	}
}
