/*
 * Dragon & Lotus — movimenti.
 * Regola: ogni stato che nasconde vale solo con html.dl-js (JavaScript attivo) e non con .dl-static
 * (riduci movimento). Senza JavaScript tutto resta visibile.
 */

:root {
	--dl-ease: cubic-bezier(.2, .8, .2, 1);
	--dl-ease-curtain: cubic-bezier(.65, 0, .15, 1);
}

/* ---------- prima schermata: foto che respira (scala separata dalla traslazione dello script) ---------- */
html.dl-js:not(.dl-static) .dl-hero .wp-block-cover__image-background {
	animation: dl-breathe 22s ease-in-out infinite alternate;
	will-change: transform, scale;
}
@keyframes dl-breathe {
	from { scale: 1.04; }
	to { scale: 1.14; }
}

/* ---------- titoli che salgono riga per riga ---------- */
html.dl-js:not(.dl-static) .dl-lines {
	clip-path: inset(0 0 0 0);
}
html.dl-js:not(.dl-static) .dl-lines .dl-line {
	display: block;
	overflow: hidden;
}
html.dl-js:not(.dl-static) .dl-lines .dl-line > span {
	display: inline-block;
	transform: translateY(105%);
	transition: transform 1.1s var(--dl-ease);
}
html.dl-js:not(.dl-static) .dl-lines .dl-line:nth-child(2) > span { transition-delay: .12s; }
html.dl-js:not(.dl-static) .dl-lines .dl-line:nth-child(3) > span { transition-delay: .24s; }
html.dl-js:not(.dl-static) .dl-lines:not(:has(.dl-line)) {
	clip-path: none;
	opacity: 0;
	transform: translateY(40px);
	transition: opacity .9s var(--dl-ease), transform 1.1s var(--dl-ease);
}
html.dl-js:not(.dl-static) .dl-lines.is-in .dl-line > span,
html.dl-js:not(.dl-static) .dl-lines.is-in:not(:has(.dl-line)) {
	opacity: 1;
	transform: none;
}

/* ---------- linee oro che si disegnano ---------- */
html.dl-js:not(.dl-static) .dl-rule {
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 1.2s var(--dl-ease) .2s;
}
html.dl-js:not(.dl-static) .dl-rule.is-in { transform: scaleX(1); }

/* ---------- foto che si aprono dal basso ---------- */
html.dl-js:not(.dl-static) .dl-reveal img {
	clip-path: inset(100% 0 0 0 round 24px);
	transition: clip-path 1.4s var(--dl-ease-curtain);
}
html.dl-js:not(.dl-static) .dl-reveal.is-in img { clip-path: inset(0 0 0 0 round 24px); }

/* ---------- gruppi che entrano uno dopo l'altro ---------- */
html.dl-js:not(.dl-static) .dl-stagger > * {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity .8s var(--dl-ease), transform .9s var(--dl-ease);
	transition-delay: calc(var(--i, 0) * 90ms);
}
html.dl-js:not(.dl-static) .dl-stagger.is-in > * {
	opacity: 1;
	transform: none;
}

/* ---------- foto che si ingrandiscono al passaggio del mouse ---------- */
.dl-zoom { overflow: hidden; border-radius: 24px; }
.dl-zoom img { transition: scale 1.2s var(--dl-ease); }
html.dl-js:not(.dl-static) .dl-zoom:hover img { scale: 1.04; }

/* ---------- foto dentro la cornice (lo script sposta l'immagine) ---------- */
.dl-parallax { overflow: hidden; border-radius: 24px; }
html.dl-js:not(.dl-static) .dl-parallax img { will-change: transform; }

/* ---------- frase che si colora (gradiente sul testo, nessuna divisione in parole) ---------- */
html.dl-js:not(.dl-static) .dl-fill {
	color: transparent;
	background-image: linear-gradient(90deg, var(--wp--preset--color--black) 0%, #D4D4D4 0%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-box-decoration-break: slice;
	box-decoration-break: slice;
}
html.dl-js:not(.dl-static) .dl-fill mark,
html.dl-js:not(.dl-static) .dl-fill .has-red-color {
	color: var(--wp--preset--color--red);
	-webkit-text-fill-color: var(--wp--preset--color--red);
	background: none;
}

/* ---------- fascia delle lezioni ---------- */
.dl-marquee { overflow: hidden; white-space: nowrap; }
.dl-marquee__track { display: inline-block; }
html.dl-js:not(.dl-static) .dl-marquee__track { animation: dl-slide 40s linear infinite; }
@keyframes dl-slide { to { transform: translateX(-50%); } }

/* ---------- pulsanti magnetici ---------- */
.dl-magnet a, .dl-magnet button { transition: transform .35s var(--dl-ease), background-color .3s; }

/* ---------- pulsante dell'intestazione ---------- */
/* vale anche in modalità statica (lo script aggiorna lo stato); visibility evita il fuoco da tastiera quando è nascosto */
html.dl-js .dl-head-cta {
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	pointer-events: none;
	transition: opacity .45s var(--dl-ease), transform .45s var(--dl-ease), visibility 0s linear .45s;
}
html.dl-js .dl-head-cta.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
	pointer-events: auto;
	transition: opacity .45s var(--dl-ease), transform .45s var(--dl-ease), visibility 0s;
}

/* ---------- menu a schermo intero: voci in sequenza ---------- */
html.dl-js:not(.dl-static) .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	animation: dl-menu-in .6s var(--dl-ease) both;
	animation-delay: calc(var(--i, 0) * 70ms + 120ms);
}
@keyframes dl-menu-in {
	from { opacity: 0; translate: 0 18px; }
	to { opacity: 1; translate: 0 0; }
}

/* ---------- domande frequenti ---------- */
.dl-faq details, details.dl-faq { overflow: hidden; }

/* ---------- riduci movimento e modalità statica: tutto visibile e fermo ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}
.dl-static .dl-lines .dl-line > span,
.dl-static .dl-lines,
.dl-static .dl-stagger > *,
.dl-static .dl-rule {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}
.dl-static .dl-reveal img { clip-path: none; }
.dl-static .dl-fill { color: inherit; background: none; }
