/* ==========================================================================
   Aliquid Widgets — Subpages Carousel
   Tutte le misure sono custom properties: i controlli Elementor le sovrascrivono.
   ========================================================================== */

.aqw-sp {
	--aqw-sp-cols: 3;
	--aqw-sp-gap: 12px;
	--aqw-sp-peek: 0px;
	--aqw-sp-ratio: 1.45;
	--aqw-sp-zoom: 1.05;
	--aqw-sp-img-r: 0px;
	--aqw-sp-img-bg: #ececec;

	--aqw-sp-line-color: #d4d7da;
	--aqw-sp-line-w: 1px;
	--aqw-sp-eyebrow-pad: 18px;
	--aqw-sp-heading-top: 28px;
	--aqw-sp-header-gap: clamp(32px, 4vw, 46px);

	--aqw-sp-arrow-w: 78px;
	--aqw-sp-arrow-h: 62px;
	--aqw-sp-arrow-icon: 16px;
	--aqw-sp-arrow-gap: 8px;
	--aqw-sp-arrow-bw: 1px;
	--aqw-sp-arrow-r: 3px;
	--aqw-sp-arrow-color: currentColor;
	--aqw-sp-arrow-bg: transparent;
	--aqw-sp-arrow-border: currentColor;
	--aqw-sp-arrow-color-h: #fff;
	--aqw-sp-arrow-bg-h: currentColor;
	--aqw-sp-arrow-border-h: currentColor;
	--aqw-sp-arrow-off: 0.35;
	--aqw-sp-nav-top: flex;
	--aqw-sp-nav-bottom: none;
	--aqw-sp-nav-bottom-gap: 28px;

	--aqw-sp-title-top: 26px;
	--aqw-sp-meta-top: 8px;

	position: relative;
	box-sizing: border-box;
}

.aqw-sp *,
.aqw-sp *::before,
.aqw-sp *::after {
	box-sizing: border-box;
}

/* --- Intestazione -------------------------------------------------------- */

.aqw-sp__header {
	margin-bottom: var(--aqw-sp-header-gap);
}

.aqw-sp__eyebrow {
	padding-bottom: var(--aqw-sp-eyebrow-pad);
	border-bottom: var(--aqw-sp-line-w) solid var(--aqw-sp-line-color);
	font-size: 13px;
	line-height: 1.3;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.aqw-sp--no-line .aqw-sp__eyebrow {
	border-bottom: 0;
}

.aqw-sp__eyebrow--empty {
	padding-bottom: 0;
}

.aqw-sp__head-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	padding-top: var(--aqw-sp-heading-top);
}

.aqw-sp__heading {
	margin: 0;
	font-size: clamp(28px, 3vw, 42px);
	font-weight: 400;
	line-height: 1.15;
	text-wrap: balance;
}

/* --- Frecce -------------------------------------------------------------- */

.aqw-sp__nav {
	display: flex;
	gap: var(--aqw-sp-arrow-gap);
	flex-shrink: 0;
}

.aqw-sp__nav--top {
	display: var(--aqw-sp-nav-top);
	margin-left: auto;
}

.aqw-sp__nav--bottom {
	display: var(--aqw-sp-nav-bottom);
	margin-top: var(--aqw-sp-nav-bottom-gap);
	justify-content: flex-end;
}

.aqw-sp__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--aqw-sp-arrow-w);
	height: var(--aqw-sp-arrow-h);
	padding: 0;
	margin: 0;
	border: var(--aqw-sp-arrow-bw) solid var(--aqw-sp-arrow-border);
	border-radius: var(--aqw-sp-arrow-r);
	background: var(--aqw-sp-arrow-bg);
	color: var(--aqw-sp-arrow-color);
	font-size: var(--aqw-sp-arrow-icon);
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}

.aqw-sp__arrow svg {
	width: var(--aqw-sp-arrow-icon);
	height: var(--aqw-sp-arrow-icon);
	fill: currentColor;
}

.aqw-sp__arrow svg path[fill="none"] {
	fill: none;
}

.aqw-sp__arrow i {
	font-size: var(--aqw-sp-arrow-icon);
}

/* Colori hover: se non impostati usa l'inversione del colore del testo */
.aqw-sp__arrow:hover:not(:disabled),
.aqw-sp__arrow:focus-visible {
	background: var(--aqw-sp-arrow-bg-h);
	border-color: var(--aqw-sp-arrow-border-h);
	color: var(--aqw-sp-arrow-color-h);
	outline: none;
}

.aqw-sp__arrow:hover:not(:disabled) svg,
.aqw-sp__arrow:focus-visible svg {
	color: var(--aqw-sp-arrow-color-h);
}

.aqw-sp__arrow:disabled {
	opacity: var(--aqw-sp-arrow-off);
	cursor: default;
}

/* Poche card: frecce nascoste (classe impostata dal JS) */
.aqw-sp--static .aqw-sp__nav {
	display: none !important;
}

/* --- Track --------------------------------------------------------------- */

.aqw-sp__viewport {
	position: relative;
	overflow: hidden;
}

.aqw-sp__track {
	display: flex;
	gap: var(--aqw-sp-gap);
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: auto;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.aqw-sp__track::-webkit-scrollbar {
	display: none;
}

.aqw-sp.is-dragging .aqw-sp__track,
.aqw-sp.is-animating .aqw-sp__track {
	scroll-snap-type: none;
	scroll-behavior: auto;
}

.aqw-sp.is-dragging .aqw-sp__track {
	cursor: grabbing;
	user-select: none;
}

.aqw-sp__slide {
	flex: 0 0 calc((100% - var(--aqw-sp-peek) - (var(--aqw-sp-cols) - 1) * var(--aqw-sp-gap)) / var(--aqw-sp-cols));
	min-width: 0;
	margin: 0;
	padding: 0;
	scroll-snap-align: start;
}

.aqw-sp__slide::before,
.aqw-sp__slide::marker {
	content: none;
}

/* --- Card ---------------------------------------------------------------- */

.aqw-sp__card {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
	-webkit-user-drag: none;
}

.aqw-sp__card:hover,
.aqw-sp__card:focus {
	color: inherit;
	text-decoration: none;
}

.aqw-sp__card:focus-visible {
	outline: 1px solid currentColor;
	outline-offset: 4px;
}

.aqw-sp__media {
	position: relative;
	aspect-ratio: var(--aqw-sp-ratio);
	overflow: hidden;
	border-radius: var(--aqw-sp-img-r);
	background: var(--aqw-sp-img-bg);
}

.aqw-sp__img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	object-fit: cover;
	object-position: center;
	transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
	pointer-events: none;
}

.aqw-sp--zoom .aqw-sp__card:hover .aqw-sp__img {
	transform: scale(var(--aqw-sp-zoom));
}

.aqw-sp__title {
	margin: var(--aqw-sp-title-top) 0 0;
	font-size: clamp(19px, 1.6vw, 24px);
	font-weight: 400;
	line-height: 1.25;
	transition: color 0.25s ease;
}

.aqw-sp__meta {
	margin-top: var(--aqw-sp-meta-top);
	font-size: 13px;
	line-height: 1.3;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.aqw-sp__notice {
	padding: 24px;
	border: 1px dashed currentColor;
	font-size: 14px;
	line-height: 1.5;
	opacity: 0.7;
}

/* --- Mobile: frecce più compatte se non personalizzate ------------------- */

@media (max-width: 767px) {
	.aqw-sp {
		--aqw-sp-arrow-w: 56px;
		--aqw-sp-arrow-h: 46px;
	}
	.aqw-sp__head-row {
		align-items: flex-end;
	}
}

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