/* ---- Layout ---------------------------------------------------------- */

.sbh-gallery {
	position: relative;
	width: 100%;
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
}

/* ---- Title ----------------------------------------------------------- */

.sbh-gallery__title {
	margin: 10px 0 20px;
}

/* ---- Main slider ----------------------------------------------------- */

.sbh-gallery__main {
	width: 100%;
	aspect-ratio: 4 / 3;
	background-color: #f5f5f4;
}

.sbh-gallery__main .swiper-wrapper {
	align-items: stretch;
}

.sbh-gallery__main .swiper-slide {
	height: auto;
}

.sbh-gallery__figure {
	margin: 0;
	position: relative;
	width: 100%;
	height: 100%;
}

.sbh-gallery__figure img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: contain;
}

.sbh-gallery__caption {
	padding: 0.5rem;
	font-family: "Inter", sans-serif;
	font-size: 0.875rem;
	color: #292524;
	text-align: center;
}

/* ---- Swiper navigation buttons --------------------------------------- */

.sbh-gallery__main .swiper-button-prev,
.sbh-gallery__main .swiper-button-next {
	--swiper-navigation-color: #ffffff;
	width: 44px;
	height: 44px;
	background-color: #006BE0;
	border-radius: 50%;
	transition: background-color ease 250ms;
}

.sbh-gallery__main .swiper-button-prev:hover,
.sbh-gallery__main .swiper-button-next:hover {
	background-color: #020873;
}

.sbh-gallery__main .swiper-button-prev::after,
.sbh-gallery__main .swiper-button-next::after {
	font-size: 16px;
}

/* ---- Download button ------------------------------------------------- */

.sbh-gallery__download {
	position: absolute;
	bottom: 1rem;
	right: 1rem;
	display: inline-block;
	font-family: "Inter", sans-serif;
	font-size: 16px;
	font-weight: 600;
	line-height: 24px;
	padding: 12px 46px 12px 18px;
	border: 1px solid #006BE0;
	background-color: #006BE0;
	color: #ffffff;
	border-radius: 8px;
	cursor: pointer;
	text-decoration: none;
	transition: all ease 250ms;
}

.sbh-gallery__download::after {
	content: "";
	position: absolute;
	top: calc((100% - 20px) / 2);
	right: 18px;
	width: 20px;
	height: 20px;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M17.5 17.5H2.5M15 9.16667L10 14.1667M10 14.1667L5 9.16667M10 14.1667V2.5' stroke='white' stroke-opacity='0.98' stroke-width='1.66667' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.sbh-gallery__download:hover,
.sbh-gallery__download:focus {
	background-color: #ffffff;
	color: #006BE0;
	text-decoration: none;
}

.sbh-gallery__download:hover::after,
.sbh-gallery__download:focus::after {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M17.5 17.5H2.5M15 9.16667L10 14.1667M10 14.1667L5 9.16667M10 14.1667V2.5' stroke='%23006BE0' stroke-opacity='0.98' stroke-width='1.66667' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---- Thumbnails ------------------------------------------------------ */

.sbh-gallery__thumbs {
	margin-top: 1rem;
}

.sbh-gallery__thumbs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.sbh-gallery__thumb {
	padding: 0;
	border: 2px solid transparent;
	background: none;
	cursor: pointer;
	border-radius: 4px;
	overflow: hidden;
	transition: border-color 0.2s;
}

.sbh-gallery__thumb.is-active,
.sbh-gallery__thumb:focus-visible {
	border-color: #006BE0;
	outline: none;
}

.sbh-gallery__thumb img {
	width: 100%;
	height: 80px;
	object-fit: cover;
	display: block;
}

/* ---- Thumbnails loading state ---------------------------------------- */

.sbh-gallery__thumbs-grid.is-loading {
	position: relative;
	pointer-events: none;
	min-height: 120px;
}

.sbh-gallery__thumbs-grid.is-loading .sbh-gallery__thumb {
	opacity: 0.35;
}

.sbh-gallery__thumbs-grid.is-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 32px;
	height: 32px;
	margin: -16px 0 0 -16px;
	border: 3px solid #d6d3d1;
	border-top-color: #006BE0;
	border-radius: 50%;
	animation: sbh-spin 0.6s linear infinite;
}

@keyframes sbh-spin {
	to { transform: rotate(360deg); }
}

/* ---- Thumbnail pager nav --------------------------------------------- */

.sbh-gallery__thumbs-nav {
	display: flex;
	align-items: center;
	gap: 1rem;
	justify-content: center;
}

.sbh-gallery__thumbs-prev,
.sbh-gallery__thumbs-next {
	font-family: "Inter", sans-serif;
	font-size: 16px;
	font-weight: 600;
	line-height: 24px;
	padding: 12px 18px;
	border: 1px solid #006BE0;
	background-color: #006BE0;
	color: #ffffff;
	border-radius: 8px;
	cursor: pointer;
	transition: all ease 250ms;
}

.sbh-gallery__thumbs-prev:hover:not(:disabled),
.sbh-gallery__thumbs-next:hover:not(:disabled),
.sbh-gallery__thumbs-prev:focus:not(:disabled),
.sbh-gallery__thumbs-next:focus:not(:disabled) {
	background-color: #ffffff;
	color: #006BE0;
}

.sbh-gallery__thumbs-prev:disabled,
.sbh-gallery__thumbs-next:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.sbh-gallery__thumbs-count {
	font-family: "Inter", sans-serif;
	font-size: 0.875rem;
	color: #79716B;
}

/* ---- View all link --------------------------------------------------- */

.sbh-gallery__view-all {
	display: inline-block;
	margin-top: 1.5rem;
	font-family: "Inter", sans-serif;
	font-size: 18px;
	font-weight: 600;
	line-height: 28px;
	padding: 16px 22px;
	border: 1px solid #006BE0;
	background-color: #006BE0;
	color: #ffffff;
	border-radius: 8px;
	cursor: pointer;
	text-decoration: none;
	transition: all ease 250ms;
}

.sbh-gallery__view-all:hover,
.sbh-gallery__view-all:focus {
	background-color: #ffffff;
	color: #006BE0;
	text-decoration: none;
}

/* ---- Empty state ----------------------------------------------------- */

.sbh-gallery__empty {
	font-family: "Inter", sans-serif;
	font-size: 1rem;
	color: #79716B;
	padding: 1rem 0;
}

/* ---- Single gallery page --------------------------------------------- */

.sbh-gallery-single-page {
	padding: 0;
}

.sbh-gallery-single-page__inner {
	max-width: 1200px;
	margin: 0 auto;
}

.sbh-gallery-single-page__title {
	font-family: "EB Garamond", serif;
	font-size: 36px;
	color: #292524;
	margin-bottom: 2rem;
	line-height: 1.2;
}

/* ---- Responsive ------------------------------------------------------ */

@media (max-width: 989px) {
	.sbh-gallery-single-page {
		padding: 0;
	}

	.sbh-gallery-single-page__title {
		font-size: 30px;
	}

	.sbh-gallery__download {
		font-size: 14px;
		padding: 8px 40px 8px 14px;
	}

	.sbh-gallery__view-all {
		width: 100%;
		text-align: center;
	}
}
