.zb-place-gallery,
.zb-place-gallery *,
.zb-place-gallery__lightbox,
.zb-place-gallery__lightbox * {
	box-sizing: border-box;
}

.zb-place-gallery {
	--zb-place-gallery-columns: 3;
	--zb-place-gallery-gap: 12px;
	--zb-place-gallery-radius: 6px;
	--zb-place-gallery-gold: #c3944f;
	width: 100%;
}

.zb-place-gallery__grid {
	display: grid;
	grid-template-columns: repeat(var(--zb-place-gallery-columns), minmax(0, 1fr));
	gap: var(--zb-place-gallery-gap);
}

.zb-place-gallery--layout-mosaic.zb-place-gallery--count-1 .zb-place-gallery__grid {
	grid-template-columns: minmax(0, 1fr);
}

.zb-place-gallery--layout-mosaic.zb-place-gallery--count-2 .zb-place-gallery__grid,
.zb-place-gallery--layout-mosaic.zb-place-gallery--count-3 .zb-place-gallery__grid,
.zb-place-gallery--layout-mosaic.zb-place-gallery--count-5 .zb-place-gallery__grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.zb-place-gallery--layout-mosaic.zb-place-gallery--count-4 .zb-place-gallery__grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.zb-place-gallery__item {
	min-width: 0;
	margin: 0;
	padding: 0;
}

.zb-place-gallery--layout-mosaic.zb-place-gallery--count-3 .zb-place-gallery__item:first-child,
.zb-place-gallery--layout-mosaic.zb-place-gallery--count-4 .zb-place-gallery__item:first-child,
.zb-place-gallery--layout-mosaic.zb-place-gallery--count-5 .zb-place-gallery__item:first-child {
	grid-column: 1 / -1;
}

.zb-place-gallery .zb-place-gallery__trigger {
	position: relative;
	display: block;
	overflow: hidden;
	width: 100%;
	aspect-ratio: 4 / 3;
	margin: 0;
	padding: 0;
	color: inherit;
	background: #edf0eb;
	border: 0;
	border-radius: var(--zb-place-gallery-radius);
	cursor: zoom-in;
	text-decoration: none;
}

.zb-place-gallery--layout-mosaic.zb-place-gallery--count-1 .zb-place-gallery__trigger,
.zb-place-gallery--layout-mosaic.zb-place-gallery--count-3 .zb-place-gallery__item:first-child .zb-place-gallery__trigger,
.zb-place-gallery--layout-mosaic.zb-place-gallery--count-4 .zb-place-gallery__item:first-child .zb-place-gallery__trigger,
.zb-place-gallery--layout-mosaic.zb-place-gallery--count-5 .zb-place-gallery__item:first-child .zb-place-gallery__trigger {
	aspect-ratio: 16 / 9;
}

.zb-place-gallery--layout-mosaic.zb-place-gallery--count-2 .zb-place-gallery__trigger {
	aspect-ratio: 1 / 1;
}

.zb-place-gallery--layout-mosaic.zb-place-gallery--count-5 .zb-place-gallery__item:not(:first-child) .zb-place-gallery__trigger {
	aspect-ratio: 16 / 10;
}

.zb-place-gallery .zb-place-gallery__image {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	transition: transform 180ms ease, filter 180ms ease;
}

.zb-place-gallery .zb-place-gallery__trigger:hover .zb-place-gallery__image {
	filter: brightness(0.94);
	transform: scale(1.025);
}

.zb-place-gallery .zb-place-gallery__trigger:focus-visible {
	outline: 3px solid rgba(195, 148, 79, 0.58);
	outline-offset: 3px;
}

.zb-place-gallery__lightbox[hidden] {
	display: none !important;
}

.zb-place-gallery__lightbox {
	--zb-place-gallery-gold: #c3944f;
	position: fixed;
	z-index: 100000;
	inset: 0;
	display: grid;
	padding: 28px;
	place-items: center;
}

.zb-place-gallery__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(13, 25, 20, 0.94);
	backdrop-filter: blur(3px);
}

.zb-place-gallery__lightbox-panel {
	position: relative;
	z-index: 1;
	display: grid;
	width: min(1180px, 100%);
	height: min(88vh, 880px);
	padding: 0 64px;
	place-items: center;
}

.zb-place-gallery__lightbox-figure {
	display: flex;
	width: 100%;
	height: 100%;
	margin: 0;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.zb-place-gallery__lightbox-image {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: calc(100% - 58px);
	margin: 0;
	object-fit: contain;
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

.zb-place-gallery__caption {
	max-width: 820px;
	margin-top: 14px;
	color: #ffffff;
	font-size: 0.9375rem;
	line-height: 1.45;
	text-align: center;
}

.zb-place-gallery__counter {
	margin-top: 10px;
	color: rgba(255, 255, 255, 0.76);
	font-size: 0.8125rem;
	line-height: 1;
}

.zb-place-gallery__control {
	position: absolute;
	z-index: 2;
	display: block;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	color: #ffffff;
	background: rgba(25, 57, 43, 0.84);
	border: 1px solid rgba(255, 255, 255, 0.76);
	border-radius: 50%;
	box-shadow: 0 3px 14px rgba(0, 0, 0, 0.34);
	cursor: pointer;
	transition: background-color 150ms ease, border-color 150ms ease;
}

.zb-place-gallery__control:hover {
	background: #244737;
	border-color: #ffffff;
}

.zb-place-gallery__control:focus-visible {
	outline: 3px solid var(--zb-place-gallery-gold);
	outline-offset: 3px;
}

.zb-place-gallery__close {
	top: 0;
	right: 0;
}

.zb-place-gallery__close::before,
.zb-place-gallery__close::after {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 2px;
	background: currentColor;
	border-radius: 1px;
	content: "";
}

.zb-place-gallery__close::before {
	transform: translate(-50%, -50%) rotate(45deg);
}

.zb-place-gallery__close::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.zb-place-gallery__previous,
.zb-place-gallery__next {
	top: 50%;
	transform: translateY(-50%);
}

.zb-place-gallery__previous {
	left: 0;
}

.zb-place-gallery__next {
	right: 0;
}

.zb-place-gallery__previous::before,
.zb-place-gallery__next::before {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 12px;
	height: 12px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	content: "";
}

.zb-place-gallery__previous::before {
	transform: translate(-38%, -50%) rotate(-135deg);
}

.zb-place-gallery__next::before {
	transform: translate(-62%, -50%) rotate(45deg);
}

body.zb-place-gallery-lightbox-open {
	overflow: hidden;
}

.zb-place-gallery--notice {
	padding: 14px 16px;
	color: #4c4f4a;
	background: #f6f6f4;
	border-left: 3px solid var(--zb-place-gallery-gold);
}

@media (max-width: 767px) {
	.zb-place-gallery__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}

	.zb-place-gallery--layout-mosaic.zb-place-gallery--count-1 .zb-place-gallery__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.zb-place-gallery--layout-mosaic.zb-place-gallery--count-4 .zb-place-gallery__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.zb-place-gallery--layout-mosaic.zb-place-gallery--count-4 .zb-place-gallery__item:first-child {
		grid-column: auto;
	}

	.zb-place-gallery--layout-mosaic.zb-place-gallery--count-4 .zb-place-gallery__item:first-child .zb-place-gallery__trigger {
		aspect-ratio: 4 / 3;
	}

	.zb-place-gallery__lightbox {
		padding: 16px;
	}

	.zb-place-gallery__lightbox-panel {
		height: 90vh;
		padding: 54px 0 64px;
	}

	.zb-place-gallery__close {
		top: 0;
		right: 0;
	}

	.zb-place-gallery__previous,
	.zb-place-gallery__next {
		top: auto;
		bottom: 0;
		transform: none;
	}

	.zb-place-gallery__previous {
		left: calc(50% - 54px);
	}

	.zb-place-gallery__next {
		right: calc(50% - 54px);
	}

	.zb-place-gallery__lightbox-image {
		max-height: calc(100% - 72px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.zb-place-gallery .zb-place-gallery__image,
	.zb-place-gallery__control {
		transition: none;
	}
}
