/* urform Wechselwort – v1.4.1
 * Robust gegen fremde Theme-/Plugin-Regeln (z. B. „.is-active“, „h2 span“,
 * „span { font-size … }“):
 * – Text und Wörter erben ihre Schrift zwingend (!important) vom Widget,
 * – das Wechselwort bekommt seine Schrift ausschließlich über
 *   „Stil → Wechselwort“ (Elementor-Selektor ist spezifischer als der Reset).
 * Sichtbarkeit wird nie erzwungen (immer „inherit“): Unsichtbare Kopien, z. B. der
 * Platzhalter von Elementor-Sticky, bleiben dadurch unsichtbar.
 */

.ufww {
	margin: 0;
}

/* Text davor/danach: immer exakt wie die Überschrift. */
.ufww .ufww-text {
	display: inline !important;
	position: static !important;
	margin: 0 !important;
	padding: 0 !important;
	font-family: inherit !important;
	font-size: inherit !important;
	font-weight: inherit !important;
	font-style: inherit !important;
	line-height: inherit !important;
	letter-spacing: inherit !important;
	word-spacing: inherit !important;
	text-transform: inherit !important;
	color: inherit !important;
	opacity: 1 !important;
	visibility: inherit !important;
	transform: none !important;
}

.ufww ufww-br {
	display: none;
	margin: 0;
	padding: 0;
	height: 0;
}

/* Wechselbereich: erbt von der Überschrift, solange unter
   „Stil → Wechselwort“ nichts eingestellt ist (dessen Selektor ist spezifischer). */
.ufww ufww-wechsel.ufww-rotator {
	--ufww-mask: 0.15em;
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	font-style: inherit;
	line-height: inherit;
	letter-spacing: inherit;
	word-spacing: inherit;
	text-transform: inherit;
	opacity: 1;
	visibility: inherit;
	position: relative;
	display: inline-block;
	width: auto;
	min-width: 0;
	max-width: none;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	white-space: nowrap;
	text-align: left;
	vertical-align: baseline;
	transform: none;
	/* Maske: oben/unten etwas Zugabe für Umlaute und Unterlängen,
	   seitlich minimal für Überhänge. Beeinflusst das Layout nicht. */
	-webkit-clip-path: inset(calc(-1 * var(--ufww-mask)) -0.06em);
	clip-path: inset(calc(-1 * var(--ufww-mask)) -0.06em);
}

/* Kein Text rechts daneben (eigene Zeile / Satzende): seitlich nicht maskieren. */
.ufww ufww-wechsel.ufww-rotator.ufww-rotator--free {
	-webkit-clip-path: inset(calc(-1 * var(--ufww-mask)) -100vw);
	clip-path: inset(calc(-1 * var(--ufww-mask)) -100vw);
}

/* Wörter: Schrift zwingend vom Wechselbereich – keine fremde Regel kommt dazwischen. */
.ufww .ufww-rotator .ufww-word,
.ufww .ufww-rotator .ufww-word__in {
	font-family: inherit !important;
	font-size: inherit !important;
	font-weight: inherit !important;
	font-style: inherit !important;
	line-height: inherit !important;
	letter-spacing: inherit !important;
	word-spacing: inherit !important;
	text-transform: inherit !important;
	text-decoration: inherit !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	white-space: nowrap !important;
	min-width: 0 !important;
	max-width: none !important;
}

.ufww .ufww-rotator .ufww-word {
	position: relative;
	display: inline-block !important;
	width: auto;
	height: auto !important;
	transform: none;
	opacity: 1;
	visibility: inherit;
	vertical-align: baseline !important;
}

.ufww .ufww-rotator .ufww-word__in {
	display: inline !important;
	position: static !important;
	color: inherit !important;
	opacity: 1 !important;
	visibility: inherit !important;
	transform: none !important;
}

.ufww .ufww-rotator .ufww-word:not(.ufww-word--active) {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	-webkit-user-select: none;
	user-select: none;
}

.ufww .ufww-rotator .ufww-word.ufww-word--leaving {
	opacity: 1;
	visibility: inherit;
}

/* Während des Wechsels: Grafikkarte vorwarnen – flüssigere Bewegung. */
.ufww .ufww-rotator.ufww-rotator--animating .ufww-word,
.ufww .ufww-rotator.ufww-rotator--animating .ufww-char {
	will-change: transform, opacity, filter;
	backface-visibility: hidden;
}

/* Effekt „Buchstaben“ */
.ufww .ufww-rotator .ufww-chars {
	display: inline !important;
	white-space: nowrap !important;
}

.ufww .ufww-rotator .ufww-char {
	display: inline-block !important;
	white-space: pre !important;
	font: inherit !important;
	letter-spacing: inherit !important;
	text-transform: inherit !important;
	color: inherit !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Text nur für Screenreader (ganzes Wort statt einzelner Buchstaben) */
.ufww .ufww-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
	.ufww .ufww-rotator.ufww-rotator--animating .ufww-word,
	.ufww .ufww-rotator.ufww-rotator--animating .ufww-char {
		will-change: auto;
	}
}
