.my-gallery-field-grid {
	display: grid;
	grid-template-columns: repeat(var(--my-gallery-columns, 3), minmax(0, 1fr));
	gap: var(--my-gallery-gap, 12px);
	padding: 0;
	margin: 0;
	list-style: none;
}

.my-gallery-field-grid-item {
	margin: 0;
}

.my-gallery-field-open {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: var(--my-gallery-radius, 0);
	overflow: hidden;
	background: transparent;
	cursor: zoom-in;
}

.my-gallery-field-grid-image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--my-gallery-radius, 0);
}

.my-gallery-field-lightbox {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgb(0 0 0 / 82%);
	z-index: 9999;
	cursor: zoom-out;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 180ms ease, visibility 0s linear 180ms;
}

.my-gallery-field-lightbox.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition: opacity 180ms ease;
}

.my-gallery-field-lightbox-image {
	max-width: min(1200px, 95vw);
	max-height: 92vh;
	width: auto;
	height: auto;
	border-radius: var(--my-gallery-radius, 0);
	box-shadow: 0 8px 30px rgb(0 0 0 / 40%);
	transform: scale(0.995);
	transition: transform 180ms ease;
}

.my-gallery-field-lightbox.is-open .my-gallery-field-lightbox-image {
	transform: scale(1);
}

.my-gallery-field-lightbox-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 50%;
	background: rgb(0 0 0 / 65%);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

@media (width <= 767px) {
	.my-gallery-field-grid {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.my-gallery-field-lightbox,
	.my-gallery-field-lightbox-image {
		transition: none;
	}
}
