/* =====================================================================
   ПРОСМОТРЩИК ФОТО — общий для всех вариантов страницы галереи.
   Подключается вместе с gallery-viewer.js. Саму страницу не оформляет,
   только полноэкранный просмотр.
   ===================================================================== */

.lb {
	position: fixed;
	inset: 0;
	z-index: 3000;
	display: none;
	flex-direction: column;
	background: #050507;
	opacity: 0;
	font-family: 'JetBrains Mono', 'Consolas', monospace;
}
.lb.open {
	display: flex;
	animation: lb-in 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes lb-in {
	from { opacity: 0; transform: scale(1.012); }
	to   { opacity: 1; transform: none; }
}

/* закрытие — зеркало открытия, а не мгновенное исчезновение */
.lb.closing {
	animation: lb-out 0.24s cubic-bezier(0.32, 0, 0.67, 0) forwards;
	pointer-events: none;
}
@keyframes lb-out {
	from { opacity: 1; transform: none; }
	to   { opacity: 0; transform: scale(1.015); }
}
.lb.closing .lb-img {
	transition: transform 0.24s cubic-bezier(0.32, 0, 0.67, 0),
	            opacity 0.24s ease;
	transform: scale(0.975);
	opacity: 0.4;
}
.lb.closing .lb-top,
.lb.closing .lb-bottom {
	transition: transform 0.24s cubic-bezier(0.32, 0, 0.67, 0), opacity 0.2s ease;
	opacity: 0;
}
.lb.closing .lb-top { transform: translateY(-10px); }
.lb.closing .lb-bottom { transform: translateY(10px); }

/* размытая подложка из самого снимка */
.lb-bg {
	position: absolute;
	inset: -10%;
	background-size: cover;
	background-position: center;
	filter: blur(52px) saturate(1.5) brightness(0.4);
	transform: scale(1.12);
	transition: background-image 0.35s ease;
	pointer-events: none;
}
.lb-bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at center, rgba(0,0,0,0.15) 30%, rgba(0,0,0,0.82) 100%);
}

.lb-top {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 12px 20px;
	background: rgba(6, 6, 10, 0.55);
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	flex-shrink: 0;
	user-select: none;
}
.lb-file {
	font-size: 12.5px;
	color: #9aa0b4;
	letter-spacing: 0.5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.lb-count {
	font-size: 12.5px;
	color: #d7dae4;
	letter-spacing: 2px;
	white-space: nowrap;
}
.lb-count b { color: var(--accent-color, #bc13fe); }
.lb-tools {
	display: flex;
	align-items: center;
	gap: 4px;
}

.lb-dl {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11.5px;
	letter-spacing: 0.8px;
	color: #9aa0b4;
	text-decoration: none;
	padding: 4px 10px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	background: rgba(255, 255, 255, 0.03);
	transition: all 0.15s ease;
	white-space: nowrap;
}
.lb-dl:hover {
	color: #ffffff;
	border-color: var(--accent-color, #bc13fe);
	background: rgba(188, 19, 254, 0.16);
}
.lb-dl b { font-size: 13px; font-weight: 700; line-height: 1; }

.lb-x {
	font-size: 22px;
	line-height: 1;
	color: #9aa0b4;
	cursor: pointer;
	padding: 2px 6px;
	transition: color 0.15s ease, transform 0.15s ease;
}
.lb-x:hover { color: #ff5d5d; transform: scale(1.12); }

@media (max-width: 600px) {
	.lb-dl .txt { display: none; }
	.lb-dl { padding: 4px 8px; }
}

.lb-stage {
	position: relative;
	z-index: 2;
	flex-grow: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	padding: 18px;
}

.lb-img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border: 1px solid rgba(255, 255, 255, 0.14);
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85);
	opacity: 1;
	transition: opacity 0.22s ease;
	background: #0a0a0e;
}
.lb-img.swapping { opacity: 0; }

.lb-zone {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 20%;
	min-width: 90px;
	display: flex;
	align-items: center;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.2s ease;
	z-index: 3;
	user-select: none;
}
.lb-zone:hover { opacity: 1; }
.lb-zone.prev { left: 0; justify-content: flex-start; }
.lb-zone.next { right: 0; justify-content: flex-end; }
.lb-zone span {
	font-size: 40px;
	line-height: 1;
	color: #ffffff;
	padding: 0 22px;
	text-shadow: 0 0 16px var(--glow-color, rgba(188, 19, 254, 0.95)), 0 2px 10px rgba(0, 0, 0, 0.9);
}

.lb-bottom {
	position: relative;
	z-index: 2;
	flex-shrink: 0;
	padding: 14px 20px 12px;
	background: rgba(6, 6, 10, 0.62);
	border-top: 1px solid rgba(255, 255, 255, 0.07);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	text-align: center;
}
.lb-cap {
	font-size: 14.5px;
	line-height: 1.5;
	color: #ffffff;
	max-width: 780px;
	margin: 0 auto;
}
.lb-chips {
	display: flex;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 8px;
}
.lb-chip {
	font-size: 10.5px;
	letter-spacing: 1px;
	padding: 3px 9px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: rgba(255, 255, 255, 0.04);
	color: #9aa0b4;
	user-select: none;
}
.lb-chip b { color: #d98bff; font-weight: 700; }

.lb-film {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	padding: 12px 4px 2px;
	scrollbar-width: none;
}
.lb-film::-webkit-scrollbar { display: none; }
.lb-film-inner {
	display: flex;
	gap: 6px;
	margin: 0 auto;
}
.lb-film img {
	height: 46px;
	width: 66px;
	object-fit: cover;
	cursor: pointer;
	opacity: 0.38;
	border: 1px solid transparent;
	filter: saturate(0.7);
	transition: opacity 0.2s ease, border-color 0.2s ease, filter 0.2s ease, transform 0.2s ease;
	flex-shrink: 0;
}
.lb-film img:hover { opacity: 0.8; filter: none; transform: translateY(-2px); }
.lb-film img.active {
	opacity: 1;
	filter: none;
	border-color: var(--accent-color, #bc13fe);
	box-shadow: 0 0 14px var(--glow-color, rgba(188, 19, 254, 0.65));
}

.lb-hint {
	margin-top: 8px;
	font-size: 10px;
	letter-spacing: 1px;
	color: #4d5265;
	user-select: none;
}
.lb-hint .keys { display: inline; }
.lb-hint .touch { display: none; }
@media (hover: none) {
	.lb-hint .keys { display: none; }
	.lb-hint .touch { display: inline; }
}

@media (max-width: 768px) {
	.lb-zone { display: none; }
	.lb-stage { padding: 10px; }
	.lb-cap { font-size: 13px; }
	.lb-top { padding: 10px 14px; }
	.lb-bottom { padding: 12px 14px 10px; }
	.lb-film img { height: 38px; width: 54px; }
}
