/* =========================================
   CUSTOM IMAGE - FRONT END
   ========================================= */

.custom-image-wrapper {
	display: block;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
	content-visibility: auto;
	contain-intrinsic-size: auto 150px;
}

figure.wp-block-custom-image-block.custom-image-block {
	position: relative;
	display: block;
	overflow: hidden;
	box-sizing: border-box;
	max-width: 100%;
	margin: 0;
	padding: 0;
	background-color: rgba(0, 0, 0, 0.03);
}

figure.custom-image-block > .custom-image-lightbox-trigger {
	display: block;
	width: 100%;
	height: 100%;
	color: inherit;
	text-decoration: none;
	cursor: zoom-in;
}

figure.custom-image-block > .custom-image-lightbox-trigger > img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
	transform-origin: center center;
}

/* =========================================
   CAPTION - FRONT END
   ========================================= */

.custom-image-wrapper > .custom-image-caption {
	display: block;
	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 6px 0 0;
	padding: 0;
	box-sizing: border-box;
	font-family: inherit;
	font-size: var(--wp--preset--font-size--small, 0.875rem);
	font-weight: 400;
	line-height: 1.45;
	text-align: left;
	overflow-wrap: anywhere;
}

/* =========================================
   LIGHTBOX
   ========================================= */

.custom-image-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 32px;
	box-sizing: border-box;
}

.custom-image-lightbox:target {
	display: flex;
}

.custom-image-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.88);
	cursor: zoom-out;
}

.custom-image-lightbox__content {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 90vw;
	max-height: 90vh;
}

.custom-image-lightbox__content img {
	display: block;
	width: auto;
	height: auto;
	max-width: 90vw;
	max-height: 90vh;
	object-fit: contain;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
	border-radius: 2px;
}

.custom-image-lightbox__close {
	position: absolute;
	top: -16px;
	right: -16px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #fff;
	color: #111;
	font-size: 28px;
	line-height: 1;
	text-decoration: none;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
	cursor: pointer;
}

.custom-image-lightbox__close:hover,
.custom-image-lightbox__close:focus {
	background: #eee;
	color: #000;
}

body:has(.custom-image-lightbox:target) {
	overflow: hidden;
}

/* =========================================
   BLOCK EDITOR
   ========================================= */

.custom-image-editor {
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.custom-image-editor__hint {