/**
 * Radici Casa Vacanze — Animation Styles
 *
 * Stili complementari per Motion.dev:
 * - Hero: particles, scroll indicator, overlay, clip-path
 * - Barra sticky prenotazione
 * - Stati reduced-motion
 * - Performance hints
 *
 * @package Radici_Theme
 * @since   1.6.0
 */

/* ========================================================================
   REDUCED MOTION — mostra tutto immediatamente, nessuna transizione
   ======================================================================== */

.motion-reduce *,
.motion-reduce *::before,
.motion-reduce *::after {
	animation-duration: 0s !important;
	animation-delay: 0s !important;
	transition-duration: 0s !important;
	transition-delay: 0s !important;
	opacity: 1 !important;
	transform: none !important;
}

/* ========================================================================
   HERO — Bokeh particles
   ======================================================================== */

.hero-particles {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 1;
	overflow: hidden;
}

.hero-particle {
	position: absolute;
	left: var(--x, 50%);
	top: var(--y, 50%);
	width: var(--s, 80px);
	height: var(--s, 80px);
	margin-left: calc(var(--s, 80px) / -2);
	margin-top: calc(var(--s, 80px) / -2);
	border-radius: 50%;
	background: radial-gradient(
		circle at 40% 40%,
		rgba(253, 209, 124, 0.25) 0%,
		rgba(253, 209, 124, 0.05) 50%,
		transparent 70%
	);
	animation: hero-float var(--d, 10s) ease-in-out infinite;
	opacity: 0;
}

.hero-particle:nth-child(even) {
	background: radial-gradient(
		circle at 60% 35%,
		rgba(255, 255, 255, 0.18) 0%,
		rgba(255, 255, 255, 0.03) 50%,
		transparent 70%
	);
}

@keyframes hero-float {
	0%, 100% {
		transform: translate(0, 0) scale(1);
	}
	25% {
		transform: translate(15px, -20px) scale(1.15);
	}
	50% {
		transform: translate(-10px, -8px) scale(0.85);
	}
	75% {
		transform: translate(-18px, 15px) scale(1.1);
	}
}

/* ========================================================================
   HERO — Scroll indicator
   ======================================================================== */

.hero-scroll-indicator {
	position: absolute;
	bottom: 2rem;
	left: 0;
	right: 0;
	margin-left: auto;
	margin-right: auto;
	width: fit-content;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	opacity: 1;
	pointer-events: none;
}

.hero-scroll-line {
	display: block;
	width: 2px;
	height: 40px;
	background: rgba(255, 255, 255, 0.9);
	border-radius: 2px;
	transform-origin: top center;
	box-shadow: 0 0 8px rgba(38, 24, 15, 0.5);
}

.hero-scroll-text {
	font-family: var(--wp--preset--font-family--sans, Outfit, sans-serif);
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #fff;
	background: rgba(38, 24, 15, 0.42);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	border-radius: 100px;
	padding: 0.3rem 0.85rem;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

/* ========================================================================
   HERO — Clip-path initial state (per H1 reveal)
   ======================================================================== */

.hero-title {
	will-change: clip-path;
}

/* ========================================================================
   HERO — Overlay enhancement (strato extra sopra il cover background)
   ======================================================================== */

.hero-cover::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(
		ellipse at 50% 35%,
		transparent 0%,
		rgba(38, 24, 15, 0.15) 40%,
		rgba(38, 24, 15, 0.50) 100%
	);
	pointer-events: none;
	z-index: 1;
}

/* ========================================================================
   HERO — Mobile adjustments
   ======================================================================== */

@media (max-width: 782px) {
	.hero-particles {
		display: none; /* Risparmia GPU su mobile */
	}

	.hero-scroll-indicator {
		bottom: 1rem;
	}

	.hero-scroll-line {
		height: 28px;
	}

	.hero-scroll-text {
		font-size: 0.65rem;
	}

	.hero-title {
		/* Su mobile il clip-path reveal è più compatto */
		line-height: 1.05 !important;
	}
}

/* ========================================================================
   HERO — Schermi bassi: compatta la glass card così l'indicatore
   "Scopri di più" non viene mai coperto né tagliato.
   ======================================================================== */

@media (max-height: 820px) {
	.hero-cover .wp-block-cover__inner-container {
		/* Riserva spazio fisso in basso per lo scroll indicator.
		   2026-08-26: padding-top FISSO (env(safe-area-inset-top) oscilla con
		   la URL bar sui dispositivi punch-hole come S21). */
		padding-top: 3.5rem;
		padding-bottom: 5.5rem;
	}

	.hero-content {
		padding: 1rem 1.5rem;
		gap: 0.5rem !important;
	}

	.hero-logo-img img {
		max-height: 56px;
	}

	.hero-content .hero-label {
		font-size: 0.7rem;
		padding: 0.25rem 0.7rem;
		margin-bottom: 0.35rem !important;
	}

	.hero-content .hero-title,
	.hero-content .has-xxxl-font-size {
		font-size: clamp(1.5rem, 4.5vh, 2.4rem) !important;
		margin-bottom: 0.4rem !important;
	}

	.hero-content .hero-subtitle,
	.hero-content .has-lg-font-size {
		font-size: 0.85rem !important;
		margin-bottom: 0.5rem !important;
	}

	.hero-content .wp-block-button__link {
		padding: 0.55rem 1.5rem !important;
		font-size: 0.85rem !important;
	}

	.hero-scroll-indicator {
		bottom: 1rem;
	}

	.hero-scroll-line {
		height: 26px;
	}
}

@media (max-height: 700px) {
	.hero-content {
		padding: 0.85rem 1.25rem;
	}

	.hero-logo-img img {
		max-height: 44px;
	}

	.hero-content .hero-subtitle,
	.hero-content .has-lg-font-size {
		display: none; /* Troppo basso: nascondi il sottotitolo */
	}

	.hero-scroll-line {
		display: none;
	}

	.hero-scroll-indicator {
		bottom: 0.75rem;
	}
}

/* ========================================================================
   HERO — Badge hover (solo desktop)
   ======================================================================== */

@media (hover: hover) {
	.hero-badge {
		transition: background 0.25s ease, transform 0.25s ease;
	}

	.hero-badge:hover {
		background: rgba(255, 255, 255, 0.22) !important;
		transform: translateY(-2px);
	}
}

/* ========================================================================
   STICKY BOOKING BAR (desktop)
   ======================================================================== */

.booking-bar-sticky {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 998;
	background: var(--wp--preset--color--cream, #F4F4EA);
	border-top: 1px solid var(--wp--preset--color--border-light, #D6D4C9);
	padding: 0.75rem 1.25rem;
	padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	flex-wrap: nowrap;
	box-shadow: 0 -2px 16px rgba(38, 24, 15, 0.08);
}

/* Spazio sotto il footer per evitare che la booking bar nasconda i contenuti.
   2026-08-25: alzato a 96px (la barra con bottoni pill + padding supera i 76px
   precedenti, coprendo l'ultima riga del footer). */
@media (min-width: 782px) {
	body {
		padding-bottom: 96px !important;
	}
}

.booking-bar-sticky .wp-block-button__link {
	font-size: 0.9375rem;
	font-weight: 500;
}

@media (max-width: 781px) {
	.booking-bar-sticky {
		display: none !important;
	}
	/* 2026-08-26 — sticky universale: NIENTE padding-bottom sul body mobile.
	   La sticky-cta-mobile è ora in flusso (ultimo figlio di .wp-site-blocks,
	   position:sticky; bottom:0): occupa il suo spazio da sola, e il body
	   senza padding fa sì che .wp-site-blocks copra tutta la pagina
	   (lo sticky header resta agganciato per tutto lo scroll). */
}

/* ========================================================================
   PERFORMANCE HINTS
   ======================================================================== */

.hero-cover,
.hero-content,
.hero-title,
[data-motion="reveal"],
[data-motion="stagger"] > *,
.territory-image {
	will-change: transform, opacity;
}

.hero-title {
	will-change: transform, opacity, clip-path;
}

/* ========================================================================
   TRUST STRIP — large animated icons
   ======================================================================== */

.trust-icon {
	font-size: clamp(2rem, 3.5vw, 2.75rem) !important;
	line-height: 1 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.3s ease;
}

@media (hover: hover) {
	.trust-icon:hover {
		transform: scale(1.15) translateY(-2px);
	}
}

/* ========================================================================
   AMENITIES ICONS
   ======================================================================== */

.amenity-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease;
}

.amenity-icon:hover {
	transform: translateY(-2px);
}
