.cb-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 9999;
	/* The runtime appends the lightbox after the host popup when they share a stacking level. */
	z-index: max(9999, var(--cb-lightbox-popup-z-index, 9999));
}

.cb-lightbox--active {
	display: block;
}

.cb-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.8);
}

.cb-lightbox__content {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 2rem;
	box-sizing: border-box;
}

.cb-lightbox__image {
	max-width: min(90vw, 1200px);
	max-height: 80vh;
	height: auto;
	width: auto;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.cb-lightbox__close {
	align-self: flex-end;
	background: #fff;
	color: #000;
	border: none;
	border-radius: 999px;
	padding: 0.4rem 0.9rem;
	font-size: 0.875rem;
	cursor: pointer;
}

.cb-lightbox__close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Match the grid's font-independent plus, including when KSES leaves an empty SVG wrapper. */
.cb-lightbox-group .jet-engine-gallery-slider__item-wrap.is-lightbox[data-wpb-lightbox="1"]:not(:has(
	> .jet-engine-lightbox-icon:not(.is-svg-icon),
	> .jet-engine-lightbox-icon:is(svg, img),
	> .jet-engine-lightbox-icon :is(svg, img)
))::before {
	display: block;
	content: "+";
	font-family: Arial, sans-serif;
	font-weight: 900;
	box-sizing: border-box;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 4px solid currentColor;
	border-radius: 50%;
	line-height: 32px;
}

/* Grouped navigation (spec 5023); attached only for groups of two or more images. */
.cb-lightbox__nav {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.cb-lightbox__prev,
.cb-lightbox__next {
	background: #fff;
	color: #000;
	border: none;
	border-radius: 999px;
	width: 2.5rem;
	height: 2.5rem;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.cb-lightbox__prev:focus-visible,
.cb-lightbox__next:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/*
 * Previous stays the lower index. The U+2039/U+203A chevrons are bidi-mirrored glyphs,
 * so RTL documents already flip them; never add a transform on top.
 */

/*
 * Grouped dialogs add a navigation row: fit the image to the space left by the Close
 * button, the row, the gaps and the padding, and let short viewports scroll as a fallback.
 */
.cb-lightbox--grouped .cb-lightbox__content {
	justify-content: safe center;
	overflow-y: auto;
}

.cb-lightbox--grouped .cb-lightbox__image {
	max-height: min(80vh, calc(100vh - 11rem));
	max-height: min(80dvh, calc(100dvh - 11rem));
}

.cb-lightbox__position {
	color: #fff;
	font-size: 0.875rem;
	min-width: 4em;
	text-align: center;
}

