/*
 * Галерея объекта: слайдер и лайтбокс.
 *
 * Три фотографии в ряд на десктопе, две на планшете, одна на телефоне. Прокрутка —
 * нативная (scroll-snap), поэтому работает мышью, тачем и клавиатурой без единой
 * библиотеки.
 */

.aikuo-gallery {
	position: relative;
	margin: 0;
}

.aikuo-gallery-track {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding: 0;
	margin: 0;
}

.aikuo-gallery-track::-webkit-scrollbar {
	display: none;
}

.aikuo-slide {
	flex: 0 0 calc((100% - 24px) / 3);
	scroll-snap-align: start;
	display: block;
	aspect-ratio: 4 / 3;
	border-radius: 12px;
	overflow: hidden;
	background-color: var(--sand, #f3ecdf);
	cursor: zoom-in;
}

.aikuo-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.aikuo-slide:hover img {
	transform: scale(1.04);
}

.aikuo-gallery-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: #2c241b;
	font-size: 22px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(44, 36, 27, 0.18);
	transition: opacity 0.2s ease, background-color 0.2s ease;
	z-index: 2;
}

.aikuo-gallery-arrow:hover {
	background: #ffffff;
}

.aikuo-gallery-arrow:disabled {
	opacity: 0;
	pointer-events: none;
}

.aikuo-gallery-arrow--prev {
	left: 8px;
}

.aikuo-gallery-arrow--next {
	right: 8px;
}

.aikuo-gallery-arrow--prev::before {
	content: '‹';
}

.aikuo-gallery-arrow--next::before {
	content: '›';
}

/* Главное фото объекта: курсор подсказывает, что открывается галерея. */
.js-open-gallery {
	cursor: zoom-in;
}

/* Лайтбокс */

.aikuo-lb {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(20, 16, 12, 0.94);
	padding: 24px;
}

.aikuo-lb[hidden] {
	display: none;
}

.aikuo-lb-img {
	max-width: min(92vw, 1400px);
	max-height: 86vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.aikuo-lb-close,
.aikuo-lb-prev,
.aikuo-lb-next {
	position: absolute;
	border: 0;
	background: rgba(255, 255, 255, 0.12);
	color: #ffffff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s ease;
}

.aikuo-lb-close:hover,
.aikuo-lb-prev:hover,
.aikuo-lb-next:hover {
	background: rgba(255, 255, 255, 0.24);
}

.aikuo-lb-close {
	top: 20px;
	right: 20px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	font-size: 26px;
	line-height: 1;
}

.aikuo-lb-prev,
.aikuo-lb-next {
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	border-radius: 50%;
	font-size: 30px;
	line-height: 1;
}

.aikuo-lb-prev {
	left: 20px;
}

.aikuo-lb-next {
	right: 20px;
}

.aikuo-lb-prev[hidden],
.aikuo-lb-next[hidden] {
	display: none;
}

.aikuo-lb-counter {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.75);
	font-size: 14px;
	letter-spacing: 0.08em;
}

.aikuo-lb-open {
	overflow: hidden;
}

@media (max-width: 1024px) {
	.aikuo-slide {
		flex-basis: calc((100% - 12px) / 2);
	}
}

@media (max-width: 640px) {
	.aikuo-slide {
		flex-basis: 100%;
	}

	.aikuo-lb-prev,
	.aikuo-lb-next {
		width: 44px;
		height: 44px;
		font-size: 24px;
	}

	.aikuo-lb-prev {
		left: 8px;
	}

	.aikuo-lb-next {
		right: 8px;
	}
}
