/* Construction gallery: CSS scroll-snap, square corners, theme button colours. */
.core-gallery {
	--core-gallery-accent: var(--theme-button-background-initial-color, #ffbb01);
	width: 100%;
	max-width: 100%;
	margin-bottom: 1.75rem;
}

.core-gallery__stage {
	position: relative;
}

.core-gallery__track {
	position: relative;
	display: flex;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	list-style: none;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
}

.core-gallery__track::-webkit-scrollbar {
	display: none;
}

.core-gallery__track:focus-visible {
	outline: 2px solid var(--core-gallery-accent);
	outline-offset: 2px;
}

.core-gallery__slide {
	flex: 0 0 100%;
	margin: 0;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.core-gallery__image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 0;
}

.core-gallery__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: grid;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	place-items: center;
	border: 0;
	border-radius: 0;
	color: #000;
	background: var(--core-gallery-accent);
	cursor: pointer;
	transform: translateY(-50%);
	transition: background-color 0.15s ease, color 0.15s ease;
}

.core-gallery__nav.is-prev {
	left: 0;
}

.core-gallery__nav.is-next {
	right: 0;
}

.core-gallery__nav.is-prev svg {
	transform: scaleX(-1);
}

.core-gallery__nav:hover,
.core-gallery__nav:focus-visible {
	color: #fff;
	background: #000;
}

.core-gallery__nav[disabled] {
	opacity: 0.35;
	cursor: default;
}

.core-gallery__count {
	position: absolute;
	right: 0;
	bottom: 0;
	padding: 4px 12px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.6;
	color: #fff;
	background: rgb(0 0 0 / 65%);
}

.core-gallery__thumbs {
	display: flex;
	gap: 8px;
	margin-top: 8px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: thin;
}

.core-gallery__thumb {
	flex: 0 0 calc((100% - 32px) / 5);
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	outline: 2px solid transparent;
	outline-offset: -2px;
	background: transparent;
	opacity: 0.5;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.core-gallery__thumb:hover {
	opacity: 0.85;
}

.core-gallery__thumb[aria-current="true"] {
	outline-color: var(--core-gallery-accent);
	opacity: 1;
}

.core-gallery__thumb:focus-visible {
	outline-color: #000;
	opacity: 1;
}

.core-gallery__thumb-image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 0;
}

@media (max-width: 689.98px) {
	.core-gallery__thumb {
		flex-basis: calc((100% - 16px) / 3);
	}

	.core-gallery__nav {
		width: 38px;
		height: 38px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.core-gallery__track,
	.core-gallery__thumbs {
		scroll-behavior: auto;
	}

	.core-gallery__nav,
	.core-gallery__thumb {
		transition: none;
	}
}
