/*
 * Slider della home «tci_slider» (inc/home-slider.php, js/home-slider.js).
 * Riproduce lo slider di Revolution Slider: griglia di progetto per livello (d/n/t/m), tutto scalato
 * con --s = min(1, larghezza/grigliaL, altezza/grigliaA), calcolato dal JS. Font in rem.
 * Livelli (come nell'originale): d da 1024 px, n da 778, t da 480, m sotto.
 */
.tci-sl {
	/* --s e i valori arrotondati (--tf --tl --bf --bl --bp --bw) li imposta il JS, come faceva Revolution Slider */
	--s: 1; --tf: 24; --tl: 20; --bf: 15; --bl: 45; --bp: 30; --bw: 2;
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	height: calc(100vh - 80px);
	overflow: hidden;
	background: transparent;
	color: #fff;
	font-family: Chivo, sans-serif;
	text-align: left;
}
@media (max-width: 1199.98px) {
	.tci-sl { height: 100vh; }
}

/* Valori di progetto per livello (px non scalati; i font sono in rem) */
.tci-sl[data-lv="d"] { --gx: 78;  --gxr: 115; --gy: -18; --gw: 300; --gh: 180; --tw: 400; --down: 70; --downb: 50px; }
.tci-sl[data-lv="n"] { --gx: 64;  --gxr: 94;  --gy: -14; --gw: 247; --gh: 148; --tw: 300; --down: 50; --downb: 40px; }
.tci-sl[data-lv="t"] { --gx: 48;  --gxr: 71;  --gy: -10; --gw: 187; --gh: 112; --tw: 300; --down: 50; --downb: 40px; }
.tci-sl[data-lv="m"] { --gx: 29;  --gxr: 43;  --gy: -6;  --gw: 115; --gh: 69;  --tw: 300; --down: 50; --downb: 40px; }
.tci-sl[data-lv="d"] { --wg: 1240; }
.tci-sl[data-lv="n"] { --wg: 1024; }
.tci-sl[data-lv="t"] { --wg: 778; }
.tci-sl[data-lv="m"] { --wg: 480; }

.tci-sl__stage { position: absolute; inset: 0; }
.tci-sl__slide { position: absolute; inset: 0; visibility: hidden; overflow: hidden; }
.tci-sl__slide.is-active { visibility: visible; }
.tci-sl__img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tci-sl__shade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }

/* Gruppo testo + pulsante (box di progetto centrato verticalmente) */
.tci-sl__group {
	position: absolute;
	width: calc(var(--s) * var(--gw) * 1px);
	height: calc(var(--s) * var(--gh) * 1px);
}
.tci-sl__group--left {
	left: calc(50% + var(--s) * (var(--gx) - var(--wg) / 2) * 1px);
	top: calc(50% + var(--s) * (var(--gy) - var(--gh) / 2) * 1px);
}
.tci-sl__group--right {
	right: calc(50% + var(--s) * (var(--gxr) - var(--wg) / 2) * 1px);
	top: calc(50% + var(--s) * (0 - var(--gh) / 2) * 1px);
}

.tci-sl .tci-sl__text {
	position: absolute;
	left: calc(var(--s) * 15px);
	top: calc(50% - var(--s) * 41px);
	transform: translateY(-50%);
	margin: 0;
	padding: 0;
	color: #fff;
	font: var(--tw) calc(var(--tf) * 0.0625rem) / calc(var(--tl) * 1px) Chivo, sans-serif;
	letter-spacing: calc(var(--s) * 2px);
	text-align: center;
	white-space: nowrap;
}
.tci-sl[data-lv="n"] .tci-sl__text,
.tci-sl[data-lv="t"] .tci-sl__text { left: 50%; top: calc(50% + var(--s) * 10px); transform: translate(-50%, -50%); }
.tci-sl[data-lv="m"] .tci-sl__text { left: 50%; top: calc(50% - var(--s) * 60px); transform: translate(-50%, -50%); }
.tci-sl__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.tci-sl .tci-sl__btn,
.tci-sl a.tci-sl__btn {
	position: absolute;
	display: block;
	box-sizing: border-box;
	left: calc(var(--s) * 72px);
	top: calc(50% + var(--s) * 14px);
	transform: translateY(-50%);
	padding: 0 calc(var(--bp) * 1px);
	border: calc(var(--bw) * 1px) solid #fff;
	border-radius: 30px;
	background: transparent;
	color: #fff;
	font: 400 calc(var(--bf) * 0.0625rem) / calc(var(--bl) * 1px) Chivo, sans-serif;
	letter-spacing: normal;
	text-decoration: none;
	text-transform: none;
	white-space: nowrap;
	transition: background-color .2s, color .2s;
}
.tci-sl .tci-sl__btn:hover,
.tci-sl a.tci-sl__btn:hover,
.tci-sl .tci-sl__btn:focus-visible { background: #fff; color: #a11e22; }
.tci-sl[data-lv="n"] .tci-sl__btn { left: calc(var(--s) * 113px); top: auto; bottom: calc(var(--s) * 100px); transform: none; }
.tci-sl[data-lv="t"] .tci-sl__btn { left: 50%; top: auto; bottom: calc(var(--s) * 140px); transform: translateX(-50%); }
.tci-sl[data-lv="m"] .tci-sl__btn { left: 50%; top: auto; bottom: calc(var(--s) * 130px); transform: translateX(-50%); }

/* Freccia «scorri giù» (non scalata) */
.tci-sl .tci-sl__down {
	position: absolute;
	left: 50%;
	bottom: var(--downb);
	box-sizing: border-box;
	width: calc(var(--down) * 1px);
	height: calc(var(--down) * 1px);
	margin: 0 0 0 calc(var(--down) * -0.5px);
	padding: 7px 5px 5px;
	border: 2px solid #fff;
	border-radius: 40px;
	background: #a11e22;
	color: #fff;
	cursor: pointer;
	line-height: 0;
}
.tci-sl .tci-sl__down svg { display: block; width: 100%; height: 100%; fill: currentColor; }

/* Frecce laterali (dal livello n in su) */
.tci-sl .tci-sl__arrow {
	position: absolute;
	z-index: 5;
	top: 50%;
	width: 50px;
	height: 50px;
	margin: -25px 0 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	line-height: 0;
}
.tci-sl .tci-sl__arrow svg { display: block; width: 50px; height: 50px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: butt; stroke-linejoin: miter; }
.tci-sl__arrow--prev { left: 20px; }
.tci-sl__arrow--next { right: 20px; }
.tci-sl[data-lv="t"] .tci-sl__arrow,
.tci-sl[data-lv="m"] .tci-sl__arrow { display: none; }

/* Animazioni dei livelli (solo se il JS è partito) */
.tci-sl.is-anim .tci-sl__ch { opacity: 0; }
.tci-sl.is-anim .is-play .tci-sl__ch { animation: tci-sl-ch 1ms linear both; animation-delay: calc(500ms + var(--n) * 30ms); }
.tci-sl.is-anim .is-play .tci-sl__text { animation: tci-sl-up 2500ms cubic-bezier(.165, .84, .44, 1) 500ms both; }
.tci-sl.is-anim .tci-sl__btn,
.tci-sl.is-anim .tci-sl__down { clip-path: inset(0 100% 0 0); }
.tci-sl.is-anim .is-play .tci-sl__btn { animation: tci-sl-wipe 1500ms cubic-bezier(.77, 0, .175, 1) 1000ms both; }
.tci-sl.is-anim .is-play .tci-sl__down { animation: tci-sl-rise 1000ms cubic-bezier(.165, .84, .44, 1) 1500ms both; }
.tci-sl.is-anim .is-leaving .tci-sl__text,
.tci-sl.is-anim .is-leaving .tci-sl__btn,
.tci-sl.is-anim .is-leaving .tci-sl__down { opacity: 0; transition: opacity .3s linear; }
@keyframes tci-sl-ch { to { opacity: 1; } }
@keyframes tci-sl-up { from { translate: 0 50px; } to { translate: 0 0; } }
@keyframes tci-sl-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes tci-sl-rise { from { clip-path: inset(0 0 0 0); translate: 0 160%; } to { clip-path: inset(0 0 0 0); translate: 0 0; } }

@media (prefers-reduced-motion: reduce) {
	.tci-sl.is-anim .tci-sl__ch,
	.tci-sl.is-anim .is-play .tci-sl__ch { opacity: 1; animation: none; }
	.tci-sl.is-anim .is-play .tci-sl__text,
	.tci-sl.is-anim .is-play .tci-sl__btn,
	.tci-sl.is-anim .is-play .tci-sl__down { animation: none; }
	.tci-sl.is-anim .tci-sl__btn,
	.tci-sl.is-anim .tci-sl__down { clip-path: none; }
}
