.sp-gallery {
	--sp-gal-cols: 3;
	--sp-gal-cols-t: 2;
	--sp-gal-cols-m: 1;
	--sp-gal-gap: 0.85rem;
	box-sizing: border-box;
	max-width: 100%;
}

.sp-gallery *,
.sp-gallery *::before,
.sp-gallery *::after {
	box-sizing: border-box;
}

.sp-gallery__header {
	margin-bottom: 1rem;
}

.sp-gallery__title {
	margin: 0 0 0.35rem;
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: #142033;
}

.sp-gallery__desc {
	margin: 0;
	color: #5a6b7d;
	font-size: 0.95rem;
	line-height: 1.45;
}

.sp-gallery__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(var(--sp-gal-cols), minmax(0, 1fr));
	gap: var(--sp-gal-gap);
}

.sp-gallery__item {
	margin: 0;
	position: relative;
}

.sp-gallery__link {
	display: block;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: #e8eef2;
	text-decoration: none;
}

.sp-gallery__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity 0.2s ease, transform 0.25s ease;
}

.sp-gallery__link:hover .sp-gallery__img,
.sp-gallery__link:focus-visible .sp-gallery__img {
	opacity: 0.92;
	transform: scale(1.02);
}

.sp-gallery__caption {
	margin-top: 0.4rem;
	font-size: 0.875rem;
	color: #5a6b7d;
	line-height: 1.35;
}

.sp-gallery__badge {
	position: absolute;
	top: 0.4rem;
	left: 0.4rem;
	font-size: 0.7rem;
	padding: 0.15rem 0.4rem;
	border-radius: 4px;
	background: #142033;
	color: #fff;
}

.sp-gallery__item.is-inactive {
	opacity: 0.55;
}

.sp-gallery--empty,
.sp-gallery__empty {
	padding: 1rem;
	border: 1px dashed #c5d0da;
	border-radius: 10px;
	color: #5a6b7d;
}

/* Lightbox */
.sp-lb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(10, 16, 24, 0.92);
	padding: 1rem;
}

.sp-lb.is-open {
	display: flex;
}

.sp-lb__img {
	max-width: min(96vw, 1200px);
	max-height: 86vh;
	object-fit: contain;
	border-radius: 4px;
}

.sp-lb__btn {
	position: absolute;
	border: 0;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 999px;
	cursor: pointer;
	font-size: 1.4rem;
	line-height: 1;
}

.sp-lb__btn:hover,
.sp-lb__btn:focus-visible {
	background: rgba(255, 255, 255, 0.22);
	outline: 2px solid #9fe8d8;
}

.sp-lb__close {
	top: 1rem;
	right: 1rem;
}

.sp-lb__prev {
	left: 0.75rem;
	top: 50%;
	transform: translateY(-50%);
}

.sp-lb__next {
	right: 0.75rem;
	top: 50%;
	transform: translateY(-50%);
}

@media (max-width: 900px) {
	.sp-gallery__grid {
		grid-template-columns: repeat(var(--sp-gal-cols-t), minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.sp-gallery__grid {
		grid-template-columns: repeat(var(--sp-gal-cols-m), minmax(0, 1fr));
	}

	.sp-lb__prev,
	.sp-lb__next {
		width: 2.4rem;
		height: 2.4rem;
	}
}
