/**
 * Pubtic basic lightbox
 *
 * A deliberately simple click-to-enlarge overlay for images inside post/page
 * content. Replaces reliance on WordPress core's Image block lightbox, whose
 * zoom-from-thumbnail animation could end up off-center depending on the
 * surrounding layout. This version has no position math to get wrong: the
 * overlay is a full-viewport flex box that centers whatever image is put in
 * it, and the only motion is a plain opacity fade.
 */

.entry-content .wp-block-image img:not(.no-lightbox) {
	cursor: zoom-in;
}

.pubtic-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
	background: rgba(0, 0, 0, 0.9);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s ease;
}

.pubtic-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.pubtic-lightbox img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	margin: 0 auto;
	object-fit: contain;
	cursor: zoom-out;
}

.pubtic-lightbox__close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	z-index: 1;
}

.pubtic-lightbox__close:hover,
.pubtic-lightbox__close:focus {
	opacity: 0.75;
}

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