/* ================================================================
   ГАЛЕРЕЯ ТЕРЕЗЕСІ (assets/js/wkau-lightbox.js) — 2026-10-20
   Қараңғы фон, ортада сурет, екі жағында ‹ ›, жоғарыда санағыш пен батырмалар, төменде шағын суреттер.
   ================================================================ */
.wkau-lb-able { cursor: zoom-in; }
.wkau-lb-able:focus-visible { outline: 3px solid #e0a526; outline-offset: 3px; }

.wkau-lb {
	--lb-gap: 16px;
	--lb-bar: 56px;
	--lb-thumbs: 84px;
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr) 72px;
	grid-template-rows: var(--lb-bar) minmax(0, 1fr) auto;
	background: rgba(8, 12, 20, .97);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	color: #fff;
	opacity: 0;
	transition: opacity .2s ease;
	-webkit-tap-highlight-color: transparent;
}
.wkau-lb[hidden] { display: none !important; }
.wkau-lb.is-open { opacity: 1; }

/* Жоғарғы жолақ */
.wkau-lb__bar {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 12px 0 20px;
	padding-top: env(safe-area-inset-top, 0px);
}
.wkau-lb__count { font-size: 15px; font-weight: 600; letter-spacing: .02em; color: rgba(255, 255, 255, .85); font-variant-numeric: tabular-nums; }
.wkau-lb__tools { display: flex; gap: 6px; }
.wkau-lb__btn {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: rgba(255, 255, 255, .85);
	cursor: pointer;
	transition: background .15s, color .15s;
}
.wkau-lb__btn svg { width: 22px; height: 22px; }
.wkau-lb__btn:hover, .wkau-lb__btn:focus-visible { background: rgba(255, 255, 255, .12); color: #fff; }

/* Сурет */
.wkau-lb__stage {
	grid-column: 2;
	grid-row: 2;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 0;
	margin: 0;
	padding: 4px 0;
}
.wkau-lb__img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - var(--lb-bar) - var(--lb-thumbs) - 56px);
	max-height: calc(100dvh - var(--lb-bar) - var(--lb-thumbs) - 56px);
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 6px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
	cursor: pointer;
	user-select: none;
	-webkit-user-drag: none;
}
.wkau-lb__img.is-in { animation: wkauLbIn .22s ease; }
.wkau-lb.is-loading .wkau-lb__img { opacity: .35; }
.wkau-lb__cap {
	max-width: 900px;
	margin: 0;
	text-align: center;
	font-size: 14px;
	line-height: 1.5;
	color: rgba(255, 255, 255, .85);
}
.wkau-lb__cap[hidden] { display: none; }

.wkau-lb__spin {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 38px;
	height: 38px;
	margin: -19px 0 0 -19px;
	border: 3px solid rgba(255, 255, 255, .2);
	border-top-color: #e0a526;
	border-radius: 50%;
	opacity: 0;
	pointer-events: none;
	transition: opacity .15s .15s;
	animation: wkauLbSpin .8s linear infinite;
}
.wkau-lb.is-loading .wkau-lb__spin { opacity: 1; }

/* ‹ › */
.wkau-lb__nav {
	grid-row: 2;
	align-self: center;
	justify-self: center;
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 50%;
	background: rgba(255, 255, 255, .08);
	color: #fff;
	cursor: pointer;
	transition: background .15s, transform .15s;
}
.wkau-lb__nav svg { width: 26px; height: 26px; }
.wkau-lb__nav:hover, .wkau-lb__nav:focus-visible { background: rgba(255, 255, 255, .2); }
.wkau-lb__nav:active { transform: scale(.94); }
.wkau-lb__nav--prev { grid-column: 1; }
.wkau-lb__nav--next { grid-column: 3; }
.wkau-lb__nav[hidden] { display: none; }

/* Шағын суреттер */
.wkau-lb__thumbs {
	grid-column: 1 / -1;
	grid-row: 3;
	display: flex;
	gap: 8px;
	justify-content: safe center;
	overflow-x: auto;
	padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, .3) transparent;
}
.wkau-lb__thumbs[hidden] { display: none; }
.wkau-lb__thumb {
	flex: 0 0 auto;
	width: 84px;
	height: 58px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 6px;
	overflow: hidden;
	background: #1f2937;
	opacity: .55;
	cursor: pointer;
	transition: opacity .15s, border-color .15s;
}
.wkau-lb__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wkau-lb__thumb:hover, .wkau-lb__thumb:focus-visible { opacity: .9; }
.wkau-lb__thumb.is-active { opacity: 1; border-color: #e0a526; }

.wkau-lb button:focus-visible, .wkau-lb a:focus-visible { outline: 2px solid #e0a526; outline-offset: 2px; }

@keyframes wkauLbIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes wkauLbSpin { to { transform: rotate(360deg); } }

/* Телефон: сурет толық енде, ‹ › суреттің үстінде */
@media (max-width: 767px) {
	.wkau-lb { --lb-bar: 52px; --lb-thumbs: 66px; grid-template-columns: 0 minmax(0, 1fr) 0; }
	.wkau-lb__stage { padding: 0 8px; }
	.wkau-lb__nav {
		position: absolute;
		top: 50%;
		width: 42px;
		height: 42px;
		margin-top: -21px;
		background: rgba(0, 0, 0, .45);
		z-index: 2;
	}
	.wkau-lb__nav--prev { left: 6px; }
	.wkau-lb__nav--next { right: 6px; }
	.wkau-lb__thumb { width: 64px; height: 44px; }
	.wkau-lb__thumbs { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
	.wkau-lb, .wkau-lb__nav, .wkau-lb__thumb { transition: none; }
	.wkau-lb__img.is-in { animation: none; }
}
