.ueg-gallery {
	--ueg-thumb-gap: 12px;
	--ueg-thumbs-visible: 9;
	--ueg-active-border-color: #d8a34c;
	--ueg-arrow-color: #d8a34c;
	--ueg-fade-duration: 600ms;
	--ueg-stage-ratio: 16 / 9;
	--ueg-main-pos-x: 50%;
	--ueg-main-pos-y: 50%;
	position: relative;
	width: 100%;
}

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

.ueg-gallery__stage {
	position: relative;
	width: 100%;
	height: 640px;
	overflow: hidden;
	background: #111;
}

.ueg-gallery--mode-aspect .ueg-gallery__stage {
	height: auto !important;
	aspect-ratio: var(--ueg-stage-ratio);
}

.ueg-gallery__slides {
	position: relative;
	width: 100%;
	height: 100%;
}

.ueg-gallery__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--ueg-fade-duration) ease;
	margin: 0;
}

.ueg-gallery__slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 1;
}

.ueg-gallery__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: var(--ueg-main-pos-x) var(--ueg-main-pos-y);
}

.ueg-gallery__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	border: 0;
	background: transparent;
	color: var(--ueg-arrow-color);
	font-size: clamp(28px, 3vw, 46px);
	line-height: 1;
	cursor: pointer;
	padding: 8px 14px;
	transition: opacity 200ms ease;
}

.ueg-gallery__arrow:hover {
	opacity: 0.8;
}

.ueg-gallery__arrow--prev {
	left: 1.2%;
}

.ueg-gallery__arrow--next {
	right: 1.2%;
}

.ueg-gallery__thumbs {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	z-index: 4;
	padding: 0 clamp(12px, 4vw, 28px) clamp(12px, 2vw, 22px);
	background: linear-gradient(to top, rgba(0, 0, 0, 0.64), rgba(0, 0, 0, 0));
}

.ueg-gallery__thumb-track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--ueg-thumbs-visible) - 1) * var(--ueg-thumb-gap)) / var(--ueg-thumbs-visible));
	gap: var(--ueg-thumb-gap);
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
	scroll-behavior: smooth;
	padding-bottom: 2px;
}

.ueg-gallery__thumb-track::-webkit-scrollbar {
	display: none;
}

.ueg-gallery__thumb {
	position: relative;
	border: 0;
	padding: 0;
	margin: 0;
	background: transparent;
	cursor: pointer;
}

.ueg-gallery__thumb::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -2px;
	height: 2px;
	background: var(--ueg-active-border-color);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 220ms ease;
}

.ueg-gallery__thumb.is-active::after {
	transform: scaleX(1);
}

.ueg-gallery__thumb-image {
	display: block;
	width: 100%;
	aspect-ratio: 89 / 50;
	object-fit: cover;
}

@media (max-width: 1024px) {
	.ueg-gallery--mode-height .ueg-gallery__stage {
		height: 520px;
	}
}

@media (max-width: 767px) {
	.ueg-gallery {
		--ueg-thumbs-visible: 2;
	}

	.ueg-gallery--mode-height .ueg-gallery__stage {
		height: 400px;
	}

	.ueg-gallery__arrow {
		font-size: 28px;
		padding: 6px 10px;
	}

	.ueg-gallery__thumbs {
		padding-left: 12px;
		padding-right: 12px;
	}
}
