/**
 * Desktop-to-mobile collapse uses max-width because the desktop layout is the source and small screens simplify it. Queries are rem; 782px is the admin-bar exception only.
 *
 * Image Gallery Slider section.
 *
 * Figma node 813:453 — Completed Installs / service gallery.
 * - Heading 48px / Bold / 0.9, left-aligned
 * - Main slides 647×336, radius 12px, ~35px gap, centered with side peeks
 * - Nav buttons 40×40 over peeks
 * - Thumbs ~133×83, radius 12px, 12px gap, centered flex row
 */

.image-gallery-slider {
	--igs-slide-w: 40.4375rem; /* 647px */
	--igs-thumb-w: 8.29375rem; /* ~132.7px */
	--igs-thumb-h: 5.1875rem; /* 83px */
	--igs-gap: 2.1875rem; /* ~35px */
	--igs-thumb-gap: 0.75rem; /* 12px */
	--igs-radius: var(--layout-radius);
	--igs-nav-size: 2.5rem; /* 40px */

	padding-block: var(--section-pad-block);
	overflow: hidden;
	background: var(--color-bg);
}

.image-gallery-slider__inner {
	display: flex;
	flex-direction: column;
	gap: clamp(1.25rem, 2.5vw, 1.875rem); /* ~30px heading → stage */
	width: var(--content-shell);
	margin-inline: auto;
}

.image-gallery-slider__heading {
	margin: 0;
	max-width: calc(39.1875rem * var(--layout-scale, 1)); /* 627px */
	color: var(--color-neutral-950);
	font-family: var(--font-sans);
	font-size: clamp(2rem, 4vw, 3rem); /* 48px */
	font-weight: var(--font-weight-bold);
	line-height: 0.9;
}

.image-gallery-slider__stage {
	position: relative;
	width: 100%;
}

.image-gallery-slider__main {
	width: 100%;
}

.image-gallery-slider__main.is-swipeable {
	touch-action: pan-y pinch-zoom;
	cursor: grab;
}

.image-gallery-slider__main.is-swipeable img {
	-webkit-user-drag: none;
	user-select: none;
}

.image-gallery-slider__main .swiper-wrapper {
	align-items: stretch;
}

.image-gallery-slider__slide {
	width: min(var(--igs-slide-w), 85vw);
	height: auto;
}

.image-gallery-slider__figure {
	margin: 0;
	width: 100%;
	aspect-ratio: 647 / 336;
	border-radius: var(--igs-radius);
	overflow: hidden;
	background: var(--color-surface);
}

.image-gallery-slider__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.image-gallery-slider__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: grid;
	place-items: center;
	width: var(--igs-nav-size);
	height: var(--igs-nav-size);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	transform: translateY(-50%);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.image-gallery-slider__nav img {
	display: block;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.image-gallery-slider__nav--prev {
	left: clamp(0.5rem, 2vw, 1.875rem); /* ~30px */
}

.image-gallery-slider__nav--next {
	right: clamp(0.5rem, 2vw, 1.875rem);
}

.image-gallery-slider__nav--next img {
	transform: rotate(180deg);
}

.image-gallery-slider__nav:hover,
.image-gallery-slider__nav:focus-visible {
	opacity: 0.85;
	outline: none;
}

.image-gallery-slider__nav:focus-visible {
	box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-neutral-950);
}

.image-gallery-slider__nav:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.image-gallery-slider__pagination {
	position: static;
	margin-top: 1rem;
	text-align: center;
}

.image-gallery-slider__pagination .swiper-pagination-bullet {
	background: var(--color-neutral-950);
	opacity: 0.25;
}

.image-gallery-slider__pagination .swiper-pagination-bullet-active {
	opacity: 1;
}

.image-gallery-slider__thumbs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--igs-thumb-gap);
	width: 100%;
	margin-top: clamp(0.75rem, 2vw, 1.5rem);
	padding: 0;
}

.image-gallery-slider__thumb {
	box-sizing: border-box;
	flex: 0 0 auto;
	width: var(--igs-thumb-w);
	height: var(--igs-thumb-h);
	margin: 0;
	padding: 0;
	border: 2px solid transparent;
	border-radius: var(--igs-radius);
	overflow: hidden;
	background: var(--color-surface);
	cursor: pointer;
	opacity: 0.72;
	transition: border-color 0.2s ease, opacity 0.2s ease;
}

.image-gallery-slider__thumb-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

.image-gallery-slider__thumb.is-active,
.image-gallery-slider__thumb:hover,
.image-gallery-slider__thumb:focus-visible {
	border-color: var(--color-neutral-950);
	opacity: 1;
	outline: none;
}

@media (max-width: 39.9375rem) {
	.image-gallery-slider__slide {
		width: min(var(--igs-slide-w), 78vw);
	}

	.image-gallery-slider__nav--prev {
		left: 0.25rem;
	}

	.image-gallery-slider__nav--next {
		right: 0.25rem;
	}

	.image-gallery-slider__thumb {
		width: 5.5rem;
		height: 3.4375rem;
	}
}
