/*
 * Перегляд зображення на весь екран.
 *
 * The component assets/js/lightbox.js builds. It lived in ai-agents.css,
 * because the AI page was the first to use it — which meant the second page
 * to enqueue the script got a working overlay with no styling at all:
 * position static, no backdrop, the picture simply appended to the bottom of
 * the document. One component, one stylesheet, enqueued wherever the script
 * is.
 *
 * @package WordPress
 * @subpackage Softex_Theme
 */

/* ---- Перегляд зображення ----
   Over the page rather than in a new browser tab, so closing it is a button
   here and not a tab control up there. */

.sx-view-open {
	overflow: hidden;
}

.sx-view {
	position: fixed;
	inset: 0;
	z-index: var( --sx-z-overlay );
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp( 16px, 4vw, 48px );
	background: color-mix( in srgb, var( --sx-text ) 88%, transparent );
	overflow: auto;
}

.sx-view[hidden] {
	display: none;
}

.sx-view__figure {
	margin: 0;
	max-width: 100%;
}

.sx-view__img {
	display: block;
	max-width: 100%;
	/* Leaves room for the caption under it and never pushes the close button
	   off the top on a short window. */
	max-height: 82vh;
	width: auto;
	height: auto;
	border-radius: var( --sx-radius-md );
	background: var( --sx-white );
}

.sx-view__caption {
	margin-top: 12px;
	color: var( --sx-white );
	font-size: 0.9rem;
	text-align: center;
	opacity: 0.85;
}

.sx-view__caption[hidden] {
	display: none;
}

.sx-view__close {
	position: fixed;
	top: clamp( 12px, 2vw, 24px );
	right: clamp( 12px, 2vw, 24px );
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: color-mix( in srgb, var( --sx-white ) 14%, transparent );
	color: var( --sx-white );
	cursor: pointer;
	transition: background-color var( --sx-transition-fast ) var( --sx-ease );
}

.sx-view__close:hover {
	background: color-mix( in srgb, var( --sx-white ) 28%, transparent );
}

.sx-view__close:focus-visible {
	outline: 2px solid var( --sx-white );
	outline-offset: 2px;
