.msi-gallery {
	--msi-gallery-ink: #171411;
	--msi-gallery-muted: rgba(23, 20, 17, .62);
	--msi-gallery-line: rgba(23, 20, 17, .12);
	--msi-gallery-paper: #f8f8f6;
	--msi-gallery-shadow: 0 20px 54px rgba(23, 20, 17, .11);
	position: relative;
	max-width: 920px;
	margin: 0 auto;
	color: var(--msi-gallery-ink);
}

.msi-gallery.alignwide {
	max-width: 1180px;
}

.msi-gallery.alignfull {
	max-width: none;
}

.msi-gallery__header {
	margin: 0 0 18px;
}

.msi-gallery__title {
	margin: 0;
	font-size: clamp(1.35rem, 2vw, 2.1rem);
	font-weight: 500;
	line-height: 1.12;
}

.msi-gallery__stage {
	position: relative;
	margin: 0;
	overflow: hidden;
	background:
		linear-gradient(135deg, rgba(255, 255, 255, .82), rgba(235, 228, 220, .52)),
		var(--msi-gallery-paper);
	box-shadow: var(--msi-gallery-shadow);
}

.msi-gallery__viewport {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background: #f2efea;
	cursor: zoom-in;
	touch-action: pan-y;
}

.msi-gallery--square .msi-gallery__viewport {
	aspect-ratio: 1;
}

.msi-gallery--landscape .msi-gallery__viewport {
	aspect-ratio: 16 / 10;
}

.msi-gallery--auto .msi-gallery__viewport {
	aspect-ratio: 16 / 10;
}

.msi-gallery__media,
.msi-gallery__lightbox-media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transform: scale(1.018);
	transition: opacity .34s ease, transform .5s ease;
}

.msi-gallery--auto .msi-gallery__media {
	object-fit: contain;
	background: #f2efea;
}

.msi-gallery--auto .msi-gallery__stage[data-msi-active-orientation="portrait"] .msi-gallery__viewport {
	aspect-ratio: 4 / 5;
}

.msi-gallery--auto .msi-gallery__stage[data-msi-active-orientation="square"] .msi-gallery__viewport {
	aspect-ratio: 1;
}

.msi-gallery--auto .msi-gallery__stage[data-msi-active-orientation="landscape"] .msi-gallery__viewport {
	aspect-ratio: 16 / 10;
}

.msi-gallery--auto .msi-gallery__media--portrait {
	width: auto;
	max-width: 100%;
	height: 100%;
	margin: 0 auto;
}

.msi-gallery--auto .msi-gallery__media--landscape {
	width: 100%;
	height: auto;
	max-height: 100%;
	margin: auto 0;
}

.msi-gallery__media.is-active,
.msi-gallery__lightbox-media.is-active {
	opacity: 1;
	transform: scale(1);
}

.msi-gallery__controls {
	position: absolute;
	left: 18px;
	right: 18px;
	top: 50%;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: space-between;
	pointer-events: none;
	opacity: 0;
	transform: translateY(-50%);
	transition: opacity .22s ease;
}

.msi-gallery__stage:hover .msi-gallery__controls,
.msi-gallery__stage:focus-within .msi-gallery__controls {
	opacity: 1;
}

.msi-gallery__control,
.msi-gallery__lightbox-close,
.msi-gallery__lightbox-nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(18, 16, 14, .42);
	color: #fff;
	font-size: 0;
	line-height: 1;
	cursor: pointer;
	pointer-events: auto;
	backdrop-filter: blur(14px);
	transition: background .2s ease, opacity .2s ease, transform .2s ease;
}

.msi-gallery__control::before,
.msi-gallery__lightbox-nav::before {
	content: "";
	display: block;
	width: 11px;
	height: 11px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
}

.msi-gallery__control[data-msi-prev]::before,
.msi-gallery__lightbox-nav--prev::before {
	transform: translateX(2px) rotate(-135deg);
}

.msi-gallery__control[data-msi-next]::before,
.msi-gallery__lightbox-nav--next::before {
	transform: translateX(-2px) rotate(45deg);
}

.msi-gallery__lightbox-close {
	font-size: 26px;
}

.msi-gallery__control:hover,
.msi-gallery__lightbox-close:hover,
.msi-gallery__lightbox-nav:hover {
	background: rgba(18, 16, 14, .68);
	transform: scale(1.04);
}

.msi-gallery__lightbox-nav:hover {
	transform: translateY(-50%) scale(1.04);
}

.msi-gallery__control:focus-visible,
.msi-gallery__viewport:focus-visible,
.msi-gallery__lightbox-close:focus-visible,
.msi-gallery__lightbox-nav:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.msi-gallery__caption {
	margin: 0;
	padding: 12px 18px;
	border-top: 1px solid var(--msi-gallery-line);
	background: var(--msi-gallery-paper);
	color: var(--msi-gallery-muted);
	font-size: 14px;
	line-height: 1.45;
}

.msi-gallery__dots {
	display: flex;
	gap: 10px;
	margin: 16px 0 0;
}

.msi-gallery__dot {
	display: block;
	flex: 1;
	height: 2px;
	background: rgba(23, 20, 17, .16);
}

.msi-gallery__dot.is-active {
	background: var(--msi-gallery-ink);
}

.msi-gallery__lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 42px;
	background: rgba(12, 10, 8, .94);
	color: #fff;
	touch-action: pan-y;
	cursor: grab;
}

.msi-gallery__lightbox.is-open {
	display: flex;
}

.msi-gallery__lightbox.is-dragging {
	cursor: grabbing;
}

.msi-gallery-lightbox-open {
	overflow: hidden;
}

.msi-gallery__lightbox-frame {
	position: relative;
	width: min(1180px, 100%);
	height: min(780px, calc(100vh - 120px));
}

.msi-gallery__lightbox-media {
	object-fit: contain;
	pointer-events: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-user-drag: none;
}

.msi-gallery__lightbox-media.msi-gallery__media--video {
	pointer-events: auto;
}

.msi-gallery__lightbox-close {
	position: absolute;
	top: 18px;
	right: 18px;
	z-index: 3;
	background: rgba(251, 248, 242, .94);
	color: #171411;
}

.msi-gallery__lightbox-nav {
	position: absolute;
	top: 50%;
	z-index: 3;
	background: rgba(251, 248, 242, .22);
	color: #fff;
	transform: translateY(-50%);
}

.msi-gallery__lightbox-nav--prev {
	left: 18px;
}

.msi-gallery__lightbox-nav--next {
	right: 18px;
}

.msi-gallery__lightbox-caption {
	position: absolute;
	left: 42px;
	right: 42px;
	bottom: 16px;
	margin: 0;
	text-align: center;
	font-size: 14px;
	color: rgba(255, 255, 255, .78);
}

@media (max-width: 640px) {
	.msi-gallery__controls {
		left: 12px;
		right: 12px;
	}

	.msi-gallery__lightbox {
		padding: 18px;
	}

	.msi-gallery__lightbox-frame {
		height: calc(100vh - 96px);
	}

	.msi-gallery__lightbox-nav--prev {
		left: 8px;
	}

	.msi-gallery__lightbox-nav--next {
		right: 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.msi-gallery__media,
	.msi-gallery__lightbox-media,
	.msi-gallery__control,
	.msi-gallery__lightbox-close,
	.msi-gallery__lightbox-nav {
		transition: none;
	}

	.msi-gallery__media,
	.msi-gallery__lightbox-media {
		transform: none;
	}
}
