/* ==========================================================================
   Gallery Slide – stili frontend
   ========================================================================== */

.gs-gallery {
	--gs-gap: 16px;
	--gs-radius: 4px;
	--gs-arrow-bg: #ffffff;
	--gs-arrow-color: #1a1a1a;
	--gs-counter-color: #1a1a1a;
	--gs-overlay-bg: rgba(255, 255, 255, 0.55);
	--gs-overlay-color: #1a1a1a;
	--gs-link-color: #2b5fb3;

	position: relative;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.gs-gallery * {
	box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Reset "difensivo": molti temi ed Elementor applicano stili globali a
   button, img, a, ul/li (border-radius, ombre, colori di accento, ecc.).
   Questo blocco neutralizza quegli stili SOLO dentro alla galleria, cosi il
   carosello ha sempre lo stesso aspetto indipendentemente dal tema attivo.
   -------------------------------------------------------------------------- */
.gs-gallery button {
	all: unset;
	box-sizing: border-box;
	cursor: pointer;
}

.gs-gallery img {
	max-width: none;
	border-radius: 0;
	box-shadow: none;
	margin: 0;
}

.gs-gallery ul,
.gs-gallery li {
	list-style: none;
	margin: 0;
	padding: 0;
}

.gs-gallery-viewport {
	width: 100% !important;
	overflow-x: auto !important;
	overflow-y: hidden !important;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x mandatory;
	scrollbar-width: none; /* Firefox */
	cursor: grab;
}

.gs-gallery-viewport.gs-gallery-dragging {
	cursor: grabbing;
	scroll-snap-type: none;
	user-select: none;
}

.gs-gallery-viewport::-webkit-scrollbar {
	display: none; /* Chrome / Safari */
}

.gs-gallery-track {
	display: flex !important;
	flex-wrap: nowrap !important;
	align-items: stretch;
	gap: var(--gs-gap);
	padding: 4px 4px 12px 4px;
}

.gs-gallery-slide {
	position: relative;
	flex: 0 0 auto !important;
	scroll-snap-align: start;
	border-radius: var(--gs-radius);
	overflow: hidden;
	background: #eee;
	height: 360px;
	transform: scale(0.93);
	opacity: 0.5;
	transition: transform 0.35s ease, opacity 0.35s ease;
	transform-origin: center;
}

.gs-gallery-slide.gs-active {
	transform: scale(1);
	opacity: 1;
}

.gs-gallery-img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
}

/* Su schermi piccoli, dove e visibile una slide alla volta, l'effetto di
   rimpicciolimento/opacita non serve: tutte le slide restano a piena
   dimensione e opacita non appena entrano nello schermo. */
@media (max-width: 600px) {
	.gs-gallery-slide {
		transform: none;
		opacity: 1;
	}
}

/* Larghezze variabili delle slide (desktop) */
.gs-gallery-slide.gs-size-small {
	width: 22vw;
	min-width: 200px;
	max-width: 320px;
}

.gs-gallery-slide.gs-size-medium {
	width: 38vw;
	min-width: 320px;
	max-width: 620px;
}

.gs-gallery-slide.gs-size-large {
	width: 50vw;
	min-width: 420px;
	max-width: 820px;
}

/* Overlay con link tipo "chi siamo / servizi" */
.gs-gallery-overlay {
	position: absolute;
	top: 0;
	left: 0;
	padding: 28px 28px 0;
	background: linear-gradient(135deg, var(--gs-overlay-bg) 0%, rgba(255, 255, 255, 0) 55%);
	width: 70%;
	height: 45%;
	pointer-events: none;
}

.gs-gallery-overlay-nav {
	display: flex;
	flex-direction: column;
	gap: 14px;
	pointer-events: auto;
}

.gs-gallery-overlay-nav a {
	color: var(--gs-link-color);
	text-decoration: underline;
	font-size: 16px;
	font-weight: 500;
	width: fit-content;
}

.gs-gallery-overlay-nav a:hover,
.gs-gallery-overlay-nav a:focus {
	opacity: 0.75;
}

/* Controlli: contatore + frecce */
.gs-gallery-controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 6px;
}

.gs-gallery-counter {
	font-size: 14px;
	color: var(--gs-counter-color);
	letter-spacing: 0.02em;
}

.gs-gallery-arrows {
	display: flex;
	gap: 10px;
}

.gs-gallery .gs-gallery-prev,
.gs-gallery .gs-gallery-next {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 40px !important;
	height: 40px !important;
	border-radius: 50% !important;
	border: 1px solid rgba(0, 0, 0, 0.15) !important;
	background: var(--gs-arrow-bg) !important;
	color: var(--gs-arrow-color) !important;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}

.gs-gallery .gs-gallery-prev svg,
.gs-gallery .gs-gallery-next svg {
	display: block !important;
	width: 22px !important;
	height: 22px !important;
	stroke: currentColor !important;
}

.gs-gallery .gs-gallery-prev:hover,
.gs-gallery .gs-gallery-next:hover {
	background: #f2f2f2 !important;
	transform: translateY(-1px);
}

.gs-gallery .gs-gallery-prev:disabled,
.gs-gallery .gs-gallery-next:disabled {
	opacity: 0.35;
	cursor: default;
	transform: none;
}

/* ==========================================================================
   Tablet
   ========================================================================== */
@media (max-width: 1024px) {
	.gs-gallery-slide {
		height: 320px;
	}

	.gs-gallery-slide.gs-size-small,
	.gs-gallery-slide.gs-size-medium,
	.gs-gallery-slide.gs-size-large {
		width: 78vw;
		min-width: 0;
		max-width: 560px;
	}

	.gs-gallery-overlay {
		width: 85%;
	}
}

/* ==========================================================================
   Smartphone
   ========================================================================== */
@media (max-width: 600px) {
	.gs-gallery {
		--gs-gap: 10px;
	}

	.gs-gallery-slide {
		height: 260px;
	}

	.gs-gallery-slide.gs-size-small,
	.gs-gallery-slide.gs-size-medium,
	.gs-gallery-slide.gs-size-large {
		width: 88vw;
		min-width: 0;
		max-width: none;
	}

	.gs-gallery-overlay {
		width: 92%;
		padding: 18px 18px 0;
	}

	.gs-gallery-overlay-nav a {
		font-size: 14px;
	}

	.gs-gallery .gs-gallery-prev,
	.gs-gallery .gs-gallery-next {
		width: 36px !important;
		height: 36px !important;
	}
}
