/*
 * Popup promozionale (inc/popup-promo.php).
 *
 * Caricato solo nei giorni in cui il popup è attivo.
 * Scala z: wa 35 < nav 40 < topbar 41 < popup 50 < banner consenso 60.
 * Non usa il top layer di <dialog>: il banner cookie di Iubenda deve
 * restare sopra e cliccabile.
 */

.arsa-popup {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: grid;
	place-items: center;
	padding: 16px;
}

.arsa-popup[hidden] { display: none; }

html.arsa-popup-aperto { overflow: hidden; }

.arsa-popup__velo {
	position: absolute;
	inset: 0;
	background: rgba(var(--arsa-velo-scuro), 0.62);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity var(--arsa-normal) ease;
}

.arsa-popup__scheda {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
	width: min(860px, 100%);
	max-height: calc(100svh - 32px);
	overflow: hidden;
	border-radius: var(--arsa-foto-raggio);
	background: var(--arsa-bg-raise);
	color: var(--arsa-text);
	box-shadow: 0 30px 80px rgba(var(--arsa-velo-scuro), 0.35);
	opacity: 0;
	transform: translateY(14px) scale(0.985);
	transition: opacity var(--arsa-normal) ease, transform var(--arsa-normal) var(--arsa-ease);
}

.arsa-popup__scheda:focus { outline: none; }

.arsa-popup.is-aperto .arsa-popup__velo { opacity: 1; }

.arsa-popup.is-aperto .arsa-popup__scheda {
	opacity: 1;
	transform: none;
}

.arsa-popup__scheda--senza-foto {
	grid-template-columns: minmax(0, 1fr);
	width: min(520px, 100%);
}

.arsa-popup__foto {
	position: relative;
	margin: 0;
	min-height: 100%;
	background: var(--arsa-film);
}

.arsa-popup__foto img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.arsa-popup__corpo {
	display: grid;
	align-content: center;
	justify-items: start;
	gap: 14px;
	padding: clamp(28px, 4vw, 48px);
	overflow-y: auto;
}

.arsa-popup__occhiello {
	margin: 0;
	font-family: var(--arsa-display);
	font-weight: 700;
	font-size: var(--arsa-text-xs);
	letter-spacing: var(--arsa-track-label);
	text-transform: uppercase;
	color: var(--arsa-accent);
}

.arsa-popup__titolo {
	margin: 0;
	font-family: var(--arsa-display);
	font-weight: 500;
	font-size: clamp(1.5rem, 2.6vw, 2.1rem);
	letter-spacing: var(--arsa-track-tight);
	line-height: 1.12;
	text-wrap: balance;
}

.arsa-popup__testo {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--arsa-text-2);
}

.arsa-popup__wa {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
	padding: 14px 24px;
	border-radius: 48px;
	background: var(--arsa-amber);
	color: var(--arsa-ink);
	font-family: var(--arsa-display);
	font-weight: 600;
	font-size: 0.86rem;
	text-decoration: none;
	transition: background var(--arsa-fast) ease, color var(--arsa-fast) ease;
}

.arsa-popup__wa:hover {
	background: var(--arsa-ink);
	color: var(--arsa-plaster-hi);
}

.arsa-popup__wa svg { flex: 0 0 auto; }

.arsa-popup__no {
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--arsa-text-2);
	font-family: var(--arsa-display);
	font-weight: 600;
	font-size: 0.78rem;
	text-decoration: underline;
	text-underline-offset: 4px;
	cursor: pointer;
}

.arsa-popup__no:hover { color: var(--arsa-text); }

.arsa-popup__nota {
	margin: 6px 0 0;
	font-size: 0.72rem;
	line-height: 1.5;
	color: var(--arsa-text-3);
}

.arsa-popup__chiudi {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 50%;
	background: rgba(var(--arsa-velo-scuro), 0.55);
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	transition: background var(--arsa-fast) ease;
}

.arsa-popup__chiudi:hover { background: rgba(var(--arsa-velo-scuro), 0.85); }

.arsa-popup__scheda--senza-foto .arsa-popup__chiudi {
	background: transparent;
	color: var(--arsa-text-2);
}

.arsa-popup a:focus-visible,
.arsa-popup button:focus-visible {
	outline: 2px solid var(--arsa-accent-mark);
	outline-offset: 3px;
}

/* Mobile: foto sopra, testo sotto, finestra appoggiata in basso. */
@media (max-width: 760px) {
	.arsa-popup {
		align-items: end;
		padding: 12px;
	}

	.arsa-popup__scheda {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto minmax(0, 1fr);
		max-height: calc(100svh - 24px);
	}

	.arsa-popup__foto {
		min-height: 0;
		aspect-ratio: 16 / 9;
	}

	/* La foto principale è verticale: nel taglio orizzontale si tiene la
	   vasca, che sta poco sotto il centro. */
	.arsa-popup__foto > img { object-position: 50% 58%; }


	.arsa-popup__corpo {
		gap: 12px;
		padding: 22px 20px 20px;
	}

	.arsa-popup__wa {
		justify-content: center;
		width: 100%;
	}

	.arsa-popup__no { justify-self: center; }
}

@media (prefers-reduced-motion: reduce) {
	.arsa-popup__velo,
	.arsa-popup__scheda { transition: none; }

	.arsa-popup__scheda { transform: none; }
}

@media print {
	.arsa-popup { display: none; }
}
