/* Divenire Spazi Partner */

.dpa-label {
	display: block;
	font: 600 10px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #6b7280;
}

.dpa-frame {
	position: relative;
}

.dpa-link {
	position: relative;
	display: block;
	overflow: hidden;
}

.dpa-slot img {
	display: block;
	width: 100%;
	height: auto;
	transition: opacity .2s ease;
}

.dpa-slot:not(.dpa-ready) img,
.dpa-swap img {
	opacity: 0;
}

/* Il video sta sopra l'immagine e compare solo quando parte davvero. */
.dpa-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	pointer-events: none;
	transition: opacity .15s linear;
}

.dpa-playing .dpa-video {
	opacity: 1;
}

/* Pausa/riprendi per l'animazione (WCAG 2.2.2): area di tocco 44x44. */
.dpa-pause {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.dpa-pause[hidden] {
	display: none;
}

.dpa-pause span {
	position: relative;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .55);
}

/* Due barre = pausa; triangolo = riprendi. */
.dpa-pause span::before,
.dpa-pause span::after {
	content: "";
	position: absolute;
	top: 7px;
	width: 3px;
	height: 10px;
	background: #fff;
}

.dpa-pause span::before {
	left: 8px;
}

.dpa-pause span::after {
	left: 13px;
}

.dpa-pause.dpa-paused span::before {
	left: 9px;
	width: 0;
	height: 0;
	background: none;
	border-style: solid;
	border-width: 5px 0 5px 8px;
	border-color: transparent transparent transparent #fff;
}

.dpa-pause.dpa-paused span::after {
	display: none;
}

.dpa-pause:focus-visible span {
	outline: 2px solid #38bdf8;
	outline-offset: 2px;
}

/* Box dentro l'articolo: lo spazio è riservato per non far saltare il testo. */
.dpa-box {
	clear: both;
	max-width: 300px;
	margin: 28px auto;
}

.dpa-box .dpa-label {
	margin-bottom: 4px;
}

.dpa-box .dpa-link,
.dpa-box img {
	aspect-ratio: 6 / 5;
}

.dpa-box .dpa-link {
	background: #f1f2f4;
}

/* Banner fisso in basso, solo su mobile in verticale. */
.dpa-sticky {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9990;
	padding-bottom: env(safe-area-inset-bottom);
	background: #0d1b24;
	box-shadow: 0 -2px 12px rgba(0, 0, 0, .25);
	transform: translateY(110%);
	transition: transform .35s ease;
}

.dpa-sticky.dpa-open {
	transform: none;
}

.dpa-sticky-bar {
	position: relative;
	height: 24px;
	padding: 0 10px;
	display: flex;
	align-items: center;
}

.dpa-sticky .dpa-label {
	color: #cbd5e1;
}

/* Area di tocco 44x44, cerchio visibile da 30 px. */
.dpa-close {
	position: absolute;
	top: -12px;
	right: 2px;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.dpa-close span {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #fff;
	color: #0d1b24;
	font: 400 22px/30px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	text-align: center;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}

.dpa-close:focus-visible span {
	outline: 2px solid #38bdf8;
	outline-offset: 2px;
}

.dpa-sticky .dpa-frame {
	max-width: 480px;
	margin: 0 auto;
}

.dpa-sticky .dpa-link,
.dpa-sticky img {
	aspect-ratio: 16 / 5;
}

/* Spazio in fondo alla pagina, così il banner non copre il footer. */
html.dpa-sticky-on body {
	padding-bottom: calc(24px + min(31.25vw, 150px) + env(safe-area-inset-bottom));
}

@media (min-width: 768px), (max-height: 450px) {
	.dpa-sticky {
		display: none !important;
	}

	html.dpa-sticky-on body {
		padding-bottom: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dpa-sticky,
	.dpa-slot img,
	.dpa-video {
		transition: none;
	}
}
