/* Pop-up del concorso: tutto sotto il prefisso .ci-popup, senza toccare stili del sito. */
.ci-popup,
.ci-popup * {
	box-sizing: border-box;
}

.ci-popup {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	overflow: hidden;
	font-family: inherit;
	opacity: 0;
	transition: opacity 0.25s ease;
}

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

.ci-popup.ci-popup--aperto {
	opacity: 1;
}

.ci-popup__sfondo {
	position: absolute;
	inset: 0;
	background: rgba(5, 14, 27, 0.72);
}

/* Larghezza: al massimo il 90% dello schermo e mai così larga da superare l'altezza
   disponibile (immagine 4:5 + pulsante + margini). */
.ci-popup__finestra {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	width: min(90vw, calc((100vh - 11rem) * 0.8), 520px);
	width: min(90vw, calc((100dvh - 11rem) * 0.8), 520px);
	max-width: 90vw;
	max-height: 96vh;
	max-height: 96dvh;
	outline: none;
}

.ci-popup__immagine {
	display: block;
	line-height: 0;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.ci-popup__immagine img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	border: 0;
	margin: 0;
}

.ci-popup a.ci-popup__pulsante,
.ci-popup a.ci-popup__pulsante:visited {
	display: block;
	width: 100%;
	padding: 0.95rem 1rem;
	border-radius: 50px;
	background: #ff4890;
	color: #050e1b;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.06em;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.ci-popup a.ci-popup__pulsante:hover,
.ci-popup a.ci-popup__pulsante:focus-visible {
	background: #fff;
	color: #050e1b;
}

.ci-popup a:focus-visible,
.ci-popup button:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.ci-popup button.ci-popup__x {
	position: absolute;
	top: -3.1rem;
	right: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	min-width: 42px;
	padding: 0;
	margin: 0;
	border: 3px solid #fff;
	border-radius: 50%;
	background: #050e1b;
	color: #fff;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.ci-popup button.ci-popup__x:hover {
	background: #ff4890;
	color: #050e1b;
}

/* La X sta sopra l'angolo dell'immagine, mai sopra il testo della grafica; su mobile
   lo schermo è alto abbastanza, e la finestra è centrata. */
@media (max-width: 540px) {
	.ci-popup button.ci-popup__x {
		width: 44px;
		height: 44px;
		min-width: 44px;
		top: -3.2rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ci-popup {
		transition: none;
	}
}
