/* Image Hotspot Links – front end + editor */
.wp-block-ihl-image-hotspots {
	margin-left: 0;
	margin-right: 0;
}
.ihl-stage {
	position: relative;
	display: inline-block;
	max-width: 100%;
	line-height: 0;
	vertical-align: top;
}
.ihl-stage img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0;
}
.ihl-stage.has-custom-width img { width: 100%; }
.ihl-image-link { display: block; }

/* Alignment (same approach as the core Image block: the caption wraps to the image width) */
.wp-block-ihl-image-hotspots.alignleft,
.wp-block-ihl-image-hotspots.alignright,
.wp-block-ihl-image-hotspots.aligncenter { display: table; }
.wp-block-ihl-image-hotspots.aligncenter { margin-left: auto; margin-right: auto; }
.wp-block-ihl-image-hotspots.alignleft > figcaption,
.wp-block-ihl-image-hotspots.alignright > figcaption,
.wp-block-ihl-image-hotspots.aligncenter > figcaption {
	display: table-caption;
	caption-side: bottom;
}
.wp-block-ihl-image-hotspots.alignwide .ihl-stage,
.wp-block-ihl-image-hotspots.alignfull .ihl-stage { display: block; }
.wp-block-ihl-image-hotspots.alignwide .ihl-stage img,
.wp-block-ihl-image-hotspots.alignfull .ihl-stage img { width: 100%; }

/* Zones */
.ihl-zone {
	position: absolute;
	display: block;
	border-radius: 3px;
	transition: background-color .15s ease, box-shadow .15s ease;
}
.ihl-zone:focus-visible {
	outline: 3px solid #2271b1;
	outline-offset: 2px;
}
.ihl-highlight .ihl-zone:hover,
.ihl-highlight .ihl-zone:focus-visible {
	background: rgba(255, 255, 255, .22);
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .95), 0 0 0 1px rgba(0, 0, 0, .35);
}

/* Enlarge button */
.ihl-has-lightbox .ihl-stage > img { cursor: zoom-in; }
.ihl-enlarge {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .6);
	color: #fff;
	cursor: pointer;
	opacity: 0;
	transition: opacity .15s ease;
}
.ihl-stage:hover .ihl-enlarge,
.ihl-enlarge:focus-visible { opacity: 1; }
.ihl-enlarge:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (hover: none) {
	.ihl-enlarge { opacity: 1; }
}

/* Lightbox */
html.ihl-lightbox-open { overflow: hidden; }
.ihl-lightbox {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(14, 14, 16, .92);
	color: #fff;
}
.ihl-lightbox[open] { animation: ihl-fade .2s ease; }
.ihl-lightbox::backdrop { background: transparent; }
.ihl-lightbox__body {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	width: 100%;
	height: 100%;
	padding: 60px 16px 24px;
}
.ihl-stage--lightbox img {
	width: auto;
	height: auto;
	max-width: 92vw;
	max-height: calc(100vh - 150px);
}
.ihl-lightbox__caption {
	margin: 0;
	max-width: 70ch;
	text-align: center;
	font-size: .95rem;
	line-height: 1.5;
}
.ihl-lightbox__caption a { color: inherit; }
.ihl-lightbox__close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
}
.ihl-lightbox__close:hover { background: rgba(255, 255, 255, .12); }
.ihl-lightbox__close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

@keyframes ihl-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
	.ihl-zone, .ihl-enlarge { transition: none; }
	.ihl-lightbox[open] { animation: none; }
}
