.exhibition-gallery {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	background: var(--exhibition-background, #fff);
	color: var(--exhibition-text, #000);
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	transition:
		opacity 300ms ease,
		visibility 300ms ease;
}

.exhibition-gallery.is-open {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
}

.exhibition-gallery__header {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.5rem;
	font-size: 24px;
	p {
		margin: 0;
	}
	margin-bottom: 3rem;
}
.admin-bar .exhibition-gallery__header {
	margin-top: 32px;
}

.exhibition-gallery__title {
	margin: 0;
}

.exhibition-gallery__close {
	position: fixed;
	top: 1.8rem;
	right: 2rem;
	z-index: 100;
	cursor: pointer;
	background: transparent;
	border: none;
	background-color: var(--exhibition-text);
	color: var(--exhibition-background);
	font-size: 25px;
	padding: 7px 14px 10px 14px;
	line-height: 1;
	transition: opacity 200ms ease, transform 200ms ease;
}
.exhibition-gallery__close.is-hidden {
	opacity: 0;
	pointer-events: none;
	transform: translateY(-10px);
}
.admin-bar .exhibition-gallery__close {
	top: 3.5rem;
}
@media (max-width: 768px) {
	.exhibition-gallery__header {
		margin-top: 40px;	
	}
	.exhibition-gallery__close {
		top: 0.8rem;
		right: 1.2rem;
		opacity: 1 !important;
		transform: none !important;
		pointer-events: auto !important;
	}
}


.exhibition-gallery__close-bottom {
	display: block;
	margin: 4rem auto 2rem;
	padding: 12px 20px;
	border: 0;
	background: var(--exhibition-text);
	color: var(--exhibition-background);
	font: inherit;
	cursor: pointer;
}

.exhibition-vertical {
	figure {
		margin: 0 0 6rem 0;
		padding: 0 1.5rem;
	}
	img {
		max-height: 90vh;
		width: auto;
		height: auto;
		display: block;
		margin: 0 0 1rem 0;
	}
}
.exhibition-vertical-centered {
	img {
		margin-left: auto;
		margin-right: auto;
	}
	text-align: center;
}
.exhibition-vertical-staggered {
	figure {
		width: 80%;
	}
	figure:nth-child(odd) {
		margin-left: 0;
		margin-right: auto;
		img {
			margin-left: 0;
			margin-right: auto;
		}
	}
	figure:nth-child(even) {
		text-align: right;
		margin-left: auto;
		margin-right: 0;
		img {
			margin-left: auto;
			margin-right: 0;
		}
	}
}
.exhibition-vertical-left {
	img {
		margin-left: 0;
		margin-right: auto;
	}
	figure {
		
	}
}

.exhibition-vertical-pairs {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5em;
	padding: 0 1.5rem 1.5rem 1.5em;
	text-align: center;
	figure {
		margin: 0;
		padding: 0;
	}
	img {
		display: block;
		margin-left: auto;
		margin-right: auto;
	}
}
.exhibition-horizontal {
	position: relative;
	width: 100%;
	overflow: visible;
	padding: 0 1.5em 1.5em;
	box-sizing: border-box;
}

.exhibition-horizontal__track {
	display: flex;
	overflow-x: auto;
	overflow-y: clip;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
}

.exhibition-horizontal__track::-webkit-scrollbar {
	display: none;
}

.exhibition-horizontal figure {
	flex: 0 0 100%;
	margin: 0;
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.exhibition-horizontal img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 70vh;
	object-fit: contain;
}

.exhibition-horizontal figcaption {
	margin-top: 1rem;
	max-width: 60rem;
}
.exhibition-horizontal.is-prev {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M30 10L16 24L30 38' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") 24 24, w-resize;
}
.exhibition-horizontal.is-next {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M18 10L32 24L18 38' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") 24 24, e-resize;
}

.exhibition-thumbnails {
	padding: 1.5em;
	box-sizing: border-box;
}
.exhibition-thumbnails__grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 1em;
}
.exhibition-thumbnails__item {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}
.exhibition-thumbnails__item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}
.exhibition-thumbnails__viewer {
	position: fixed;
	inset: 0;
	z-index: 2000;
	padding: 2em;
	box-sizing: border-box;
	background: var(--exhibition-background, #fff);
	overflow-y: auto;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}
.exhibition-thumbnails__viewer.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M14 14L34 34M34 14L14 34' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") 24 24, pointer;
}
.exhibition-thumbnails__viewer-inner {
	width: 100%;
	min-height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.exhibition-thumbnails__viewer figure {
	margin: 0;
}

.exhibition-thumbnails__viewer img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 85vh;
	object-fit: contain;
}
.exhibition-thumbnails__viewer figcaption {
	margin-top: 1em;
	max-width: 50em;
}
@media (max-width: 768px) {
	.exhibition-thumbnails__grid {
		grid-template-columns: repeat(3, 1fr);
	}
}


/* Exhibition videos */

.exhibition-gallery-video {
	width: 100%;
	box-sizing: border-box;
}

.exhibition-gallery-video__embed {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
}

.exhibition-gallery-video__embed iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}


/* Vertical layouts */

.exhibition-vertical .exhibition-gallery-video {
	max-width: 1200px;
	margin: 0 auto 6rem;
	padding: 0 1.5rem;
}


/* Vertical staggered */

.exhibition-vertical-staggered .exhibition-gallery-video {
	width: 80%;
}

.exhibition-vertical-staggered .exhibition-gallery-video:nth-child(even) {
	margin-left: auto;
	margin-right: 0;
}

.exhibition-vertical-staggered .exhibition-gallery-video:nth-child(odd) {
	margin-left: 0;
	margin-right: auto;
}


/* Vertical pairs */

.exhibition-vertical-pairs .exhibition-gallery-video {
	width: 100%;
}


/* Horizontal */

.exhibition-horizontal .exhibition-gallery-video {
	flex: 0 0 100%;
}

.exhibition-horizontal .exhibition-gallery-video__embed {
	max-height: 70vh;
}


/* Thumbnails */

.exhibition-thumbnails__video {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
}

.exhibition-thumbnails__video .exhibition-gallery-video__embed {
	width: 100%;
	aspect-ratio: 16 / 9;
}
