.gallery {
	background-color: #2a2a2a;
}

.gallery-grid {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.gallery_item {
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	position: relative;
	isolation: isolate;
	overflow: visible;
}

.gallery_item::before {
	content: "";
	position: absolute;
	inset: -7px;
	z-index: -1;
	border-radius: var(--radius-md);
	background: linear-gradient(135deg, var(--primary-hover) 25%, var(--secondary) 100%);
	filter: blur(2px);
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

.gallery_item img {
	width: 100%;
	aspect-ratio: 1 / 1;
	/* square thumbnails */
	object-fit: cover;
	/* crop nicely */
	border-radius: var(--radius-md);
	display: block;
	position: relative;
	transition: box-shadow 160ms ease, transform 160ms ease, filter 160ms ease;
}

@media (hover: hover) and (pointer: fine) {

	.gallery_item:hover::before {
		opacity: .85;
	}

	.gallery_item:hover img {
		transform: scale(1.01);
		filter: brightness(1.04);
		box-shadow:
			0 14px 35px rgba(0, 0, 0, 0.25);
	}
}

@media (max-width: 767px) {

	/* Gallery Mobile */
	.gallery-grid {
		display: flex;
		flex-wrap: nowrap;
		gap: 12px;
		overflow-x: auto;
		overflow-y: hidden;
		padding: 0 0 12px;
		scroll-snap-type: x mandatory;
	}

	.gallery-grid .gallery_item {
		flex: 0 0 90%;
		min-width: 0;
		scroll-snap-align: start;
	}

	.gallery-grid .gallery_item img {
		height: auto;
	}
}

/* Modal */
.internalImage {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	padding: 24px;
}

.internalImage.is-open {
	display: flex;
}

.internalImage_body {
	max-width: 1100px;
	width: 100%;
}

#internalImage_img {
	width: 100%;
	height: auto;
	max-height: 80vh;
	object-fit: contain;
	display: block;
	border-radius: 12px;
}

.internalImage_close {
	position: fixed;
	top: 64px;
	right: 64px;
	z-index: 10000;
	background: rgba(0, 0, 0, 0.4);
	color: white;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 10px;
	padding: 10px 12px;
	cursor: pointer;
	font-weight: bold;
}

.internalImage_nav {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10000;
	font-weight: bold;

	width: 44px;
	height: 44px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	background: rgba(0, 0, 0, 0.35);
	color: #fff;
	cursor: pointer;

	display: flex;
	align-items: center;
	justify-content: center;

	transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.internalImage_prev {
	left: 16px;
}

.internalImage_next {
	right: 16px;
}

.internalImage_nav:hover {
	background-color: rgba(0, 0, 0, 0.55);
	border-color: rgba(221, 233, 50, 0.8);
}

.internalImage_caption {
	margin-top: 10px;
	color: rgba(255, 255, 255, 0.92);
	text-align: center;
	font-family: inherit;
	line-height: 1.4;
	padding: 0 12px;
}