/* ── Band ───────────────────────────────────────────────────────────── */

.quoi-referenzen {
	/* Kachelmaße an einer Stelle – der Titel über dem Bild rechnet damit. */
	--quoi-ref-tile: 300px;
	--quoi-ref-gap: 12px;
}

.quoi-referenzen-band {
	display: flex;
	gap: var(--quoi-ref-gap);
	overflow-x: auto;
	padding-bottom: 12px;
	scroll-snap-type: x proximity;
	/* Systemscrollbalken aus – die Steuerung übernimmt die Rail darunter. */
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.quoi-referenzen-band::-webkit-scrollbar {
	display: none;
}

/* ── Steuerung: Pfeile + Fortschrittsbalken ─────────────────────────── */

.quoi-referenzen-rail {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 4px;
}

/* Passt alles ins Sichtfeld, braucht es keine Steuerung. */
.quoi-referenzen-rail[hidden] {
	display: none;
}

.quoi-ref-nav {
	width: 46px;
	height: 46px;
	flex: none;
	padding: 0;
	background: none;
	border: 2px solid #111;
	border-radius: 50%;
	color: #111;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.quoi-ref-nav:hover:not(:disabled),
.quoi-ref-nav:focus-visible {
	background: #111;
	color: #fff;
}

.quoi-ref-nav:disabled {
	opacity: 0.28;
	cursor: default;
}

.quoi-ref-nav svg {
	width: 20px;
	height: 20px;
	display: block;
}

.quoi-ref-progress {
	flex: 1;
	height: 1px;
	background: rgba(17, 17, 17, 0.25);
	position: relative;
}

.quoi-ref-progress span {
	position: absolute;
	top: -1px;
	bottom: -1px;
	left: 0;
	width: 30%;
	background: #111;
}

/* ── Referenz-Paar ──────────────────────────────────────────────────── */

.quoi-referenz {
	flex-shrink: 0;
	display: flex;
	gap: var(--quoi-ref-gap);
	position: relative;
}

/*
 * Snap-Punkt an jeder Kachel: Auf breiten Schirmen springt die Steuerung
 * ohnehin projektweise, auf schmalen rastet es kachelweise ein.
 */
.quoi-ref-info,
.quoi-ref-image {
	scroll-snap-align: start;
}

/*
 * Eckig / gerundet im Wechsel – wie bei den Leistungs-Karten und im FAQ.
 * Info-Block und Bild eines Projekts teilen sich die Form, damit das Paar
 * als ein Projekt gelesen wird.
 */
.quoi-referenz:nth-child(odd) .quoi-ref-info,
.quoi-referenz:nth-child(odd) .quoi-ref-image {
	border-radius: 0;
	border: 0px solid black;
}

.quoi-referenz:nth-child(even) .quoi-ref-info,
.quoi-referenz:nth-child(even) .quoi-ref-image {
	border-radius: 50px;
	border: 0px solid black;
}

/* ── Info-Block (grau) ──────────────────────────────────────────────── */

.quoi-ref-info {
	position: relative;
	width: var(--quoi-ref-tile);
	height: 460px;
	background: #ffffff;
	display: flex;
	flex-direction: column;
	padding: 28px;
	overflow: hidden;
	cursor: default;
}

.quoi-ref-icon {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.quoi-ref-icon svg {
	width: 160px;
	height: auto;
	display: block;
}

.quoi-ref-title {
	flex: 0 0 auto;
	font-size: 0.8rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.4;
}

/* ── Hover-Text ─────────────────────────────────────────────────────── */

.quoi-ref-hover {
	position: absolute;
	inset: 0;
	background: rgba(232, 232, 232, 0.97);
	padding: 28px;
	overflow-y: auto;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
	scrollbar-width: thin;
	text-align: justify;
	hyphens: auto;
}

.quoi-ref-info:hover .quoi-ref-hover,
.quoi-ref-info.is-open .quoi-ref-hover {
	opacity: 1;
	pointer-events: auto;
}

.quoi-ref-info:focus-visible {
	outline: 2px solid #111;
	outline-offset: 3px;
}

/*
 * Touch-Geräte kennen kein Hover: Dort blendet ein Tipp den Text ein, der
 * nächste wieder aus (Klasse is-open, gesetzt vom JS). Der :hover-Zustand
 * bleibt sonst nach dem Antippen kleben.
 */
@media (hover: none) {
	.quoi-ref-info {
		cursor: pointer;
	}

	.quoi-ref-info:hover:not(.is-open) .quoi-ref-hover {
		opacity: 0;
		pointer-events: none;
	}
}

.quoi-ref-hover p {
	margin: 0 0 1em;
	font-size: 0.875rem;
	line-height: 1.6;
}

.quoi-ref-hover p:last-child {
	margin-bottom: 0;
}

/* ── Titel-Overlay beim Hover über Bild ──────────────────────────────── */

.quoi-ref-title-hover {
	position: absolute;
	top: 50%;
	left: calc(var(--quoi-ref-tile) + var(--quoi-ref-gap) + var(--quoi-ref-tile) / 2);
	transform: translateY(-50%) translateX(-50%);
	width: var(--quoi-ref-tile);
	font-size: 0.8rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.4;
	text-align: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.quoi-ref-image:hover ~ .quoi-ref-title-hover,
.quoi-ref-image:focus-visible ~ .quoi-ref-title-hover {
	opacity: 1;
}

/* ── Bild-Block ─────────────────────────────────────────────────────── */

.quoi-ref-image {
	position: relative;
	width: var(--quoi-ref-tile);
	height: 460px;
	overflow: hidden;
	cursor: default;
}

/*
 * Aufhellende Schicht beim Hover: Der Titel steht schwarz über dem Bild und
 * ist sonst je nach Motiv kaum zu lesen.
 */
.quoi-ref-image::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.55);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.quoi-ref-image:hover::after,
.quoi-ref-image:focus-visible::after {
	opacity: 1;
}

.quoi-ref-image[data-quoi-lb-gallery] {
	cursor: pointer;
}

.quoi-ref-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.quoi-ref-image[data-quoi-lb-gallery]:hover img {
	transform: scale(1.03);
}

/* ── Nur mobil: „Mehr“ und Galerie-Hinweis ───────────────────────── */

.quoi-ref-more,
.quoi-ref-count {
	display: none;
}

/* Voller Text in der zentralen Lightbox */
.quoi-ref-lb-text h3 {
	/* Nicht die Theme-Überschriftenfarbe (im Dark Mode weiß auf weißer Box) */
	color: inherit;
	margin: 0 0 1em;
	font-size: 0.9rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.quoi-ref-lb-text p {
	margin: 0 0 1em;
	line-height: 1.6;
	hyphens: auto;
}

.quoi-ref-lb-text p:last-child {
	margin-bottom: 0;
}

/* ── Mobile: ein Projekt pro Wisch, Bild oben, Text darunter ────────── */

@media (max-width: 768px) {
	.quoi-referenzen-band {
		/* Rastet immer auf genau ein Projekt ein */
		scroll-snap-type: x mandatory;
	}

	.quoi-referenz {
		flex: 0 0 100%;
		flex-direction: column;
		scroll-snap-align: start;
		scroll-snap-stop: always;
	}

	.quoi-ref-info,
	.quoi-ref-image {
		box-sizing: border-box;
		width: 100%;
		height: auto;
		scroll-snap-align: none;
	}

	.quoi-referenz:nth-child(even) .quoi-ref-info,
	.quoi-referenz:nth-child(even) .quoi-ref-image {
		border-radius: 32px;
	}

	/* Bild */
	.quoi-ref-image {
		order: -1;
		aspect-ratio: 4 / 3;
	}

	.quoi-ref-image::after,
	.quoi-ref-title-hover {
		display: none;
	}

	.quoi-ref-count {
		position: absolute;
		right: 14px;
		bottom: 14px;
		display: flex;
		align-items: center;
		gap: 6px;
		padding: 6px 10px;
		background: rgba(255, 255, 255, 0.9);
		color: #111;
		font-size: 0.75rem;
		line-height: 1;
		border-radius: 20px;
		pointer-events: none;
	}

	.quoi-referenz:nth-child(even) .quoi-ref-count {
		right: 20px;
		bottom: 18px;
	}

	.quoi-ref-count svg {
		width: 14px;
		height: 14px;
	}

	/* Text: Icon + Titel, Anriss, „Mehr“ */
	.quoi-ref-info {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		align-items: center;
		column-gap: 14px;
		row-gap: 12px;
		padding: 20px 24px;
		cursor: default;
	}

	.quoi-referenz:nth-child(even) .quoi-ref-info {
		padding: 22px 28px;
	}

	.quoi-ref-icon {
		flex: none;
	}

	.quoi-ref-icon svg {
		width: 44px;
	}

	.quoi-ref-icon:empty {
		display: none;
	}

	.quoi-ref-hover,
	.quoi-ref-info.is-open .quoi-ref-hover,
	.quoi-ref-info:hover:not(.is-open) .quoi-ref-hover {
		grid-column: 1 / -1;
		position: static;
		opacity: 1;
		pointer-events: auto;
		background: none;
		padding: 0;
		overflow: hidden;
		text-align: left;
		/* Anriss: vier Zeilen, sanft ausgeblendet */
		max-height: calc(0.875rem * 1.6 * 4);
		-webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);
		mask-image: linear-gradient(to bottom, #000 60%, transparent);
	}

	.quoi-ref-hover:empty {
		display: none;
	}

	/* !important: Astra stylt Buttons mit Hintergrund, Rahmen und Schatten */
	.quoi-ref-more,
	.quoi-ref-more:hover,
	.quoi-ref-more:focus,
	.quoi-ref-more:active {
		grid-column: 1 / -1;
		justify-self: end;
		display: inline-flex;
		align-items: center;
		min-height: 44px;
		padding: 0 4px !important;
		background: none !important;
		border: none !important;
		border-radius: 0 !important;
		box-shadow: none !important;
		color: #111 !important;
		font: inherit;
		font-size: 0.8rem;
		letter-spacing: 0.08em;
		text-transform: uppercase;
		text-decoration: none !important;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
	}

	.quoi-ref-more:focus-visible {
		outline: 2px solid #111;
		outline-offset: 2px;
	}

	.quoi-ref-more::after {
		content: "\2192";
		margin-left: 0.5em;
	}

	.quoi-ref-nav {
		width: 44px;
		height: 44px;
	}
}
