/* Pimp My Design V2 — Showcase Hero
 *
 * Livelli: sfondi (0–3) < testi fissi (10) < testi slide liberi (15) < carosello/controlli (20).
 * Le card sono posizionate in CSS a partire da --k (distanza dalla slide attiva,
 * scritta dal JS): 0 = attiva, 1 = prossima, ecc.
 * Gli elementi posizionabili usano --ox / --oy e una regola di ancoraggio
 * scritta da Elementor (top/left/right/bottom/translate).
 */

.pmd-sch {
	--sch-h: 100vh;
	--sch-r: 0px;
	--sch-bg: #0b1418;
	--sch-focus: center center;
	--sch-veil: 1;
	--sch-speed: 1.1s;
	--sch-int: 6s;
	--sch-kb: 1.08;
	--sch-ease: cubic-bezier(.65, .05, .25, 1);
	--sch-out: cubic-bezier(.2, .75, .15, 1);
	/* carosello */
	--sch-vis: 3;
	--sch-aw: 300px;
	--sch-ah: 210px;
	--sch-cw: 150px;
	--sch-ch: 230px;
	--sch-gap: 14px;
	--sch-cr: 22px;
	--sch-cbc: rgba(255, 255, 255, .85);
	--sch-cbw: 3px;
	--sch-dim: .85;
	--sch-cap: 0px;
	--sch-row: row;
	--sch-cgap: 48px;
	--sch-cmax: 400px;
	--sch-ctl-gap: 18px;
	/* paginazione */
	--sch-p: rgba(255, 255, 255, .35);
	--sch-pa: #fff;
	--sch-dot: 8px;
	--sch-dash: 34px;
	--sch-bar: 240px;
	--sch-thick: 2px;
	--sch-arrow: 44px;
	--sch-prog: 0;

	position: relative;
	isolation: isolate;
	box-sizing: border-box;
	height: var(--sch-h);
	min-height: 520px;
	overflow: hidden;
	border-radius: var(--sch-r);
	background: var(--sch-bg);
	color: #fff;
	outline: none;
	touch-action: pan-y;
}

.pmd-sch *,
.pmd-sch *::before,
.pmd-sch *::after {
	box-sizing: border-box;
}

.pmd-sch--caption {
	--sch-cap: 70px;
}

.pmd-sch--dir-start {
	--sch-row: row-reverse;
}

.pmd-sch.is-dragging {
	user-select: none;
	-webkit-user-select: none;
}

/* ---------- Sfondi ---------- */

.pmd-sch__bgs {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.pmd-sch__bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
	overflow: hidden;
	visibility: hidden;
}

.pmd-sch__bg.is-active {
	z-index: 2;
	visibility: visible;
}

.pmd-sch__bg.is-growing,
.pmd-sch__bg.is-fading {
	z-index: 3;
	visibility: visible;
}

.pmd-sch__bg.is-fading {
	animation: pmd-sch-fade var(--sch-speed) ease both;
}

.pmd-sch .pmd-sch__bg-img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: var(--sch-focus);
	border: 0;
	border-radius: 0;
}

.pmd-sch--kb .pmd-sch__bg.is-active:not(.is-growing) .pmd-sch__bg-img {
	animation: pmd-sch-kb calc(var(--sch-int) + var(--sch-speed) * 3) linear both;
}

.pmd-sch__shade {
	position: absolute;
	inset: 0;
	opacity: var(--sch-veil);
	background-image: linear-gradient(180deg, rgba(8, 18, 22, .55) 0%, rgba(8, 18, 22, .25) 45%, rgba(8, 18, 22, .7) 100%);
	pointer-events: none;
}

@keyframes pmd-sch-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes pmd-sch-kb {
	from { scale: 1; }
	to { scale: var(--sch-kb); }
}

/* ---------- Ancoraggi (valori predefiniti; Elementor li sovrascrive) ---------- */

.pmd-sch__static,
.pmd-sch__nav,
.pmd-sch__content--free,
.pmd-sch__controls--free {
	position: absolute;
	--ox: 0px;
	--oy: 0px;
}

.pmd-sch__static {
	--oy: 130px;
	z-index: 10;
	top: var(--oy);
	left: calc(50% + var(--ox));
	translate: -50% 0;
	width: min(760px, calc(100% - 32px));
	text-align: center;
}

.pmd-sch__nav {
	--ox: -40px;
	--oy: 56px;
	z-index: 20;
	bottom: var(--oy);
	left: var(--ox);
	display: flex;
	flex-direction: var(--sch-row);
	align-items: center;
	gap: var(--sch-cgap);
}

.pmd-sch__content--free {
	--ox: 64px;
	z-index: 15;
	top: calc(50% + var(--oy));
	right: var(--ox);
	translate: 0 -50%;
	width: min(var(--sch-cmax), calc(100% - 32px));
}

.pmd-sch__controls--free {
	--ox: 64px;
	--oy: 56px;
	z-index: 20;
	bottom: var(--oy);
	right: var(--ox);
}

/* ---------- Testi fissi ---------- */

.pmd-sch .pmd-sch__static-title {
	margin: 0 0 .45em;
	color: #fff;
	font-family: "Playfair Display", Georgia, serif;
	font-size: clamp(34px, 4.6vw, 68px);
	font-weight: 500;
	line-height: 1.08;
}

.pmd-sch__line {
	display: block;
}

.pmd-sch__line.is-accent {
	font-style: italic;
	font-weight: 400;
}

.pmd-sch .pmd-sch__static-sub {
	display: inline-block;
	max-width: 36em;
	margin: 0;
	color: rgba(255, 255, 255, .85);
	font-size: 16px;
	line-height: 1.55;
}

/* ---------- Carosello ---------- */

.pmd-sch__rail {
	display: flex;
	flex-direction: column;
	gap: var(--sch-ctl-gap);
	flex: 0 0 auto;
}

.pmd-sch__rail--above {
	flex-direction: column-reverse;
}

.pmd-sch__track {
	--sch-th: max(var(--sch-ah), var(--sch-ch));
	position: relative;
	width: calc(var(--sch-aw) + var(--sch-vis) * (var(--sch-cw) + var(--sch-gap)));
	height: calc(var(--sch-th) + var(--sch-cap));
}

.pmd-sch__card {
	--k: 1;
	--w: var(--sch-cw);
	--hh: var(--sch-ch);
	--x: calc((var(--sch-vis) - var(--k)) * (var(--sch-cw) + var(--sch-gap)));
	position: absolute;
	left: 0;
	top: calc(var(--sch-th) - var(--hh));
	width: var(--w);
	height: var(--hh);
	transform: translateX(var(--x));
	transition:
		transform var(--sch-speed) var(--sch-ease),
		width var(--sch-speed) var(--sch-ease),
		height var(--sch-speed) var(--sch-ease),
		top var(--sch-speed) var(--sch-ease),
		opacity calc(var(--sch-speed) * .5) ease;
}

.pmd-sch--valign-center .pmd-sch__card { top: calc((var(--sch-th) - var(--hh)) / 2); }
.pmd-sch--valign-top .pmd-sch__card { top: 0; }

.pmd-sch__card.is-current {
	--w: var(--sch-aw);
	--hh: var(--sch-ah);
	z-index: 2;
}

.pmd-sch--dir-start .pmd-sch__card {
	--x: calc(var(--sch-aw) + var(--sch-gap) + (var(--k) - 1) * (var(--sch-cw) + var(--sch-gap)));
}

.pmd-sch--dir-start .pmd-sch__card.is-current {
	--x: 0px;
}

.pmd-sch__card.is-off {
	opacity: 0;
	pointer-events: none;
}

.pmd-sch__card.is-hide {
	opacity: 0;
	transition: opacity calc(var(--sch-speed) * .3) ease;
}

.pmd-sch__card.no-tr,
.pmd-sch__card.no-tr * {
	transition: none !important;
}

.pmd-sch .pmd-sch__card-media {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: var(--sch-cbw) solid var(--sch-cbc);
	border-radius: var(--sch-cr);
	background: rgba(255, 255, 255, .08);
	cursor: pointer;
	font: inherit;
	color: inherit;
	transition: translate .4s var(--sch-out), box-shadow .4s;
}

.pmd-sch__card.is-current .pmd-sch__card-media {
	cursor: default;
}

.pmd-sch__card:not(.is-current) .pmd-sch__card-media:hover,
.pmd-sch__card:not(.is-current) .pmd-sch__card-media:focus-visible {
	translate: 0 -6px;
}

.pmd-sch .pmd-sch__card-img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	border: 0;
	border-radius: 0;
	filter: brightness(var(--sch-dim));
	transition: filter .4s;
}

.pmd-sch__card.is-current .pmd-sch__card-img,
.pmd-sch__card-media:hover .pmd-sch__card-img {
	filter: none;
}

.pmd-sch__card-info {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 28px 12px 12px;
	background: linear-gradient(transparent, rgba(0, 0, 0, .6));
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
	text-align: left;
	transition: opacity .3s;
}

.pmd-sch__card.is-current .pmd-sch__card-info {
	opacity: 0;
}

/* Didascalia: visibile solo sotto la card attiva */
.pmd-sch__cap {
	position: absolute;
	top: calc(100% + 12px);
	left: 0;
	width: max(100%, var(--sch-aw));
	display: flex;
	flex-direction: column;
	gap: 4px;
	text-align: left;
	opacity: 0;
	translate: 0 8px;
	pointer-events: none;
	transition: opacity .3s ease, translate .3s ease;
}

.pmd-sch__card.is-current .pmd-sch__cap {
	opacity: 1;
	translate: 0 0;
	transition: opacity .5s ease calc(var(--sch-speed) * .8), translate .5s var(--sch-out) calc(var(--sch-speed) * .8);
}

.pmd-sch__cap-title {
	color: #fff;
	font-family: "Playfair Display", Georgia, serif;
	font-size: 20px;
	line-height: 1.2;
}

.pmd-sch__cap-text {
	color: rgba(255, 255, 255, .8);
	font-size: 13px;
	line-height: 1.45;
}

/* ---------- Testi della slide ---------- */

.pmd-sch__content {
	display: grid;
	width: min(var(--sch-cmax), calc(100vw - 32px));
	flex: 0 1 auto;
	text-align: left;
	--sch-cta-j: flex-start;
}

.pmd-sch__slide {
	grid-area: 1 / 1;
	visibility: hidden;
	pointer-events: none;
}

.pmd-sch__slide.is-active {
	visibility: visible;
	pointer-events: auto;
}

.pmd-sch__slide.is-leaving {
	visibility: visible;
	opacity: 0;
	transition: opacity calc(var(--sch-speed) * .35) ease;
}

.pmd-sch .pmd-sch__kicker,
.pmd-sch .pmd-sch__title,
.pmd-sch .pmd-sch__text {
	margin: 0 0 14px;
}

.pmd-sch .pmd-sch__kicker {
	color: #5eead4;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
}

.pmd-sch .pmd-sch__title {
	color: #fff;
	font-family: "Playfair Display", Georgia, serif;
	font-size: clamp(22px, 2.2vw, 32px);
	font-weight: 500;
	line-height: 1.15;
}

.pmd-sch .pmd-sch__text {
	color: rgba(255, 255, 255, .85);
	font-size: 15px;
	line-height: 1.55;
}

.pmd-sch__kicker > span,
.pmd-sch__title > span,
.pmd-sch__text > span {
	display: block;
}

.pmd-sch__cta-wrap {
	display: flex;
	justify-content: var(--sch-cta-j);
	padding-top: 8px;
}

.pmd-sch .pmd-sch__cta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 26px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: #1fae8f;
	color: #fff;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color .3s, color .3s, border-color .3s;
}

.pmd-sch__cta-icon {
	display: inline-flex;
	transition: translate .3s var(--sch-out);
}

.pmd-sch__cta:hover .pmd-sch__cta-icon {
	translate: 4px 0;
}

/* Ingresso dei testi: ogni riga con un piccolo ritardo */
.pmd-sch__slide > * {
	--dl: 0s;
	transition: opacity .7s ease var(--dl), translate .9s var(--sch-out) var(--dl);
}

.pmd-sch__slide > :nth-child(2) { --dl: .08s; }
.pmd-sch__slide > :nth-child(3) { --dl: .16s; }
.pmd-sch__slide > :nth-child(4) { --dl: .24s; }

.pmd-sch--anim-up .pmd-sch__slide:not(.is-active) > *,
.pmd-sch--anim-up .pmd-sch__slide.is-entering > * {
	opacity: 0;
	translate: 0 26px;
}

.pmd-sch--anim-fade .pmd-sch__slide:not(.is-active) > *,
.pmd-sch--anim-fade .pmd-sch__slide.is-entering > * {
	opacity: 0;
}

.pmd-sch--anim-mask .pmd-sch__slide > * {
	overflow: hidden;
	transition: none;
}

.pmd-sch--anim-mask .pmd-sch__slide > * > * {
	transition: translate .9s var(--sch-out) var(--dl), opacity .4s ease var(--dl);
}

.pmd-sch--anim-mask .pmd-sch__slide:not(.is-active) > * > *,
.pmd-sch--anim-mask .pmd-sch__slide.is-entering > * > * {
	translate: 0 110%;
	opacity: 0;
}

.pmd-sch--anim-mask .pmd-sch__cta-wrap {
	padding-bottom: 4px;
}

/* ---------- Controlli ---------- */

.pmd-sch__controls {
	display: flex;
	align-items: center;
	gap: 18px;
}

/* Se il carosello esce dal bordo (distanza negativa), i controlli restano dentro;
   la barra a tutta larghezza invece segue le card fino al bordo */
.pmd-sch:not(.pmd-sch--pag-bar) .pmd-sch__rail .pmd-sch__controls {
	padding-inline: max(0px, calc(var(--ox) * -1));
}

.pmd-sch--pag-bar:not(.pmd-sch--bar-full) .pmd-sch__rail .pmd-sch__controls {
	padding-inline: max(0px, calc(var(--ox) * -1));
}

.pmd-sch__pag {
	display: flex;
	align-items: center;
	gap: 10px;
}

.pmd-sch--bar-full .pmd-sch__rail .pmd-sch__pag--bar {
	flex: 1 1 auto;
}

.pmd-sch .pmd-sch__pag button {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

/* Barra */
.pmd-sch__bar {
	position: relative;
	display: block;
	flex: 1 1 auto;
	width: var(--sch-bar);
	height: var(--sch-thick);
	border-radius: 9px;
	background: var(--sch-p);
}

.pmd-sch--bar-full .pmd-sch__rail .pmd-sch__bar {
	width: auto;
}

.pmd-sch__bar-fill {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: calc(var(--sch-prog) * 100%);
	border-radius: inherit;
	background: var(--sch-pa);
	transition: width var(--sch-speed) var(--sch-ease);
}

.pmd-sch__bar-knob {
	display: none;
	position: absolute;
	right: 0;
	top: 50%;
	width: calc(var(--sch-thick) * 2 + 6px);
	height: calc(var(--sch-thick) * 2 + 6px);
	border-radius: 50%;
	background: var(--sch-pa);
	translate: 50% -50%;
	box-shadow: 0 0 0 4px rgba(255, 255, 255, .15);
}

.pmd-sch--knob .pmd-sch__bar-knob {
	display: block;
}

.pmd-sch__bar-label {
	color: var(--sch-pa);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}

.pmd-sch__bar-label:last-child {
	color: var(--sch-p);
}

/* Pallini */
.pmd-sch .pmd-sch__dot {
	position: relative;
	width: calc(var(--sch-dot) + 8px);
	height: calc(var(--sch-dot) + 8px);
}

.pmd-sch__dot-fill {
	position: absolute;
	inset: 4px;
	border-radius: 50%;
	background: var(--sch-p);
	transition: background-color .3s, scale .3s;
}

.pmd-sch__dot.is-active .pmd-sch__dot-fill {
	background: var(--sch-pa);
	scale: 1.25;
}

/* Stanghette */
.pmd-sch .pmd-sch__dash {
	position: relative;
	width: var(--sch-dash);
	height: calc(var(--sch-thick) + 14px);
}

.pmd-sch__dash::before,
.pmd-sch__dash-fill {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	height: var(--sch-thick);
	border-radius: 9px;
	translate: 0 -50%;
}

.pmd-sch__dash::before {
	right: 0;
	background: var(--sch-p);
}

.pmd-sch__dash-fill {
	width: 0;
	background: var(--sch-pa);
}

.pmd-sch__dash.is-active .pmd-sch__dash-fill {
	width: 100%;
}

.pmd-sch--autoplay.is-running .pmd-sch__dash.is-active .pmd-sch__dash-fill {
	animation: pmd-sch-fill var(--sch-int) linear both;
}

.pmd-sch--autoplay.is-paused .pmd-sch__dash.is-active .pmd-sch__dash-fill {
	animation-play-state: paused;
}

@keyframes pmd-sch-fill {
	from { width: 0; }
	to { width: 100%; }
}

/* Numeri */
.pmd-sch .pmd-sch__num {
	min-width: 2em;
	padding: 4px 2px;
	color: var(--sch-p);
	font-size: 14px;
	font-variant-numeric: tabular-nums;
	transition: color .3s;
	border-bottom: var(--sch-thick) solid transparent;
}

.pmd-sch .pmd-sch__num.is-active {
	color: var(--sch-pa);
	border-bottom-color: var(--sch-pa);
}

.pmd-sch__count {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	color: var(--sch-p);
	font-size: 15px;
	font-variant-numeric: tabular-nums;
}

.pmd-sch__count-cur {
	color: var(--sch-pa);
	font-size: 1.6em;
}

/* Frecce */
.pmd-sch__arrows {
	display: flex;
	gap: 8px;
}

.pmd-sch .pmd-sch__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--sch-arrow);
	height: var(--sch-arrow);
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .45);
	border-radius: 50%;
	background: rgba(255, 255, 255, .06);
	color: #fff;
	font-size: calc(var(--sch-arrow) * .42);
	cursor: pointer;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	transition: background-color .3s, color .3s, border-color .3s;
}

.pmd-sch .pmd-sch__arrow:hover {
	background: #fff;
	color: #111;
}

.pmd-sch-empty {
	padding: 40px;
	border: 1px dashed #c00;
	color: #c00;
	text-align: center;
}

/* ---------- Responsive (breakpoint predefiniti di Elementor) ---------- */

@media (max-width: 1024px) {
	.pmd-sch { --sch-vis: 2; --sch-aw: 260px; --sch-ah: 180px; --sch-cw: 130px; --sch-ch: 200px; }
}

@media (max-width: 767px) {
	.pmd-sch { --sch-vis: 1; --sch-aw: 200px; --sch-ah: 140px; --sch-cw: 100px; --sch-ch: 150px; --sch-cgap: 20px; }
	.pmd-sch__static { --oy: 96px; }
	.pmd-sch__nav { --ox: 16px; --oy: 28px; flex-direction: column-reverse; align-items: flex-start; }
	.pmd-sch__content--free,
	.pmd-sch__controls--free { --ox: 16px; }
}

/* ---------- Riduci movimento ---------- */

@media (prefers-reduced-motion: reduce) {
	.pmd-sch *,
	.pmd-sch *::before {
		animation: none !important;
		transition-duration: .01ms !important;
		transition-delay: 0s !important;
	}
}