/* Image lightbox — opens on click of any image link inside .entry-content. */

.magon-ilb {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, 0.88);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 200ms ease;
}

/* Two-step open (see image-lightbox.js): `is-visible` makes the overlay
   participate in layout but stay opacity 0; the JS forces a reflow, then
   adds `is-open` so the opacity transition runs. On close both classes
   drop together — the dialog disappears instantly (intentional snap, see
   close() comment in image-lightbox.js). */
.magon-ilb.is-visible {
	visibility: visible;
	pointer-events: auto;
}

.magon-ilb.is-open {
	opacity: 1;
}

html.magon-ilb-open {
	overflow: hidden;
}

.magon-ilb__fig {
	position: relative;
	max-width: min(96vw, 1600px);
	max-height: 92vh;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.magon-ilb__img {
	max-width: 100%;
	max-height: 92vh;
	width: auto;
	height: auto;
	display: block;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
	background: #1a1a1a;
}

.magon-ilb__close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	border: 0;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	font-size: 28px;
	line-height: 44px;
	border-radius: 4px;
	cursor: pointer;
	z-index: 2;
	padding: 0;
	transition: background 150ms ease;
}

.magon-ilb__close:hover,
.magon-ilb__close:focus-visible {
	background: rgba(0, 0, 0, 0.7);
	outline: 0;
}

.magon-ilb__copy {
	position: absolute;
	bottom: 16px;
	right: 16px;
	padding: 8px 14px;
	border: 0;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-family: var(--font-sans, 'PT Sans', sans-serif);
	font-size: 13px;
	line-height: 1.2;
	cursor: pointer;
	transition: background 150ms ease;
	-webkit-tap-highlight-color: transparent;
}

.magon-ilb__copy:hover,
.magon-ilb__copy:focus-visible {
	background: rgba(0, 0, 0, 0.85);
	outline: 0;
}

.magon-ilb__copy--ok {
	background: #2B8A3E;
}

@media (max-width: 599px) {
	.magon-ilb {
		padding: 12px;
	}
	.magon-ilb__close {
		top: 8px;
		right: 8px;
	}
	.magon-ilb__copy {
		bottom: 8px;
		right: 8px;
		font-size: 12px;
		padding: 7px 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.magon-ilb {
		transition: none;
	}
}
