/*
 * Nordstern – Wisch-Effekt „Klare Sicht“ (Logik: assets/js/wipe.js).
 *
 * Ebenen im Cover-Block (von hinten nach vorn):
 * 0  scharfes Bild (Cover) und darüber das beschlagene Glas (Canvas)
 * 1  Farbverlauf des Covers
 * 3  Text-Panel – erscheint erst, wenn die Hand aus dem Bild ist
 * 4  Hand mit Nordstern-Mikrofasertuch
 *
 * Ohne JavaScript oder bei „Bewegung reduzieren“ ist das Bild einfach scharf.
 */

/* Bildausschnitt: Fenster und Liege bleiben auch hochkant im Bild. */
.nordstern-wipe .wp-block-cover__image-background {
	object-position: 68% 50%;
}

/* Text an der Inhaltskante der übrigen Abschnitte ausrichten (breites Raster). */
.nordstern-wipe.alignfull {
	padding-left: max(var(--wp--preset--spacing--50), calc((100% - var(--wp--style--global--wide-size, 1240px)) / 2)) !important;
}

/* Auf schmalen Bildschirmen steht der Text über dem ganzen Bild: Verlauf von unten. */
@media (max-width: 781px) {
	.nordstern-wipe .wp-block-cover__background {
		background: linear-gradient(0deg, rgba(0, 26, 91, 0.3) 0%, rgba(0, 26, 91, 0) 50%) !important;
	}
}

/* ---------- angepinnter Abschnitt ---------- */

.nordstern-wipe-track.is-wipe-ready {
	position: relative;
	height: 270vh;
	height: 270svh;
}

.nordstern-wipe-track.is-wipe-ready > .nordstern-wipe {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
	height: calc(100svh - var(--wp-admin--admin-bar--height, 0px));
	min-height: 0 !important;
}

@media (max-width: 781px) {
	.nordstern-wipe-track.is-wipe-ready {
		height: 240vh;
		height: 240svh;
	}

	/* Platz für die feste Kontaktleiste unten */
	.nordstern-wipe-track.is-wipe-ready > .nordstern-wipe {
		padding-bottom: calc(84px + var(--wp--preset--spacing--50)) !important;
	}
}

/* Ersatzmodus (Seite scrollt nicht selbst, z. B. eingebettete Vorschau): kein Anpinnen, Wisch läuft automatisch. */
.nordstern-wipe-track.is-wipe-ready.is-wipe-auto {
	height: auto;
}

.nordstern-wipe-track.is-wipe-auto > .nordstern-wipe.is-wipe-auto,
.nordstern-wipe.is-wipe-ready.is-wipe-auto {
	position: relative;
	top: auto;
	height: clamp(520px, 60vw, 860px);
	min-height: 0 !important;
}

.nordstern-wipe.is-wipe-auto > .nordstern-wipe__hint {
	display: none !important;
}

/* ---------- beschlagenes Glas (Canvas aus wipe.js) ---------- */

.nordstern-wipe__glass {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

/* ---------- Hand mit Mikrofasertuch ---------- */

.nordstern-wipe__hand {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 4;
	pointer-events: none;
	transform: translate3d(-200vw, 0, 0);
	will-change: transform;
	backface-visibility: hidden;
}

/* Abschnitt als eigene Ebene: Neuzeichnen bleibt auf das Bild beschränkt */
.nordstern-wipe.is-wipe-ready {
	contain: paint;
}

/* Handy: leichter Schatten ohne Weichzeichner-Filter */
.nordstern-wipe__hand.is-leicht > svg {
	filter: none;
}

.nordstern-wipe__hand > svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}

/* ---------- Text-Panel: erst sichtbar, wenn die Hand verschwunden ist ---------- */

.nordstern-wipe.is-wipe-ready .wp-block-cover__inner-container {
	z-index: 3;
	visibility: hidden;
	opacity: 0;
	transform: translate3d(0, 28px, 0);
	transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s;
}

.nordstern-wipe.is-wipe-ready.is-text-visible .wp-block-cover__inner-container {
	visibility: visible;
	opacity: 1;
	transform: none;
	transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s;
}

/* Scroll-Hinweis: nur mit aktivem Effekt (JS setzt ihn direkt ins Cover), verschwindet beim ersten Wischen */
.nordstern-wipe__hint {
	display: none;
}

.nordstern-wipe.is-wipe-ready > .nordstern-wipe__hint {
	position: absolute;
	bottom: clamp(1.25rem, 4vh, 2.5rem);
	left: 50%;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	width: max-content;
	max-width: none;
	margin: 0;
	padding: 0.6rem 1.1rem;
	border-radius: 999px;
	background: rgba(0, 26, 91, 0.78);
	color: #fff;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	transform: translateX(-50%);
	opacity: var(--hint, 1);
	pointer-events: none;
}

/* kleiner Pfeil nach unten */
.nordstern-wipe__hint::after {
	content: "";
	width: 0.5rem;
	height: 0.5rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	animation: nordstern-wipe-hint 1.6s ease-in-out infinite;
}

@keyframes nordstern-wipe-hint {
	0%, 100% { translate: 0 -2px; }
	50% { translate: 0 3px; }
}

@media (max-width: 781px) {
	/* Hinweis über der mobilen Kontaktleiste */
	.nordstern-wipe.is-wipe-ready > .nordstern-wipe__hint {
		bottom: calc(84px + 1rem);
	}
}

@media print {
	.nordstern-wipe__glass,
	.nordstern-wipe__hand {
		display: none;
	}
}

/* Auf dem Handy kompakteres Text-Panel, damit mehr vom Bild sichtbar bleibt */
@media (max-width: 781px) {
	.nordstern-wipe .wp-block-cover__inner-container h2 {
		font-size: 1.875rem !important;
	}

	.nordstern-wipe .wp-block-cover__inner-container p.has-large-font-size {
		font-size: 1rem !important;
	}
}
