.oto-horizontal-gallery {
	--ohg-height: 600px;
	--ohg-peek: 42px;
	--ohg-gap: 18px;
	--ohg-fit: contain;
	--ohg-controls: #111;
	--ohg-caption: #111;
	--ohg-arrow-size: 34px;
	--ohg-arrow-offset: 0px;
	--ohg-wall-landscape-height: 76%;
	--ohg-wall-portrait-height: 92%;
	--ohg-wall-align: center;
	--ohg-frame-width: 1px;
	--ohg-frame-color: #111;
	--ohg-mat-width: 0px;
	--ohg-mat-color: #f8f6f0;
	position: relative;
	width: 100%;
	height: var(--ohg-height);
	min-height: 220px;
	background: transparent;
	overflow: hidden;
}

.oto-horizontal-gallery__swiper,
.oto-horizontal-gallery__swiper .swiper-wrapper {
	width: 100%;
	height: 100%;
}

.oto-horizontal-gallery__swiper {
	overflow: hidden;
	touch-action: pan-y;
}

.oto-horizontal-gallery__swiper .swiper-wrapper {
	align-items: stretch;
}

.oto-horizontal-gallery__slide {
	display: flex;
	width: calc(100% - var(--ohg-peek) - var(--ohg-peek) - var(--ohg-gap) - var(--ohg-gap)) !important;
	height: 100%;
	overflow: hidden;
	background: transparent;
}

.oto-horizontal-gallery__figure,
.oto-horizontal-gallery__media {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: transparent;
}

.oto-horizontal-gallery__figure {
	position: relative;
}

.oto-horizontal-gallery__image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	object-fit: var(--ohg-fit);
	object-position: center center;
	transition: object-position 360ms ease;
}

/*
 * A portrait remains centred at full gallery height when active. Neighbouring
 * portraits expose the edge nearest the active slide, so neither lateral
 * preview becomes an empty margin.
 */
.oto-horizontal-gallery__slide.swiper-slide-next.is-portrait .oto-horizontal-gallery__image {
	object-position: left center;
}

.oto-horizontal-gallery__slide.swiper-slide-prev.is-portrait .oto-horizontal-gallery__image {
	object-position: right center;
}

.oto-horizontal-gallery__slide.swiper-slide-active .oto-horizontal-gallery__image {
	object-position: center center;
}

.oto-horizontal-gallery__caption {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 12px;
	z-index: 2;
	color: var(--ohg-caption);
	font-size: 12px;
	line-height: 1.4;
	pointer-events: none;
}

.oto-horizontal-gallery__arrow {
	position: absolute;
	top: 50%;
	z-index: 5;
	display: grid;
	place-items: center;
	width: var(--ohg-arrow-size);
	height: var(--ohg-arrow-size);
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--ohg-controls);
	transform: translateY(-50%);
	cursor: pointer;
}

.oto-horizontal-gallery__arrow svg {
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.25;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.oto-horizontal-gallery__arrow--prev {
	left: calc(var(--ohg-peek) + var(--ohg-gap));
	transform: translate(calc(-100% - var(--ohg-arrow-offset)), -50%);
}

.oto-horizontal-gallery__arrow--next {
	right: calc(var(--ohg-peek) + var(--ohg-gap));
	transform: translate(calc(100% + var(--ohg-arrow-offset)), -50%);
}

.oto-horizontal-gallery__arrow.swiper-button-disabled {
	opacity: 0.2;
	cursor: default;
	pointer-events: none;
}

.oto-horizontal-gallery__pagination.swiper-pagination {
	position: absolute;
	left: calc(var(--ohg-peek) + var(--ohg-gap));
	right: calc(var(--ohg-peek) + var(--ohg-gap));
	bottom: 12px;
	z-index: 4;
	width: auto;
	line-height: 1;
}

.oto-horizontal-gallery__pagination .swiper-pagination-bullet {
	width: 6px;
	height: 6px;
	margin: 0 6px;
	background: var(--ohg-controls);
	opacity: 0.28;
}

.oto-horizontal-gallery__pagination .swiper-pagination-bullet-active {
	opacity: 1;
}

/* Continuous wall ------------------------------------------------------- */

.oto-horizontal-gallery--wall {
	overflow: visible;
}

.oto-horizontal-gallery--wall .oto-horizontal-gallery__swiper {
	cursor: grab;
}

.oto-horizontal-gallery--wall .oto-horizontal-gallery__media {
	cursor: inherit;
}

.elementor-widget-oto-horizontal-gallery.is-pointer-dragging .oto-horizontal-gallery--wall .oto-horizontal-gallery__swiper,
.oto-horizontal-gallery--wall .oto-horizontal-gallery__swiper:active {
	cursor: grabbing;
}

.oto-horizontal-gallery--wall .oto-horizontal-gallery__swiper .swiper-wrapper {
	align-items: stretch;
}

.oto-horizontal-gallery--wall .oto-horizontal-gallery__slide {
	display: flex;
	align-items: var(--ohg-wall-align);
	width: auto !important;
	height: 100%;
	margin-right: var(--ohg-gap) !important;
	overflow: visible;
	background: transparent;
}

.oto-horizontal-gallery--wall .oto-horizontal-gallery__slide:last-child {
	margin-right: 0 !important;
}

.oto-horizontal-gallery--wall .oto-horizontal-gallery__figure {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: stretch;
	justify-content: center;
	width: auto;
	height: var(--ohg-wall-landscape-height);
	max-height: 100%;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	overflow: hidden;
	background: transparent;
}

.oto-horizontal-gallery--wall .oto-horizontal-gallery__slide[data-orientation="portrait"] .oto-horizontal-gallery__figure {
	height: var(--ohg-wall-portrait-height);
}

.oto-horizontal-gallery--wall .oto-horizontal-gallery__media {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: auto;
	height: 100%;
	overflow: hidden;
	background: transparent;
}

.oto-horizontal-gallery--wall .oto-horizontal-gallery__image,
.oto-horizontal-gallery--wall .oto-horizontal-gallery__slide.swiper-slide-prev.is-portrait .oto-horizontal-gallery__image,
.oto-horizontal-gallery--wall .oto-horizontal-gallery__slide.swiper-slide-next.is-portrait .oto-horizontal-gallery__image {
	display: block;
	flex: 0 0 auto;
	width: auto;
	height: 100%;
	max-width: none;
	max-height: 100%;
	object-fit: contain;
	object-position: center center;
	transition: none;
	-webkit-user-drag: none;
	user-select: none;
}

.oto-horizontal-gallery--wall.oto-horizontal-gallery--framed .oto-horizontal-gallery__figure {
	padding: var(--ohg-mat-width);
	border: var(--ohg-frame-width) solid var(--ohg-frame-color);
	background: var(--ohg-mat-color);
}

.oto-horizontal-gallery--wall .oto-horizontal-gallery__arrow--prev {
	left: 0;
	transform: translate(calc(0px - var(--ohg-arrow-offset)), -50%);
}

.oto-horizontal-gallery--wall .oto-horizontal-gallery__arrow--next {
	right: 0;
	transform: translate(var(--ohg-arrow-offset), -50%);
}

.oto-horizontal-gallery--wall .oto-horizontal-gallery__pagination {
	display: none;
}

.oto-horizontal-gallery__empty {
	padding: 32px;
	border: 1px dashed #b5b5b5;
	color: #555;
	font-size: 13px;
	text-align: center;
}

@media (max-width: 1024px) {
	.oto-horizontal-gallery {
		--ohg-height: 520px;
		--ohg-peek: 32px;
		--ohg-gap: 14px;
		--ohg-wall-landscape-height: 72%;
		--ohg-wall-portrait-height: 88%;
	}
}

@media (max-width: 767px) {
	.oto-horizontal-gallery {
		--ohg-height: 420px;
		--ohg-peek: 22px;
		--ohg-gap: 10px;
		--ohg-arrow-size: 28px;
		--ohg-wall-landscape-height: 64%;
		--ohg-wall-portrait-height: 82%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.oto-horizontal-gallery__image {
		transition: none;
	}
}
