/*
 * TWC Legale — sito pubblico.
 *
 * I colori arrivano dalle variabili --twc-* che il tema definisce (vedi
 * twc-ponte.css di TWT Base). Ogni variabile ha un ripiego: con un tema
 * qualunque il risultato resta leggibile, mai rotto.
 *
 * Niente !important e nessuna regola che esca dai nostri elementi.
 */

/* --- Collegamenti ai documenti -------------------------------------- */

.twc-legale-piede {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.15rem 0.35rem;
	font-size: 0.9em;
	line-height: 1.6;
	color: var(--twc-muted, #5b554e);
}

.twc-legale-piede--center {
	justify-content: center;
}

.twc-legale-piede--right {
	justify-content: flex-end;
}

.twc-legale-piede a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.15em;
	/* Un collegamento legale si tocca anche da un telefono. */
	padding-block: 0.25rem;
}

.twc-legale-piede a:hover,
.twc-legale-piede a:focus-visible {
	color: var(--twc-accent, #8a4b2a);
}

.twc-legale-piede__sep {
	opacity: 0.6;
}

/* --- Nota sotto i moduli -------------------------------------------- */

.twc-legale-nota {
	margin-block: 1rem 0;
	font-size: 0.875em;
	line-height: 1.6;
	color: var(--twc-muted, #5b554e);
	text-wrap: pretty;
}

.twc-legale-nota a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.twc-legale-nota a:hover,
.twc-legale-nota a:focus-visible {
	color: var(--twc-accent, #8a4b2a);
}

/* --- Riquadri dentro i documenti ------------------------------------ */

.twc-legale__nota {
	border-left: 3px solid var(--twc-line, #d8d1c6);
	padding-inline-start: 1rem;
}

.twc-legale__nota > p:last-child,
.twc-legale__avviso > p:last-child {
	margin-bottom: 0;
}

.twc-legale__avviso {
	border-radius: var(--twc-radius-sm, 8px);
	padding: 1rem 1.15rem;
}

/* --- Striscia dei cookie -------------------------------------------- */

.twc-legale-cookie {
	position: fixed;
	z-index: 9998;
	inset-inline: 0;
	bottom: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.5rem 1rem;
	padding: 0.75rem 1rem;
	/* Sui telefoni con la barra di sistema in basso. */
	padding-bottom: calc( 0.75rem + env( safe-area-inset-bottom, 0px ) );
	background: var(--twc-surface, #fff);
	border-top: 1px solid var(--twc-line, #d8d1c6);
	color: var(--twc-ink, #1d1b19);
	font-family: var(--twc-font-body, inherit);
	font-size: 0.875rem;
	line-height: 1.5;
	box-shadow: 0 -2px 12px rgba( 0, 0, 0, 0.08 );
}

/* Lo spazio sotto il contenuto, altrimenti la striscia copre proprio i
 * collegamenti legali che stanno in fondo alla pagina. I browser che non
 * conoscono :has() si comportano come prima: la striscia si chiude. */
body:has( .twc-legale-cookie ) {
	padding-bottom: 5.5rem;
}

.twc-legale-cookie__testo {
	margin: 0;
	max-width: 62ch;
	text-wrap: pretty;
}

.twc-legale-cookie__testo a {
	color: var(--twc-accent, #8a4b2a);
	text-decoration: underline;
	text-underline-offset: 0.15em;
	white-space: nowrap;
}

.twc-legale-cookie__ok {
	flex: none;
	min-height: var(--twc-tap, 44px);
	padding: 0.5rem 1.25rem;
	border: 1px solid var(--twc-accent, #8a4b2a);
	border-radius: var(--twc-radius-sm, 8px);
	background: var(--twc-accent, #8a4b2a);
	color: var(--wp--preset--color--on-accent, #fff);
	font: inherit;
	cursor: pointer;
}

.twc-legale-cookie__ok:hover {
	filter: brightness( 1.08 );
}

.twc-legale-cookie__ok:focus-visible {
	outline: 2px solid var(--twc-ink, #1d1b19);
	outline-offset: 2px;
}

@media ( max-width: 600px ) {
	.twc-legale-cookie {
		flex-direction: column;
		align-items: stretch;
		text-align: start;
	}

	.twc-legale-cookie__ok {
		width: 100%;
	}

	/* Sul telefono la striscia va a capo e diventa più alta: lo spazio
	 * sotto il contenuto cresce con lei. */
	body:has( .twc-legale-cookie ) {
		padding-bottom: 9.5rem;
	}
}

/* Chi ha chiesto meno animazioni non vuole nemmeno un'apparizione. */
@media ( prefers-reduced-motion: no-preference ) {
	.twc-legale-cookie {
		animation: twc-legale-sale 0.25s ease-out;
	}
}

@keyframes twc-legale-sale {
	from {
		transform: translateY( 100% );
	}

	to {
		transform: translateY( 0 );
	}
}

@media print {
	.twc-legale-cookie {
		display: none;
	}
}

/* --- Sezione "Documenti" dell'area clienti --------------------------- */

.twc-legale-account__intro {
	margin-top: 0;
	color: var(--twc-muted, #5b554e);
}

.twc-legale-account__elenco {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.75rem;
}

.twc-legale-account__voce {
	display: grid;
	gap: 0.15rem;
	padding: 0.85rem 1rem;
	border: 1px solid var(--twc-line, #d8d1c6);
	border-radius: var(--twc-radius-sm, 8px);
	background: var(--twc-surface, #fff);
}

.twc-legale-account__titolo {
	font-weight: 600;
	color: inherit;
	text-decoration: none;
	min-height: var(--twc-tap, 44px);
	display: flex;
	align-items: center;
}

.twc-legale-account__titolo:hover,
.twc-legale-account__titolo:focus-visible {
	color: var(--twc-accent, #8a4b2a);
	text-decoration: underline;
}

.twc-legale-account__descrizione,
.twc-legale-account__stato {
	font-size: 0.875em;
	line-height: 1.5;
	color: var(--twc-muted, #5b554e);
	text-wrap: pretty;
}

.twc-legale-account__nuova {
	display: block;
	color: var(--twc-accent, #8a4b2a);
	font-style: normal;
}
