/* ==========================================================================
   APS Bewegung: gemeinsames Animationsmodul aller APS-Plugins.
   Lädt nicht im Elementor-Editor. Startzustände hängen an html.aps-motion,
   das nur mit JavaScript und ohne „reduzierte Bewegung“ gesetzt wird.
   Animiert werden nur transform, opacity und clip-path.
   ========================================================================== */

:root {
	--aps-ease: cubic-bezier(.2, .7, .2, 1);
	--aps-dur: 220ms;
	--aps-dur-m: 500ms;
	--aps-dur-l: 800ms;
}

/* ---------- Seitenwechsel ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; }

/* ---------- Knöpfe ---------- */
.aps-knopf, .aps-bereich .aps-btn, .aps-start-suche__los {
	position: relative; overflow: hidden; isolation: isolate;
	transition: color var(--aps-dur) var(--aps-ease), border-color var(--aps-dur) var(--aps-ease), scale 120ms var(--aps-ease), translate 260ms var(--aps-ease);
}
.aps-knopf::before, .aps-bereich .aps-btn::before, .aps-start-suche__los::before {
	content: ""; position: absolute; inset: -1px; z-index: -1;
	background: var(--aps-red-dark);
	transform: scaleX(0); transform-origin: left;
	transition: transform var(--aps-dur) var(--aps-ease);
}
.aps-knopf--linie::before, .aps-bereich .aps-btn:not(.aps-btn--primary):not(.aps-btn--whatsapp)::before { background: var(--aps-ink); }
.aps-ink .aps-knopf--linie::before, .aps-rot .aps-knopf--linie::before { background: var(--aps-on-ink); }
.aps-bereich .aps-btn--whatsapp::before { background: var(--aps-red); }
.aps-knopf:active, .aps-bereich .aps-btn:active, .aps-start-suche__los:active { scale: .98; }

/* Pfeil: läuft beim Hover ein Stück mit. */
.aps-knopf__pfeil { display: inline-block; transition: transform var(--aps-dur) var(--aps-ease); }

@media (hover: hover) and (pointer: fine) {
	.aps-knopf:hover::before, .aps-bereich .aps-btn:hover::before, .aps-start-suche__los:hover::before { transform: scaleX(1); }
	.aps-knopf:hover .aps-knopf__pfeil { transform: translateX(4px); }
}

/* Ladezustand und Erfolg. */
.aps-knopf.ist-laeuft, .aps-bereich .aps-btn.ist-laeuft { pointer-events: none; color: transparent !important; }
.aps-knopf.ist-laeuft::after, .aps-bereich .aps-btn.ist-laeuft::after {
	content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
	border: 2px solid #fff; border-right-color: transparent; border-radius: 50%;
	animation: aps-dreh 700ms linear infinite;
}
@keyframes aps-dreh { to { transform: rotate(360deg); } }
.aps-haken { display: block; width: 56px; height: 56px; margin: 0 0 16px; color: var(--aps-red); }
.aps-haken path { stroke-dasharray: 40; stroke-dashoffset: 0; }
.aps-motion .aps-haken path { animation: aps-haken 500ms var(--aps-ease) 200ms both; }
@keyframes aps-haken { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }

/* ---------- Textlinks ---------- */
.aps-schild dd a, body.aps-design .aps-fuss a, .aps-hinweisband a, .aps-brotkrumen a {
	position: relative; text-decoration: none !important;
}
.aps-schild dd a::after, .aps-fuss a::after, .aps-hinweisband a::after, .aps-brotkrumen a::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor;
	transform: scaleX(0); transform-origin: left; transition: transform var(--aps-dur) var(--aps-ease);
}
.aps-hinweisband a::after, .aps-schild dd a::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) {
	.aps-fuss a:hover::after, .aps-brotkrumen a:hover::after { transform: scaleX(1); }
	.aps-hinweisband a:hover::after, .aps-schild dd a:hover::after { animation: aps-linie var(--aps-dur-m) var(--aps-ease); }
}
@keyframes aps-linie { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Navigation ---------- */
body.aps-design .aps-kopf__liste a { position: relative; border-bottom: 0; }
.aps-kopf__liste a::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--aps-red);
	transform: scaleX(0); transform-origin: left; transition: transform var(--aps-dur) var(--aps-ease);
}
.aps-kopf__liste .current-menu-item > a::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) { .aps-kopf__liste a:hover::after { transform: scaleX(1); } }

/* Kompakter Kopf: Die Höhe bleibt im Layout gleich, oben wird ein Streifen weggeschoben. */
.aps-design-sticky .aps-kopf { top: -14px; }
.admin-bar.aps-design-sticky .aps-kopf { top: 18px; }
.aps-sprache { transition: transform var(--aps-dur) var(--aps-ease); }
.ist-kompakt .aps-sprache { transform: translateY(7px); }
.aps-kopf__logo img, .aps-kopf__nav, .aps-kopf__aktion, .aps-kopf__mobil summary { transition: transform var(--aps-dur) var(--aps-ease); }
.aps-kopf__logo img { transform-origin: left center; }
.ist-kompakt .aps-kopf__logo img { transform: translateY(7px) scale(.8); }
.ist-kompakt .aps-kopf__nav, .ist-kompakt .aps-kopf__aktion, .ist-kompakt .aps-kopf__mobil summary { transform: translateY(7px); }  /* nicht .aps-kopf__mobil selbst: ein transform dort verschiebt das aufgeklappte Menue */

/* ---------- Maschinen-Kacheln ---------- */
.aps-kachel { position: relative; }
.aps-kachel::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--aps-red);
	transform: scaleX(0); transform-origin: left; transition: transform 320ms var(--aps-ease);
}
.aps-kachel__bild img { transition: transform 520ms var(--aps-ease); }
@media (hover: hover) and (pointer: fine) {
	.aps-kachel:hover::after { transform: scaleX(1); }
	.aps-kachel:hover .aps-kachel__bild img { transform: scale(1.04); }
	.aps-kachel:hover .aps-kachel__info, .aps-kachel:hover .aps-kachel__kategorie { animation: aps-einlauf 320ms var(--aps-ease); }
}
.aps-kachel:active .aps-kachel__bild img { transform: scale(1.02); }
@keyframes aps-einlauf { from { transform: translateX(-12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Kategorie-Flächen ---------- */
body.aps-design a.aps-flaechen__eintrag { position: relative; overflow: hidden; isolation: isolate; }
body.aps-design a.aps-flaechen__eintrag::before {
	content: ""; position: absolute; inset: 0; z-index: -1; background: var(--aps-ink);
	transform: scaleX(0); transform-origin: left; transition: transform 320ms var(--aps-ease);
}
body.aps-design a.aps-flaechen__eintrag:nth-child(1)::before { background: var(--aps-red-dark); }
.aps-flaechen__name, .aps-flaechen__zahl { transition: transform 320ms var(--aps-ease), opacity var(--aps-dur) linear; }
.aps-flaechen__gross {
	position: absolute; right: 16px; bottom: -.12em; z-index: -1;
	font-size: clamp(4rem, 3rem + 5vw, 8rem); font-weight: 700; line-height: 1; letter-spacing: -.04em;
	opacity: 0; transform: translateY(24px); transition: transform 320ms var(--aps-ease), opacity var(--aps-dur) linear;
}
.aps-flaechen__pfeil { position: absolute; right: 20px; top: 20px; font-size: 1.5rem; line-height: 1; opacity: 0; transform: translateX(-14px); transition: transform 320ms var(--aps-ease), opacity var(--aps-dur) linear; }
@media (hover: hover) and (pointer: fine) {
	body.aps-design a.aps-flaechen__eintrag:hover { background: var(--aps-paper); color: var(--aps-paper); }
	body.aps-design a.aps-flaechen__eintrag:nth-child(1):hover { background: var(--aps-red); color: #fff; }
	body.aps-design a.aps-flaechen__eintrag:hover::before { transform: scaleX(1); }
	.aps-flaechen__eintrag:hover .aps-flaechen__name { transform: translateX(8px); }
	.aps-flaechen__eintrag:hover .aps-flaechen__zahl { opacity: 0; }
	.aps-flaechen__eintrag:hover .aps-flaechen__gross { opacity: .9; transform: none; }
	.aps-flaechen__eintrag:hover .aps-flaechen__pfeil { opacity: 1; transform: none; }
}
body.aps-design a.aps-flaechen__eintrag:active .aps-flaechen__name { transform: translateX(4px); }

/* ---------- Typenschild-Zeilen ---------- */
.aps-schild__zeile { position: relative; isolation: isolate; }
.aps-schild__zeile::before {
	content: ""; position: absolute; inset: 0 -8px; z-index: -1; background: var(--aps-flaeche-2, #E8E2D7);
	opacity: 0; transition: opacity var(--aps-dur) linear;
}
.aps-ink .aps-schild__zeile::before { background: var(--aps-paper); }
.aps-schild dd { transition: color var(--aps-dur) linear; }
.aps-schild dt { transition: color var(--aps-dur) linear; }
@media (hover: hover) and (pointer: fine) {
	.aps-schild__zeile:hover::before { opacity: 1; }
	.aps-schild__zeile:hover dt { color: var(--aps-ink); }
	.aps-schild__zeile:hover dd, .aps-schild__zeile:hover dd a { color: var(--aps-red); }
	.aps-ink .aps-schild__zeile:hover dt { color: var(--aps-ink); }
	.aps-rot .aps-schild__zeile:hover dt { color: var(--aps-ink); }
}

/* ---------- FAQ ---------- */
.aps-faq summary { transition: color var(--aps-dur) linear; }
.aps-faq summary::after { content: "+"; transition: transform 280ms var(--aps-ease); }
.aps-faq details[open] summary::after { content: "+"; transform: rotate(45deg); }
.aps-faq .aps-faq__antwort { overflow: hidden; }
@media (hover: hover) and (pointer: fine) {
	.aps-faq summary:hover { color: var(--aps-red); }
	.aps-faq--dunkel summary:hover { color: #fff; }
}

/* ---------- Einblendungen beim Scrollen ---------- */
/* Überschriften: Zeile schiebt sich aus einer Linie nach oben. */
.aps-wartet :is(.aps-start-hero__text h1, .aps-seitenkopf h1) { opacity: 0; }
.aps-motion .aps-hl:not(.ist-da) { opacity: 0; }
.aps-zeile { display: block; overflow: hidden; padding-bottom: .14em; margin-bottom: -.14em; }
.aps-zeile__in { display: block; animation: aps-zeile var(--aps-dur-m) var(--aps-ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes aps-zeile { from { transform: translateY(108%); } to { transform: none; } }

/* Linien zeichnen sich von links nach rechts. */
.aps-motion .aps-zeichnen:not(.ist-da) .aps-schild__zeile { opacity: 0; }
.aps-motion .aps-zeichnen:not(.ist-da)::before,
.aps-motion .aps-zeichnen:not(.ist-da) .aps-schild__zeile::after { transform: scaleX(0); }
.aps-motion .aps-zeichnen .aps-schild__zeile { transition: opacity 360ms linear; transition-delay: calc(var(--i, 0) * 50ms); }
.aps-motion .aps-zeichnen .aps-schild__zeile::after { transition: transform 600ms var(--aps-ease); transition-delay: calc(var(--i, 0) * 50ms); }
.aps-motion .aps-zeichnen::before { transition: transform 600ms var(--aps-ease); }

/* Bilder: Enthüllung per Wipe. */
.aps-motion .aps-wipe:not(.ist-da) { clip-path: inset(0 100% 0 0); }
.aps-motion .aps-wipe { transition: clip-path var(--aps-dur-l) var(--aps-ease); transition-delay: calc(var(--i, 0) * 70ms); }

/* Flächen und Schritte: kurzes Anheben. */
.aps-motion .aps-heben:not(.ist-da) { opacity: 0; transform: translateY(18px); }
.aps-motion .aps-heben { transition: opacity 420ms linear, transform 420ms var(--aps-ease); transition-delay: calc(var(--i, 0) * 60ms); }

/* Neu geladene Kacheln im Katalog. */
.aps-tausch .aps-raster__eintrag { animation: aps-tausch 320ms var(--aps-ease) both; animation-delay: calc(var(--i, 0) * 24ms); }
@keyframes aps-tausch { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Hero ---------- */
.aps-start-hero__folien { will-change: transform; }
.aps-start-hero__folie { transition: opacity 900ms var(--aps-ease); }
.aps-faden { position: absolute; z-index: 1; pointer-events: none; background: var(--aps-red); opacity: 0; transition: opacity 300ms linear; }
.aps-faden--x { left: 0; right: 0; top: 0; height: 1px; }
.aps-faden--y { top: 0; bottom: 0; left: 0; width: 1px; }
.aps-start-hero.ist-maus .aps-faden { opacity: .28; }
.aps-start-hero__text, .aps-start-hero__suchrahmen { position: relative; z-index: 4; }
.aps-start-hero__suchrahmen { position: absolute; }

/* ---------- Laufband ---------- */
.aps-lauf { display: flex; overflow: hidden; }
.aps-lauf__spur { display: flex; flex: 0 0 auto; gap: 0; margin: 0; padding: 0; list-style: none; }
.aps-motion .aps-lauf__spur { animation: aps-lauf var(--aps-lauf-dauer, 48s) linear infinite; }
.aps-lauf:hover .aps-lauf__spur, .aps-lauf:focus-within .aps-lauf__spur, .aps-lauf.ist-pause .aps-lauf__spur { animation-play-state: paused; }
@keyframes aps-lauf { to { transform: translateX(-100%); } }

/* ---------- Ablauf ---------- */
.aps-motion .aps-start-ablauf .aps-schritte li { opacity: .62; transition: opacity 300ms linear; }
.aps-motion .aps-start-ablauf .aps-schritte li.ist-aktiv { opacity: 1; }
.aps-start-ablauf__balken { transform: scaleY(var(--aps-fortschritt, 1)); transform-origin: top; }
.aps-motion .aps-start-ablauf__balken { transform: scaleY(var(--aps-fortschritt, 0)); }
.aps-start-ablauf__nummer.ist-wechsel { animation: aps-nummer 320ms var(--aps-ease); }
@keyframes aps-nummer { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Katalog lädt ---------- */
.aps-katalog { position: relative; }
.aps-katalog::before {
	content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--aps-red);
	transform: scaleX(0); transform-origin: left; opacity: 0;
}
.aps-katalog.ist-laedt::before { opacity: 1; animation: aps-laden 1.1s var(--aps-ease) infinite; }
@keyframes aps-laden { 0% { transform: scaleX(0); } 70% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: 0; } }
.aps-katalog.ist-laedt .aps-raster { opacity: .45; transition: opacity 160ms linear; }

/* ---------- Reduzierte Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; scroll-behavior: auto !important; }
	.aps-lauf { flex-wrap: wrap; }
	.aps-lauf__spur { flex-wrap: wrap; }
	.aps-lauf__spur[aria-hidden="true"] { display: none; }
	::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
