/*
 * Shared single-image lightbox (player photo) — one copy for the public
 * player profile (nc-theme) and the Manager dashboard (this plugin); both
 * sides enqueue this file with assets/js/nc-lightbox.js. Trigger markup:
 * <a data-lightbox href="{full-size url}" data-lightbox-caption="...">.
 * The same overlay values as the tournament scoreboard lightbox, minus
 * gallery controls — the tournament/notice lightboxes keep their own
 * template-scoped styles and never load this file.
 */

/* ---------- Trigger hint: cursor + a subtle dim, layout untouched ---------- */

a[data-lightbox] {
	cursor: zoom-in;
}

a[data-lightbox]:hover img,
a[data-lightbox]:focus-visible img {
	opacity: 0.88;
}

/* ---------- Overlay ---------- */

.nc-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 16px;
	background: rgba(9, 34, 54, 0.92);
	touch-action: manipulation;
}

.nc-lightbox[hidden] {
	display: none;
}

.nc-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: 90vh;
	object-fit: contain;
	border-radius: 8px;
	pointer-events: none;
}

.nc-lightbox__caption {
	margin: 0;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	text-align: center;
}

.nc-lightbox__close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	cursor: pointer;
}

.nc-lightbox__close svg {
	width: 20px;
	height: 20px;
}

.nc-lightbox__close:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}

@media (min-width: 768px) {
	/* Caption rides at the bottom center on desktop; under the image on
	 * mobile (column layout above). */
	.nc-lightbox {
		flex-direction: row;
	}

	.nc-lightbox__caption {
		position: absolute;
		left: 0;
		right: 0;
		bottom: 18px;
	}
}

/* The lightbox never prints: the public player profile's print output
 * shows only its A4 document, and an open overlay must not leak into it. */
@media print {
	.nc-lightbox {
		display: none !important;
	}
}
