/*
 * AI Auto Publisher — front-end lightbox styles.
 * Loaded only on a single post whose originating scrape task turned the
 * "Open content images in a lightbox" option on (see class-aap-lightbox.php).
 */

.aap-lightbox-trigger {
	cursor: zoom-in;
	display: inline-block;
}

body.aap-lightbox-locked {
	overflow: hidden;
}

.aap-lightbox-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(10, 10, 14, 0.92);
	opacity: 0;
	transition: opacity .2s ease;
}

.aap-lightbox-overlay.is-open {
	display: flex;
	opacity: 1;
}

.aap-lightbox-stage {
	position: relative;
	max-width: 92vw;
	/* Room reserved at the bottom for the fixed prev/next control bar,
	   so it never overlaps the image no matter how tall the image is. */
	max-height: calc(100vh - 130px);
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 96px;
}

.aap-lightbox-image {
	max-width: 92vw;
	max-height: calc(100vh - 210px);
	width: auto;
	height: auto;
	border-radius: 6px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	opacity: 0;
	transform: scale(.98);
	transition: opacity .18s ease, transform .18s ease;
}

.aap-lightbox-image.is-loaded {
	opacity: 1;
	transform: scale(1);
}

.aap-lightbox-loading {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: #fff;
	font-size: 13px;
	letter-spacing: .02em;
	opacity: 0;
	pointer-events: none;
	transition: opacity .15s ease;
}

.aap-lightbox-loading.is-visible {
	opacity: .85;
}

.aap-lightbox-caption {
	margin-top: 14px;
	color: #f0f0f2;
	font-size: 14px;
	line-height: 1.6;
	max-width: 70ch;
}

.aap-lightbox-close {
	position: fixed;
	top: 18px;
	right: 20px;
	width: 42px;
	height: 42px;
	padding: 0;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background .15s ease;
}

.aap-lightbox-close:hover,
.aap-lightbox-close:focus-visible {
	background: rgba(255, 255, 255, 0.22);
}

/* Fixed bar at the bottom-center of the viewport, holding Prev / counter /
   Next together. Fixed positioning (not tied to the stage/image) means its
   place on screen never changes, regardless of the image's size or
   orientation, and it always stays visible above the image content. */
.aap-lightbox-controlbar {
	position: fixed;
	left: 50%;
	bottom: 18px;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 14px;
	background: rgba(20, 20, 26, 0.6);
	backdrop-filter: blur(6px);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 999px;
	padding: 8px 10px;
	z-index: 2;
}

.aap-lightbox-nav {
	position: static;
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 17px;
	cursor: pointer;
	transition: background .15s ease;
	flex-shrink: 0;
}

.aap-lightbox-nav:hover,
.aap-lightbox-nav:focus-visible {
	background: rgba(255, 255, 255, 0.28);
}

.aap-lightbox-counter {
	position: static;
	color: #f0f0f2;
	font-size: 12.5px;
	background: transparent;
	padding: 0 6px;
	min-width: 54px;
	text-align: center;
	letter-spacing: .02em;
	white-space: nowrap;
}

@media (max-width: 640px) {
	.aap-lightbox-controlbar {
		bottom: max(14px, env(safe-area-inset-bottom));
		gap: 10px;
		padding: 6px 8px;
	}
	.aap-lightbox-nav { width: 48px; height: 48px; font-size: 18px; }
	.aap-lightbox-close { top: 10px; right: 10px; }
}