/* Dedeho Hero 1.1.0 — Author: Dedeho (https://dedeho.it)
   Struttura attesa: contenitore "stage" con, in ordine: [1] widget Shortcode [dedeho_hero_laptop], [2] blocco testo, [3-6] le quattro icone
   (sinistra alto, sinistra basso, destra alto, destra basso). Il layout è gestito qui: in Elementor basta rispettare l'ordine. */

/* ---------- stage ---------- */
div:has(> .elementor-widget-shortcode .dd-hl-fig) {
	position: relative;
	display: block;
	width: 100%;
	max-width: 1400px;
	margin-inline: auto;
	padding: 0;
	container-type: inline-size;
}
div:has(> .elementor-widget-shortcode .dd-hl-fig) > .elementor-widget-shortcode {
	width: 74.286%;
	max-width: 1040px;
	margin-inline: auto;
}
.dd-hl-fig {
	position: relative;
	margin: 0;
	padding: 0;
	aspect-ratio: 1560 / 1000;
	line-height: 0;
}
.dd-hl-fig .dd-hl-poster {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	border: 0;
	border-radius: 0;
}
.dd-hl-fig .dd-hl-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: none;
}
.dd-hl-fig.is-ready .dd-hl-canvas { display: block; }
.dd-hl-fig.is-ready .dd-hl-poster { visibility: hidden; }

/* ---------- testo "dentro lo schermo" (desktop e tablet) ---------- */
div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) {
	position: absolute;
	z-index: 2;
	left: 23.33%;
	top: 8.2%;
	width: 53.26%;
	height: 62.9%;
	min-width: 0;
	margin: 0;
	padding: 0 2.4cqw;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: clamp(8px, 1.6cqw, 20px);
	text-align: center;
	color: var(--ink, #1d1d1b);
}
div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) :is(h1, h2) {
	margin: 0 !important;
	font-size: clamp(1.15rem, 4.1cqw, 3.7rem) !important;
	line-height: 1.08 !important;
	text-wrap: balance;
}
div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) p {
	margin: 0 !important;
	font-size: clamp(.8rem, 1.8cqw, 1.5rem) !important;
	line-height: 1.4 !important;
}
div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) :is(a, button) {
	font-size: clamp(.75rem, 1.5cqw, 1.2rem) !important;
	padding: .65em 1.4em !important;
}

/* ---------- icone laterali ---------- */
div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(n+3) {
	position: absolute;
	z-index: 3;
	width: clamp(72px, 11.5cqw, 160px);
	min-width: 0;
	margin: 0;
	padding: 0;
	--dd-hl-s: 1;
	--dd-hl-dy: 12cqw;
}
div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(n+3) img {
	display: block;
	width: 100%;
	height: auto;
	max-width: none;
}
div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(3) { left: 3%;  top: 9%; }
div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(4) { left: 3%;  top: 45%; --dd-hl-dy: -2cqw; }
div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(5) { right: 3%; top: 9%; --dd-hl-s: -1; }
div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(6) { right: 3%; top: 45%; --dd-hl-s: -1; --dd-hl-dy: -2cqw; }

/* ---------- stato nascosto (solo se JS attivo) e apparizione ---------- */
@keyframes dd-hl-failsafe { to { opacity: 1; transform: none; } }

html.dd-hl-js div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) {
	opacity: 0;
	transform: translateY(12px);
	animation: dd-hl-failsafe .3s ease 4.5s forwards;
}
html.dd-hl-js div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(n+3) {
	opacity: 0;
	transform: translate(calc(var(--dd-hl-s) * 40cqw), var(--dd-hl-dy)) scale(.35);
	animation: dd-hl-failsafe .3s ease 4.5s forwards;
}
html.dd-hl-js div.is-open:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) {
	opacity: 1;
	transform: none;
	animation: none;
	transition: opacity .45s ease, transform .55s cubic-bezier(.22, .8, .24, 1);
}
html.dd-hl-js div.is-open:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(n+3) {
	opacity: 1;
	transform: none;
	animation: none;
	transition: opacity .35s ease, transform .7s cubic-bezier(.22, 1.2, .36, 1);
}
html.dd-hl-js div.is-open:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(4) { transition-delay: .06s; }
html.dd-hl-js div.is-open:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(5) { transition-delay: .03s; }
html.dd-hl-js div.is-open:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(6) { transition-delay: .09s; }
html.dd-hl-js div.is-open.is-instant:has(> .elementor-widget-shortcode .dd-hl-fig) > *,
html.dd-hl-js div.is-open.is-instant:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) > * { transition: none; transition-delay: 0s; }

/* ---------- mobile: nello schermo solo l'H1; sotto il computer sottotitolo, CTA e icone 2×2 ---------- */
@media (max-width: 767px) {
	div:has(> .elementor-widget-shortcode .dd-hl-fig) {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 20px 12px;
		justify-items: center;
		max-width: 560px;
	}
	/* computer e H1 nella stessa cella: l'H1 sta dentro lo schermo (14,1% da sinistra, 71,7% di larghezza) */
	div:has(> .elementor-widget-shortcode .dd-hl-fig) > .elementor-widget-shortcode {
		grid-area: 1 / 1 / 2 / -1;
		width: 100%;
		max-width: none;
	}
	/* il blocco testo si "dissolve" nella griglia: H1, sottotitolo e CTA diventano elementi dello stage */
	div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) {
		display: contents;
	}
	div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) > :nth-child(1) {
		grid-area: 1 / 1 / 2 / -1;
		z-index: 2;
		align-self: start;
		justify-self: center;
		width: 71.7%;
		height: 40.3cqw;
		margin: 5.26cqw 0 0;
		display: flex;
		align-items: center;
		justify-content: center;
		text-align: center;
	}
	div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) > :nth-child(1) :is(h1, h2) {
		font-size: clamp(.85rem, 5.7cqw, 1.7rem) !important;
		line-height: 1.1 !important;
	}
	div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) > :nth-child(n+2) {
		grid-column: 1 / -1;
		width: 100%;
		text-align: center;
		display: flex;
		justify-content: center;
	}
	div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) > :nth-child(2) { margin-top: 4px; }
	div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) > :nth-child(2) p { font-size: 1.05rem !important; }
	div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) > :nth-child(3) :is(a, button) { font-size: 1rem !important; }
	div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(n+3) {
		position: static;
		width: min(38cqw, 160px);
	}

	/* nascosto/apparizione: sul blocco testo (display: contents) non agiscono, quindi si applicano ai tre figli */
	html.dd-hl-js div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) {
		opacity: 1;
		transform: none;
		animation: none;
		transition: none;
	}
	html.dd-hl-js div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) > * {
		opacity: 0;
		transform: translateY(12px);
		animation: dd-hl-failsafe .3s ease 4.5s forwards;
	}
	html.dd-hl-js div.is-open:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) > * {
		opacity: 1;
		transform: none;
		animation: none;
		transition: opacity .45s ease, transform .55s cubic-bezier(.22, .8, .24, 1);
	}
	html.dd-hl-js div.is-open:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) > :nth-child(2) { transition-delay: .08s; }
	html.dd-hl-js div.is-open:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) > :nth-child(3) { transition-delay: .16s; }
	html.dd-hl-js div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(n+3) { transform: scale(.5); }
}

@media (prefers-reduced-motion: reduce) {
	html.dd-hl-js div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(n+2),
	html.dd-hl-js div:has(> .elementor-widget-shortcode .dd-hl-fig) > :nth-child(2) > * {
		opacity: 1;
		transform: none;
		animation: none;
		transition: none;
	}
}
