/* Section 07 — Project gallery. Dedicated section-by-section implementation. */

.bgn-gallery {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding-block: clamp(82px, 7vw, 104px);
	background: #fff;
}

.bgn-gallery .bgn-gallery__heading {
	position: relative;
	max-width: 920px;
	margin: 0 auto 28px;
	text-align: center;
}

.bgn-gallery .bgn-gallery__heading .bgn-eyebrow {
	display: block;
	margin: 0 0 14px;
	color: #ff4328;
	font-size: 1rem;
	font-weight: 650;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
}

.bgn-gallery .bgn-gallery__heading .bgn-eyebrow::before {
	display: none;
}

.bgn-gallery .bgn-gallery__heading h2 {
	position: relative;
	z-index: 1;
	max-width: 900px;
	margin: 0 auto;
	color: #202936;
	font-size: clamp(2.15rem, 3.5vw, 3.125rem);
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -.04em;
}

.bgn-gallery .bgn-gallery__watermark {
	position: absolute;
	top: 50%;
	left: 50%;
	color: rgba(32, 41, 54, .055);
	font-size: clamp(5rem, 9vw, 8.25rem);
	font-weight: 800;
	line-height: .75;
	letter-spacing: -.06em;
	white-space: nowrap;
	transform: translate(-50%, -50%);
	user-select: none;
}

.bgn-gallery .bgn-gallery__description {
	position: relative;
	z-index: 1;
	max-width: 660px;
	margin: 20px auto 0;
	color: #5a6875;
	font-size: .94rem;
	line-height: 1.75;
}

.bgn-gallery .bgn-gallery__description > :last-child {
	margin-bottom: 0;
}

.bgn-gallery .bgn-gallery__filters {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 4px 22px;
	margin: 0 0 18px;
}

.bgn-gallery .bgn-gallery__filter {
	position: relative;
	min-height: 44px;
	padding: 10px 2px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: #65717d;
	font-size: .78rem;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: .055em;
	text-transform: uppercase;
	cursor: pointer;
	transition: color .18s ease;
}

.bgn-gallery .bgn-gallery__filter::after {
	position: absolute;
	right: 0;
	bottom: 3px;
	left: 0;
	height: 3px;
	background: #fec42f;
	content: "";
	transform: scaleX(0);
	transform-origin: right center;
	transition: transform .22s cubic-bezier(.2, .72, .2, 1);
}

.bgn-gallery .bgn-gallery__filter:hover,
.bgn-gallery .bgn-gallery__filter:focus-visible,
.bgn-gallery .bgn-gallery__filter.is-active,
.bgn-gallery .bgn-gallery__filter[aria-pressed="true"] {
	border-color: transparent;
	background: transparent;
	box-shadow: none;
	color: #044c84;
	outline: 0;
	transform: none;
}

.bgn-gallery .bgn-gallery__filter:focus-visible {
	box-shadow: 0 0 0 3px rgba(4, 76, 132, .14);
}

.bgn-gallery .bgn-gallery__filter.is-active::after,
.bgn-gallery .bgn-gallery__filter[aria-pressed="true"]::after {
	transform: scaleX(1);
	transform-origin: left center;
}

.bgn-gallery .bgn-gallery__result {
	display: flex;
	gap: 5px;
	justify-content: flex-end;
	margin: 0 0 12px;
	color: #63717d;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .06em;
	line-height: 1.2;
	text-transform: uppercase;
}

.bgn-gallery .bgn-gallery__result strong {
	color: #044c84;
	font-weight: 850;
}

.bgn-gallery .bgn-gallery__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
}

.bgn-gallery .bgn-gallery-card {
	position: relative;
	isolation: isolate;
	min-width: 0;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	margin: 0;
	border-radius: 0;
	background: #063f70;
	box-shadow: none;
	animation: none;
}

.bgn-gallery .bgn-gallery-card[hidden] {
	display: none;
}

.bgn-gallery .bgn-gallery-card.is-filter-entering {
	animation: bgn-project-card-in .26s cubic-bezier(.2, .72, .2, 1) both;
}

.bgn-gallery .bgn-gallery-card__media,
.bgn-gallery .bgn-gallery-card__open,
.bgn-gallery .bgn-gallery-card__image {
	width: 100%;
	height: 100%;
}

.bgn-gallery .bgn-gallery-card__media {
	position: absolute;
	inset: 0;
}

.bgn-gallery .bgn-gallery-card__open {
	display: block;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
	cursor: zoom-in;
}

.bgn-gallery .bgn-gallery-card__open:focus-visible {
	outline: 3px solid #fec42f;
	outline-offset: -3px;
}

.bgn-gallery .bgn-gallery-card__image {
	display: block;
	object-fit: cover;
	transition: filter .26s ease, transform .32s cubic-bezier(.2, .72, .2, 1);
}

.bgn-gallery .bgn-gallery-card__sample {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 3;
	padding: 7px 9px;
	background: #fec42f;
	color: #123247;
	font-size: .62rem;
	font-weight: 850;
	letter-spacing: .08em;
	line-height: 1;
	text-transform: uppercase;
}

.bgn-gallery .bgn-gallery-card__zoom {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	display: grid;
	width: 44px;
	height: 44px;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, .62);
	background: rgba(4, 76, 132, .92);
	color: #fff;
	transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.bgn-gallery .bgn-gallery-card__zoom-icon {
	width: 18px;
	height: 18px;
}

.bgn-gallery .bgn-gallery-card__caption {
	position: absolute;
	z-index: 2;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 48%;
	padding: 56px 18px 18px;
	background: linear-gradient(to top, rgba(4, 24, 40, .96), rgba(4, 24, 40, 0));
	color: #fff;
	opacity: 0;
	pointer-events: none;
	transform: translateY(12px);
	transition: opacity .24s ease, transform .28s cubic-bezier(.2, .72, .2, 1);
}

.bgn-gallery .bgn-gallery-card__title {
	display: block;
	color: #fff;
	font-size: 1rem;
	font-weight: 800;
	line-height: 1.35;
	letter-spacing: -.015em;
}

.bgn-gallery .bgn-gallery-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 5px 12px;
	margin-top: 9px;
}

.bgn-gallery .bgn-gallery-card__technique,
.bgn-gallery .bgn-gallery-card__customer {
	color: rgba(255, 255, 255, .78);
	font-size: .67rem;
	font-weight: 750;
	letter-spacing: .055em;
	line-height: 1.25;
	text-transform: uppercase;
}

.bgn-gallery .bgn-gallery-card:hover .bgn-gallery-card__image,
.bgn-gallery .bgn-gallery-card:focus-within .bgn-gallery-card__image {
	filter: saturate(1.04) contrast(1.025);
	transform: scale(1.025);
}

.bgn-gallery .bgn-gallery-card:hover .bgn-gallery-card__caption,
.bgn-gallery .bgn-gallery-card:focus-within .bgn-gallery-card__caption {
	opacity: 1;
	transform: translateY(0);
}

.bgn-gallery .bgn-gallery-card:hover .bgn-gallery-card__zoom,
.bgn-gallery .bgn-gallery-card:focus-within .bgn-gallery-card__zoom {
	background: #fec42f;
	color: #123247;
	transform: translateY(-1px);
}

.bgn-gallery .bgn-gallery__action {
	display: flex;
	justify-content: center;
	margin-top: 38px;
}

.bgn-gallery .bgn-gallery__cta {
	min-height: 50px;
	border-radius: 0;
	background: #044c84;
	color: #fff;
	box-shadow: none;
}

.bgn-gallery .bgn-gallery__cta:hover,
.bgn-gallery .bgn-gallery__cta:focus-visible {
	background: #fec42f;
	color: #123247;
	box-shadow: none;
	transform: translateY(-1px);
}

.bgn-gallery-lightbox {
	width: min(1120px, calc(100vw - 56px));
	max-width: none;
	max-height: calc(100dvh - 56px);
	padding: 0;
	overflow: visible;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #fff;
}

.bgn-gallery-lightbox::backdrop {
	background: rgba(2, 15, 27, .94);
}

.bgn-gallery-lightbox[open] {
	animation: bgn-project-lightbox-in .24s cubic-bezier(.2, .72, .2, 1) both;
}

.bgn-gallery-lightbox__figure {
	position: relative;
	display: grid;
	place-items: center;
	min-height: min(78dvh, 780px);
	overflow: hidden;
	margin: 0;
	border-radius: 0;
	background: #061a2b;
	box-shadow: 0 20px 56px rgba(0, 0, 0, .28);
	touch-action: pan-y;
}

.bgn-gallery-lightbox__image {
	display: block;
	width: auto;
	max-width: 100%;
	max-height: 80dvh;
	margin: auto;
	object-fit: contain;
}

.bgn-gallery-lightbox__figure.is-changing .bgn-gallery-lightbox__image {
	animation: bgn-project-lightbox-image-in .22s cubic-bezier(.2, .72, .2, 1) both;
}

.bgn-gallery-lightbox__figure.is-changing[data-lightbox-direction="backward"] .bgn-gallery-lightbox__image {
	animation-name: bgn-project-lightbox-image-in-backward;
}

.bgn-gallery-lightbox__caption {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 52px 72px 20px;
	background: linear-gradient(to top, rgba(2, 15, 27, .9), transparent);
	color: rgba(255, 255, 255, .92);
	font-size: .86rem;
	font-weight: 650;
	line-height: 1.5;
	text-align: center;
	pointer-events: none;
}

.bgn-gallery-lightbox__count {
	position: absolute;
	top: 16px;
	right: 16px;
	display: flex;
	gap: 5px;
	margin: 0;
	padding: 9px 11px;
	background: #044c84;
	color: #fff;
	font-size: .7rem;
	font-variant-numeric: tabular-nums;
	font-weight: 850;
	letter-spacing: .08em;
	line-height: 1;
}

.bgn-gallery-lightbox__close,
.bgn-gallery-lightbox__previous,
.bgn-gallery-lightbox__next {
	position: absolute;
	z-index: 3;
	display: grid;
	width: 48px;
	height: 48px;
	min-height: 48px;
	padding: 0;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, .62);
	border-radius: 0;
	background: #044c84;
	color: #fff;
	cursor: pointer;
	box-shadow: none;
	transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.bgn-gallery-lightbox__close:hover,
.bgn-gallery-lightbox__close:focus-visible,
.bgn-gallery-lightbox__previous:hover,
.bgn-gallery-lightbox__previous:focus-visible,
.bgn-gallery-lightbox__next:hover,
.bgn-gallery-lightbox__next:focus-visible {
	border-color: #fec42f;
	outline: 0;
	background: #fec42f;
	color: #123247;
}

.bgn-gallery-lightbox__close:focus-visible,
.bgn-gallery-lightbox__previous:focus-visible,
.bgn-gallery-lightbox__next:focus-visible {
	box-shadow: 0 0 0 3px rgba(254, 196, 47, .28);
}

.bgn-gallery-lightbox__close {
	top: 14px;
	right: 14px;
}

.bgn-gallery-lightbox__previous,
.bgn-gallery-lightbox__next {
	top: 50%;
	transform: translateY(-50%);
}

.bgn-gallery-lightbox__previous:hover,
.bgn-gallery-lightbox__previous:focus-visible,
.bgn-gallery-lightbox__next:hover,
.bgn-gallery-lightbox__next:focus-visible {
	transform: translateY(-50%);
}

.bgn-gallery-lightbox__previous {
	left: 14px;
}

.bgn-gallery-lightbox__next {
	right: 14px;
}

.bgn-gallery-lightbox__previous .bgn-gallery-lightbox__control-icon {
	transform: rotate(180deg);
}

.bgn-gallery-lightbox__control-icon {
	width: 20px;
	height: 20px;
}

@keyframes bgn-project-card-in {
	from { opacity: 0; transform: scale(.975); }
	to { opacity: 1; transform: scale(1); }
}

@keyframes bgn-project-lightbox-in {
	from { opacity: 0; transform: translateY(10px) scale(.99); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes bgn-project-lightbox-image-in {
	from { opacity: .2; transform: translateX(12px) scale(.992); }
	to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes bgn-project-lightbox-image-in-backward {
	from { opacity: .2; transform: translateX(-12px) scale(.992); }
	to { opacity: 1; transform: translateX(0) scale(1); }
}

@media (max-width: 1024px) {
	.bgn-gallery .bgn-gallery__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.bgn-gallery {
		padding-block: 76px;
	}

	.bgn-gallery .bgn-gallery__heading {
		margin-bottom: 24px;
	}

	.bgn-gallery .bgn-gallery__heading h2 {
		font-size: clamp(1.85rem, 9vw, 2.35rem);
		line-height: 1.12;
	}

	.bgn-gallery .bgn-gallery__watermark {
		font-size: clamp(4rem, 22vw, 6rem);
	}

	.bgn-gallery .bgn-gallery__filters {
		justify-content: flex-start;
		flex-wrap: nowrap;
		gap: 20px;
		overflow-x: auto;
		margin-inline: -16px;
		padding-inline: 16px;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
	}

	.bgn-gallery .bgn-gallery__filters::-webkit-scrollbar {
		display: none;
	}

	.bgn-gallery .bgn-gallery__filter {
		flex: 0 0 auto;
		scroll-snap-align: start;
	}

	.bgn-gallery .bgn-gallery__result {
		justify-content: flex-start;
	}

	.bgn-gallery .bgn-gallery__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 10px;
	}

	.bgn-gallery .bgn-gallery-card__caption {
		min-height: 43%;
		opacity: 1;
		transform: none;
	}

	.bgn-gallery .bgn-gallery__cta {
		width: 100%;
	}

	.bgn-gallery-lightbox {
		width: calc(100vw - 20px);
		max-height: calc(100dvh - 20px);
	}

	.bgn-gallery-lightbox__figure {
		min-height: 72dvh;
	}

	.bgn-gallery-lightbox__caption {
		padding: 48px 52px 18px;
		font-size: .78rem;
	}

	.bgn-gallery-lightbox__close {
		top: 10px;
		right: 10px;
	}

	.bgn-gallery-lightbox__previous {
		left: 10px;
	}

	.bgn-gallery-lightbox__next {
		right: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bgn-gallery *,
	.bgn-gallery-lightbox,
	.bgn-gallery-lightbox * {
		animation: none !important;
		transition: none !important;
	}

	.bgn-gallery .bgn-gallery-card:hover .bgn-gallery-card__image,
	.bgn-gallery .bgn-gallery-card:focus-within .bgn-gallery-card__image,
	.bgn-gallery .bgn-gallery-card:hover .bgn-gallery-card__zoom,
	.bgn-gallery .bgn-gallery-card:focus-within .bgn-gallery-card__zoom {
		transform: none;
	}
}
