/* Lightweight native WordPress gallery used after removing FooGallery. */
.wp-block-gallery.restart-native-gallery {
	display: grid !important;
	gap: 4px !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin: 30px 0;
}

.wp-block-gallery.restart-native-gallery > .wp-block-image {
	aspect-ratio: 1.79 / 1;
	box-sizing: border-box;
	height: auto !important;
	margin: 0 !important;
	overflow: hidden;
	position: relative;
	width: 100% !important;
}

.wp-block-gallery.restart-native-gallery:has(> .wp-block-image:nth-child(5):last-child) > .wp-block-image {
	aspect-ratio: 8 / 5;
}

.wp-block-gallery.restart-native-gallery > .wp-block-image img {
	display: block;
	height: 100% !important;
	object-fit: cover;
	transition: transform 180ms ease;
	width: 100% !important;
}

.wp-block-gallery.restart-native-gallery > .wp-block-image > a {
	display: block;
	height: 100%;
	width: 100%;
}

.wp-block-gallery.restart-native-gallery > .wp-block-image:hover img {
	transform: scale(1.02);
}

.wp-block-gallery.restart-native-gallery .wp-element-caption {
	background: linear-gradient(transparent, rgba(0, 0, 0, .7));
	bottom: 0;
	box-sizing: border-box;
	color: #fff;
	font-size: 13px;
	left: 0;
	margin: 0;
	padding: 24px 12px 10px;
	position: absolute;
	right: 0;
}

.restart-gallery-open {
	overflow: hidden;
}

.restart-gallery-lightbox {
	align-items: center;
	background: rgba(0, 0, 0, .92);
	display: flex;
	inset: 0;
	justify-content: center;
	padding: 48px 70px;
	position: fixed;
	z-index: 100000;
}

.restart-gallery-lightbox[hidden] {
	display: none;
}

.restart-gallery-lightbox figure {
	margin: 0;
	max-height: 100%;
	max-width: 100%;
	text-align: center;
}

.restart-gallery-lightbox img {
	max-height: calc(100vh - 110px);
	max-width: calc(100vw - 140px);
	object-fit: contain;
}

.restart-gallery-lightbox figcaption {
	color: #fff;
	padding-top: 8px;
}

.restart-gallery-lightbox button {
	background: transparent !important;
	border: 0;
	color: #fff !important;
	cursor: pointer;
	font-size: 48px;
	line-height: 1;
	padding: 12px;
	position: fixed;
}

.restart-gallery-close {
	right: 18px;
	top: 12px;
}

.restart-gallery-prev {
	left: 12px;
	top: 50%;
}

.restart-gallery-next {
	right: 12px;
	top: 50%;
}

@media (max-width: 900px) {
	.wp-block-gallery.restart-native-gallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 520px) {
	.wp-block-gallery.restart-native-gallery {
		grid-template-columns: 1fr;
	}

	.wp-block-gallery.restart-native-gallery > .wp-block-image,
	.wp-block-gallery.restart-native-gallery:has(> .wp-block-image:nth-child(5):last-child) > .wp-block-image {
		aspect-ratio: 1.469 / 1;
	}

	.wp-block-gallery.restart-native-gallery:has(> .wp-block-image:nth-child(5):last-child) > .wp-block-image {
		aspect-ratio: 1.57 / 1;
	}

	.restart-gallery-lightbox {
		padding: 48px 42px;
	}

	.restart-gallery-lightbox img {
		max-width: calc(100vw - 84px);
	}
}
