.hbgh-gallery {
	--hbgh-columns: 3;
	--hbgh-gap: 12px;
	--hbgh-preview-size: 300px;
	--hbgh-ratio: auto;
	container-type: inline-size;
	margin-block: 1.5rem;
}

.hbgh-controls {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: space-between;
	margin-block-end: 1rem;
}

.hbgh-search {
	border: 1px solid #b9bec7;
	border-radius: 999px;
	font: inherit;
	min-width: min(20rem, 80vw);
	padding: 0.65rem 1rem;
}

.hbgh-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.hbgh-filters button,
.hbgh-load-more,
.hbgh-pagination button {
	background: #fff;
	border: 1px solid currentColor;
	border-radius: 999px;
	color: inherit;
	cursor: pointer;
	font: inherit;
	padding: 0.45rem 0.9rem;
}

.hbgh-filters button.is-active {
	background: #1d2327;
	color: #fff;
}

.hbgh-items {
	display: grid;
	gap: var(--hbgh-gap);
	grid-template-columns: repeat(var(--hbgh-columns), minmax(0, 1fr));
}

.hbgh-item {
	background: #eef0f2;
	margin: 0;
	min-width: 0;
	overflow: hidden;
	position: relative;
}

.hbgh-item[hidden] {
	display: none !important;
}

.hbgh-image-link {
	display: block;
	height: 100%;
	position: relative;
}

.hbgh-item img {
	aspect-ratio: var(--hbgh-ratio);
	display: block;
	height: auto;
	object-fit: var(--hbgh-image-fit, cover);
	transition: filter 180ms ease, transform 280ms ease;
	width: 100%;
}

.hbgh-fit-cover {
	--hbgh-image-fit: cover;
}

.hbgh-fit-contain {
	--hbgh-image-fit: contain;
}

.hbgh-gallery.hbgh-thumb-axis-height .hbgh-item {
	height: var(--hbgh-preview-size);
}

.hbgh-gallery.hbgh-thumb-axis-height .hbgh-image-link,
.hbgh-gallery.hbgh-thumb-axis-height .hbgh-item img {
	height: 100%;
}

.hbgh-gallery.hbgh-thumb-axis-height .hbgh-item img {
	aspect-ratio: auto;
}

.hbgh-thumb-axis-width .hbgh-item img {
	max-inline-size: var(--hbgh-preview-size);
}

.hbgh-thumb-axis-width .hbgh-item {
	display: flex;
	flex-direction: column;
}

.hbgh-thumb-axis-width .hbgh-image-link {
	align-items: flex-start;
	display: flex;
}

.hbgh-image-link:hover img,
.hbgh-image-link:focus-visible img {
	filter: brightness(0.9);
	transform: scale(1.025);
}

.hbgh-item figcaption {
	background: linear-gradient(transparent, rgb(0 0 0 / 0.78));
	bottom: 0;
	color: #fff;
	font-size: 0.88rem;
	left: 0;
	padding: 2.5rem 0.75rem 0.65rem;
	pointer-events: none;
	position: absolute;
	right: 0;
}

.hbgh-layout-masonry .hbgh-items {
	column-count: var(--hbgh-columns);
	column-gap: var(--hbgh-gap);
	display: block;
}

.hbgh-layout-masonry .hbgh-item {
	break-inside: avoid;
	margin-block-end: var(--hbgh-gap);
}

.hbgh-layout-masonry .hbgh-item img {
	aspect-ratio: auto;
	height: auto;
}

.hbgh-layout-justified .hbgh-items {
	display: flex;
	flex-wrap: wrap;
}

.hbgh-layout-justified .hbgh-item {
	flex: 1 1 16rem;
	height: clamp(12rem, 24vw, 20rem);
}

.hbgh-layout-slider .hbgh-items {
	display: flex;
	overflow-x: auto;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
}

.hbgh-layout-slider .hbgh-item {
	flex: 0 0 min(82cqi, 60rem);
	scroll-snap-align: center;
}

.hbgh-layout-slider.hbgh-thumb-axis-width .hbgh-item {
	flex-basis: min(82cqi, var(--hbgh-preview-size));
}

.hbgh-layout-slider .hbgh-item img {
	max-height: 75vh;
}

.hbgh-load-more {
	display: block;
	margin: 1.25rem auto 0;
}

.hbgh-load-sentinel {
	height: 1px;
	inline-size: 100%;
}

.hbgh-pagination {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	justify-content: center;
	margin-block-start: 1.25rem;
}

.hbgh-page-numbers {
	display: contents;
}

.hbgh-pagination button {
	min-height: 2.35rem;
	min-width: 2.35rem;
	padding: 0.35rem 0.65rem;
}

.hbgh-pagination button.is-active {
	background: #1d2327;
	color: #fff;
}

.hbgh-pagination button:disabled {
	cursor: not-allowed;
	opacity: 0.45;
}

.hbgh-page-ellipsis {
	padding-inline: 0.25rem;
}

.hbgh-no-results,
.hbgh-empty {
	padding: 1rem;
	text-align: center;
}

.hbgh-lightbox-open {
	overflow: hidden;
}

.hbgh-lightbox {
	align-items: center;
	background: rgb(4 8 12 / 0.96);
	color: #fff;
	display: grid;
	inset: 0;
	justify-items: center;
	padding: 3rem clamp(1rem, 5vw, 5rem);
	position: fixed;
	z-index: 100000;
}

.hbgh-lightbox[hidden] {
	display: none;
}

.hbgh-lightbox figure {
	display: grid;
	height: 100%;
	margin: 0;
	max-height: calc(100vh - 6rem);
	max-width: min(90rem, calc(100vw - 8rem));
	place-items: center;
	width: 100%;
}

.hbgh-lightbox img {
	box-shadow: 0 1rem 4rem rgb(0 0 0 / 0.45);
	display: block;
	max-height: calc(100vh - 9rem);
	max-width: 100%;
	object-fit: contain;
}

.hbgh-lightbox figcaption {
	background: rgb(0 0 0 / 0.65);
	border-radius: 0.2rem;
	bottom: 1.5rem;
	left: 50%;
	max-width: min(50rem, calc(100vw - 4rem));
	padding: 0.5rem 0.8rem;
	position: fixed;
	text-align: center;
	transform: translateX(-50%);
}

.hbgh-lightbox button {
	background: rgb(0 0 0 / 0.35);
	border: 0;
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	font: 300 2.8rem/1 sans-serif;
	height: 3.2rem;
	position: fixed;
	width: 3.2rem;
	z-index: 1;
}

.hbgh-lightbox button:hover,
.hbgh-lightbox button:focus-visible {
	background: #fff;
	color: #111;
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.hbgh-lightbox-close {
	right: 1rem;
	top: 1rem;
}

.hbgh-lightbox-prev {
	left: 1rem;
	top: 50%;
	transform: translateY(-50%);
}

.hbgh-lightbox-next {
	right: 1rem;
	top: 50%;
	transform: translateY(-50%);
}

.hbgh-lightbox-position {
	right: 1.25rem;
	bottom: 1.1rem;
	position: fixed;
}

@container (max-width: 700px) {
	.hbgh-items {
		grid-template-columns: repeat(min(2, var(--hbgh-columns)), minmax(0, 1fr));
	}

	.hbgh-layout-masonry .hbgh-items {
		column-count: min(2, var(--hbgh-columns));
	}
}

@container (max-width: 420px) {
	.hbgh-items {
		grid-template-columns: 1fr;
	}

	.hbgh-layout-masonry .hbgh-items {
		column-count: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hbgh-item img,
	.hbgh-layout-slider .hbgh-items {
		scroll-behavior: auto;
		transition: none;
	}
}
