/* ==========================================================================
   CDA Net Funzioni 0.4.0 · scena di Natale: traliccio illuminato e neve
   Made by Team CDA Net AS200034

   Solo SVG e CSS. Le animazioni usano opacity, transform e stroke-dashoffset,
   lente e poche; si fermano con "riduci movimento", con la scheda nascosta
   (html.cda-natale-ferma) e con la fascia fuori dallo schermo (.is-ferma).
   ========================================================================== */

.cda-natale-scena {
	position: relative;
	display: block;
	width: 100%;
	height: clamp(220px, 30vw, 380px);
	margin: 0;
	overflow: hidden;
	background: #0B1724;
	color: #FFFFFF;
	isolation: isolate;
}

.cda-natale-scena__svg {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
}

.cda-natale-scena__testo {
	position: absolute;
	left: clamp(16px, 5vw, 72px);
	bottom: clamp(18px, 4vw, 48px);
	max-width: min(26rem, 34%);
	padding: 0.9rem 1.1rem;
	background: rgba(11, 23, 36, 0.62);
	border-left: 4px solid #FF9933;
	border-radius: 0 8px 8px 0;
	z-index: 1;
	text-shadow: 0 1px 8px rgba(11, 23, 36, 0.9);
}

.cda-natale-scena p.cda-natale-scena__titolo {
	margin: 0 0 0.35em !important;
	padding: 0 !important;
	font-family: "cda-jakarta", "Plus Jakarta Sans", system-ui, sans-serif;
	font-size: clamp(1.25rem, 2.4vw, 2.1rem) !important;
	font-weight: 700 !important;
	line-height: 1.15 !important;
	color: #FFFFFF !important;
}

.cda-natale-scena p.cda-natale-scena__sotto {
	margin: 0 !important;
	padding: 0 !important;
	font-family: "cda-jakarta", "Plus Jakarta Sans", system-ui, sans-serif;
	font-size: clamp(0.95rem, 1.2vw, 1.1rem) !important;
	line-height: 1.45 !important;
	color: #FFE7C2 !important;
}

/* Telefono: il traliccio resta al centro, il testo va sotto, su fondo scuro. */
@media (max-width: 767px) {
	.cda-natale-scena {
		height: auto;
		padding-top: 220px;
	}
	.cda-natale-scena__svg {
		height: 236px;
		bottom: auto;
	}
	.cda-natale-scena__testo {
		position: relative;
		left: auto;
		bottom: auto;
		max-width: none;
		padding: 14px 16px 18px;
		background: #0B2545;
		border-left: 0;
		border-radius: 0;
	}
}

/* ---- Animazioni ---- */

.cda-n-luci {
	animation: cda-n-scorre 2.8s linear infinite;
}

.cda-n-luci--b {
	animation-duration: 3.6s;
	animation-direction: reverse;
}

.cda-n-raggio {
	animation: cda-n-scorre-lungo 5s linear infinite;
}

.cda-n-raggio--d {
	animation-duration: 6.2s;
}

.cda-n-stella {
	animation: cda-n-brilla 3.2s ease-in-out infinite;
}

.cda-n-parabola {
	animation: cda-n-dondola 5s ease-in-out infinite;
}

.cda-n-r1 {
	animation-delay: -0.8s;
}

.cda-n-r2 {
	animation-delay: -1.7s;
}

.cda-n-r3 {
	animation-delay: -2.5s;
}

.cda-n-stella-cima {
	animation: cda-n-stella 2.6s ease-in-out infinite;
}

.cda-n-onda {
	opacity: 0;
	animation: cda-n-onda 2.4s ease-out infinite;
}

.cda-n-onda--2 {
	animation-delay: 0.4s;
}

.cda-n-onda--3 {
	animation-delay: 0.8s;
}

.cda-n-fiocchi {
	opacity: 0;
}

@keyframes cda-n-scorre {
	to {
		stroke-dashoffset: -24;
	}
}

@keyframes cda-n-scorre-lungo {
	to {
		stroke-dashoffset: -100;
	}
}

@keyframes cda-n-brilla {
	0%, 100% {
		opacity: 0.35;
	}
	50% {
		opacity: 1;
	}
}

@keyframes cda-n-dondola {
	0%, 100% {
		transform: rotate(-4deg);
	}
	50% {
		transform: rotate(4deg);
	}
}

@keyframes cda-n-stella {
	0%, 100% {
		transform: scale(1);
		opacity: 0.9;
	}
	50% {
		transform: scale(1.08);
		opacity: 1;
	}
}

@keyframes cda-n-onda {
	0% {
		opacity: 0;
	}
	30% {
		opacity: 0.8;
	}
	100% {
		opacity: 0;
	}
}

/* Ferma: scheda nascosta o fascia fuori dallo schermo. */
html.cda-natale-ferma .cda-natale-scena *,
.cda-natale-scena.is-ferma * {
	animation-play-state: paused !important;
}

/* Riduci movimento: scena ferma, luci accese, fiocchi disegnati. */
@media (prefers-reduced-motion: reduce) {
	.cda-natale-scena * {
		animation: none !important;
	}
	.cda-n-onda {
		opacity: 0.6;
	}
	.cda-n-fiocchi {
		opacity: 1;
	}
}

/* Neve leggera su tutto il sito: non si tocca e non copre niente. */
.cda-neve {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 99990;
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	.cda-neve {
		display: none;
	}
}

@media print {
	.cda-natale-scena,
	.cda-neve {
		display: none !important;
	}
}

/* 0.4.2: pupazzo di neve e Babbo Natale sul bordo alto del piede.
   Fuori dal flusso (niente spostamenti), non si toccano, non coprono il piede. */
.cda-natale-amici-casa {
	position: relative;
}
.cda-natale-amici {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
	height: 0;
	pointer-events: none;
	z-index: 5;
}
.cda-natale-amici__posto {
	position: absolute;
	bottom: 0;
	overflow: hidden;
	width: 120px;
	height: 140px;
}
.cda-natale-amici__posto--pupazzo {
	left: max(16px, 4vw);
}
.cda-natale-amici__posto--babbo {
	right: max(16px, 4vw);
	width: 140px;
}
.cda-natale-amici__chi {
	transform: translateY(100%);
	transition: transform .9s cubic-bezier(.2, .9, .3, 1.15);
}
.cda-natale-amici__posto--babbo .cda-natale-amici__chi {
	transition-delay: .35s;
}
.cda-natale-amici.is-visibili .cda-natale-amici__chi {
	transform: translateY(8%);
}
.cda-natale-amici svg {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}
.cda-na-saluto {
	transform-box: fill-box;
	transform-origin: 0% 100%;
}
.cda-natale-amici.is-visibili .cda-na-saluto {
	animation: cda-na-saluta 1.2s ease-in-out 1.1s 4 alternate;
}
.cda-natale-amici.is-visibili .cda-na-braccio-d {
	transform-box: fill-box;
	transform-origin: 0% 100%;
	animation: cda-na-saluta 1.4s ease-in-out .9s 3 alternate;
}
.cda-natale-amici.is-visibili .cda-na-lucina {
	animation: cda-n-brilla 1.6s ease-in-out infinite;
}
@keyframes cda-na-saluta {
	from { transform: rotate(0deg); }
	to { transform: rotate(-18deg); }
}
.cda-natale-amici.is-fermi .cda-natale-amici__chi,
.cda-natale-amici.is-fermi * {
	transition: none !important;
	animation: none !important;
}
@media (max-width: 600px) {
	.cda-natale-amici__posto {
		width: 72px;
		height: 84px;
	}
	.cda-natale-amici__posto--babbo {
		width: 84px;
	}
}
@media (max-width: 319px) {
	.cda-natale-amici {
		display: none;
	}
}
@media (prefers-reduced-motion: reduce) {
	.cda-natale-amici__chi,
	.cda-natale-amici * {
		transition: none !important;
		animation: none !important;
	}
}
@media print {
	.cda-natale-amici {
		display: none !important;
	}
}
html.cda-natale-ferma .cda-natale-amici * {
	animation-play-state: paused !important;
}
