/* Фотоальбомы — в стиле sergeybotkin.ru */
.sba {
	--sba-dark: #31363e;
	--sba-gap: 8px;
	--h: 260px;
	margin: 0 auto 40px;
	max-width: 1200px;
	text-align: center;
}
.sba .sba-title {
	margin: 0 0 24px;
	color: var(--sba-dark);
	text-align: center;
}

/* Ровные ряды: фото сохраняют свои пропорции, края ряда — по линейке */
.sba .sba-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--sba-gap);
}
.sba .sba-item {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	display: block;
	flex: calc(var(--r) * 100) 1 calc(var(--r) * var(--h));
	aspect-ratio: var(--r);
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 10px;
	overflow: hidden;
	background: #eef0f2;
	box-shadow: none;
	cursor: zoom-in;
	text-decoration: none;
	font: inherit;
	line-height: 0;
}
.sba .sba-item[hidden] { display: none !important; }
.sba .sba-item img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: cover;
	transition: transform .5s ease, filter .3s;
}
.sba .sba-item:hover img { transform: scale(1.04); filter: brightness(1.05); }
.sba .sba-item:focus-visible { outline: 3px solid rgba(49, 54, 62, .5); outline-offset: 2px; }
.sba .sba-item.is-in { animation: sba-in .35s ease both; }
@keyframes sba-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.sba .sba-more { margin-top: 32px; }
.sba .sba-more[hidden] { display: none; }
.sba .sba-more-btn {
	-webkit-appearance: none;
	appearance: none;
	display: inline-block;
	margin: 0;
	padding: 14px 40px;
	width: auto;
	border: 0;
	border-radius: 999px;
	background: var(--sba-dark);
	box-shadow: none;
	color: #fff;
	font: inherit;
	font-size: 18px;
	line-height: 1.2;
	text-transform: none;
	cursor: pointer;
	transition: transform .2s;
}
.sba .sba-more-btn:hover { transform: translateY(-2px); }
.sba-empty { text-align: center; color: #7a808a; }

@media (max-width: 600px) {
	.sba { --sba-gap: 6px; --h: 150px !important; }
	.sba .sba-item { border-radius: 8px; }
}

/* ---------- Просмотр фото ---------- */
html.sba-lock, html.sba-lock body { overflow: hidden; }
.sba-lb {
	position: fixed;
	top: 0; right: 0; bottom: 0; left: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 84px;
	background: rgba(24, 27, 31, .95);
	opacity: 0;
	transition: opacity .25s;
	-webkit-user-select: none;
	user-select: none;
}
.sba-lb.is-open { opacity: 1; }
.sba-lb[hidden] { display: none; }
.sba-lb-stage {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 100%;
	max-height: 100%;
}
.sba-lb-img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 130px);
	width: auto;
	height: auto;
	border-radius: 10px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
	opacity: 0;
	transition: opacity .25s;
	-webkit-touch-callout: none;
}
.sba-lb-img.is-loaded { opacity: 1; }
.sba-lb-cap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	margin-top: 14px;
	max-width: 760px;
	color: #fff;
	text-align: center;
	line-height: 1.35;
}
.sba-lb-text { font-size: 16px; }
.sba-lb-text:empty { display: none; }
.sba-lb-count { font-size: 14px; color: rgba(255, 255, 255, .6); }

.sba-lb button {
	-webkit-appearance: none;
	appearance: none;
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	box-shadow: none;
	color: #fff;
	cursor: pointer;
	transition: background-color .2s;
}
.sba-lb button:hover { background: rgba(255, 255, 255, .25); }
.sba-lb button:focus-visible { outline: 3px solid rgba(255, 255, 255, .6); outline-offset: 2px; }
.sba-lb button svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sba-lb-prev { left: 16px; top: 50%; margin-top: -26px !important; }
.sba-lb-next { right: 16px; top: 50%; margin-top: -26px !important; }
.sba-lb-close { top: 16px; right: 16px; }
.sba-lb.is-single .sba-lb-prev,
.sba-lb.is-single .sba-lb-next { display: none; }

@media (max-width: 700px) {
	.sba-lb { padding: 64px 10px 90px; }
	.sba-lb-img { max-height: calc(100vh - 220px); }
	.sba-lb-prev, .sba-lb-next { top: auto; bottom: 18px; margin-top: 0 !important; }
	.sba-lb-prev { left: 50%; margin-left: -66px !important; }
	.sba-lb-next { right: 50%; margin-right: -66px !important; }
	.sba-lb-close { top: 10px; right: 10px; }
}
