:root {
	--bgk-navy: var(--e-global-color-primary, #2b3441);
	--bgk-muted-blue: var(--e-global-color-accent, #6b8290);
	--bgk-cream: var(--e-global-color-secondary, #efeeeb);
	--bgk-serif: var(--e-global-typography-primary-font-family, "Lora"), Georgia, serif;
	--bgk-sans: var(--e-global-typography-accent-font-family, "Raleway"), Arial, sans-serif;
}

.bgk-portfolio,
.bgk-single-project__inner {
	width: 100%;
	max-width: 1140px;
	margin-inline: auto;
}

.bgk-portfolio {
	position: relative;
}

.bgk-portfolio__filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0 10px;
	margin: 0 0 10px;
	padding: 0;
}

.bgk-portfolio__filter {
	appearance: none;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--bgk-navy);
	cursor: pointer;
	font-family: var(--bgk-serif);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.75;
	padding: 5px 0;
	text-transform: none;
	transition: color 180ms ease, opacity 180ms ease;
}

.bgk-portfolio__filter:hover,
.bgk-portfolio__filter:focus-visible,
.bgk-portfolio__filter.is-active {
	background: transparent;
	color: var(--bgk-muted-blue);
	outline: 0;
}

.bgk-portfolio__filter.is-active {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 5px;
}

.bgk-portfolio__grid {
	display: grid;
	grid-template-columns: repeat(var(--bgk-columns, 2), minmax(0, 1fr));
	gap: 20px;
}

.bgk-project-card {
	min-width: 0;
	margin: 0;
}

.bgk-project-card[hidden] {
	display: none !important;
}

.bgk-project-card__link,
.bgk-project-card__media,
.bgk-project-card__overlay {
	display: block;
}

.bgk-project-card__link {
	position: relative;
	overflow: hidden;
	color: #fff;
	text-decoration: none;
}

.bgk-project-card__media {
	position: relative;
	aspect-ratio: 3 / 2;
	background: #e9e8e5;
	overflow: hidden;
}

.bgk-project-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
}

.bgk-project-card__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(18px, 3vw, 30px);
	background: rgb(43 52 65 / 78%);
	opacity: 0;
	transition: opacity 220ms ease;
}

.bgk-project-card__title {
	display: block;
	width: 100%;
	max-width: 100%;
	color: #fff;
	font-family: var(--bgk-serif);
	font-size: clamp(21px, 2.05vw, 32px);
	font-weight: 400;
	line-height: 1.12;
	overflow-wrap: break-word;
	text-align: center;
	text-wrap: balance;
}

.bgk-project-card__title.is-long {
	font-size: clamp(20px, 1.82vw, 28px);
}

.bgk-project-card__title.is-very-long {
	font-size: clamp(18px, 1.62vw, 25px);
}

.bgk-project-card__link:hover .bgk-project-card__overlay,
.bgk-project-card__link:focus-visible .bgk-project-card__overlay {
	opacity: 1;
}

.bgk-project-card__link:focus-visible {
	outline: 2px solid var(--bgk-navy);
	outline-offset: 3px;
}

/*
 * The Pantry theme wraps normal singular content in a narrow .content_wrap and
 * applies its own large top padding. Portfolio landing pages use a fullscreen
 * wrapper, so remove those parent constraints for project pages before sizing
 * the plugin itself. This makes each two-column project image exactly the same
 * width as a card on the main 1140px portfolio grid.
 */
body.bgk-project-page .page_content_wrap {
	box-sizing: border-box;
	padding-top: 0 !important;
}

body.bgk-project-page .page_content_wrap > .content_wrap,
body.bgk-project-page .page_content_wrap .content_wrap {
	box-sizing: border-box;
	width: 100% !important;
	max-width: none !important;
	margin-right: 0 !important;
	margin-left: 0 !important;
	padding-right: 0 !important;
	padding-left: 0 !important;
}

body.bgk-project-page .page_content_wrap .content {
	box-sizing: border-box;
	float: none !important;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
}

.bgk-single-project,
main#primary.bgk-single-project,
.site-main.bgk-single-project {
	box-sizing: border-box;
	float: none !important;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 28px 20px 70px;
}

.bgk-single-project__inner {
	box-sizing: border-box;
	max-width: 1140px !important;
}

.bgk-single-project__title {
	margin: 0 0 30px;
	color: var(--bgk-navy);
	font-family: var(--bgk-serif);
	font-size: clamp(34px, 4vw, 40px);
	font-weight: 400;
	line-height: 1.15;
	text-align: center;
	text-wrap: balance;
}

.bgk-project-gallery {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.bgk-project-gallery__item {
	min-width: 0;
	margin: 0;
}

.bgk-project-gallery__link {
	appearance: none;
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: 0;
	background: #e9e8e5;
	box-shadow: none;
	cursor: zoom-in;
}

.bgk-project-gallery__link img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	transition: transform 250ms ease;
}

.bgk-project-gallery__link:hover img,
.bgk-project-gallery__link:focus-visible img {
	transform: scale(1.015);
}

.bgk-project-gallery__link:focus-visible {
	outline: 2px solid var(--bgk-navy);
	outline-offset: 3px;
}

.bgk-single-project__all-projects {
	margin: 60px 0 75px;
	text-align: center;
}

.bgk-button {
	display: inline-block;
	border: 0;
	border-radius: 0;
	background: var(--bgk-navy);
	color: #fff !important;
	font-family: var(--bgk-sans);
	font-size: 18px;
	font-weight: 500;
	line-height: 22px;
	padding: 15px 60px;
	text-decoration: none !important;
	text-transform: uppercase;
	transition: background-color 180ms ease;
}

.bgk-button:hover,
.bgk-button:focus-visible {
	background: var(--bgk-muted-blue);
	color: #fff !important;
}

.bgk-project-navigation {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px;
	align-items: center;
}

.bgk-project-navigation__next {
	text-align: right;
}

.bgk-project-navigation a {
	color: var(--bgk-navy);
	font-family: var(--bgk-serif);
	font-size: 20px;
	font-weight: 400;
	line-height: 1.4;
	text-decoration: none;
}

.bgk-project-navigation a:hover,
.bgk-project-navigation a:focus-visible {
	color: var(--bgk-muted-blue);
}

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

.bgk-lightbox {
	position: fixed;
	z-index: 999999;
	inset: 0;
	display: grid;
	grid-template-columns: minmax(50px, 90px) minmax(0, 1fr) minmax(50px, 90px);
	align-items: center;
	background: rgb(15 18 23 / 96%);
	color: #fff;
}

.bgk-lightbox__stage {
	display: flex;
	min-width: 0;
	height: 100%;
	align-items: center;
	justify-content: center;
	padding: 60px 0;
	position: relative;
}

.bgk-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 120px);
	width: auto;
	height: auto;
	object-fit: contain;
}

.bgk-lightbox__close,
.bgk-lightbox__previous,
.bgk-lightbox__next {
	appearance: none;
	border: 0;
	background: transparent !important;
	box-shadow: none;
	color: #fff !important;
	cursor: pointer;
	font-family: Arial, sans-serif;
	line-height: 1;
	padding: 15px;
}

.bgk-lightbox__close {
	position: absolute;
	z-index: 2;
	top: 10px;
	right: 16px;
	font-size: 48px;
	font-weight: 200;
}

.bgk-lightbox__previous,
.bgk-lightbox__next {
	font-size: 44px;
}

.bgk-lightbox__counter {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	font-family: var(--bgk-sans);
	font-size: 14px;
	letter-spacing: .08em;
}

body.bgk-lightbox-open {
	overflow: hidden;
}

@media (max-width: 767px) {
	.bgk-portfolio {
		padding-inline: 0;
	}

	.bgk-portfolio__filters {
		gap: 0 14px;
		margin-bottom: 15px;
	}

	.bgk-portfolio__filter {
		font-size: 15px;
	}

	.bgk-portfolio__grid,
	.bgk-project-gallery {
		grid-template-columns: 1fr;
	}

	.bgk-project-card__title,
	.bgk-project-card__title.is-long,
	.bgk-project-card__title.is-very-long {
		font-size: clamp(20px, 6.2vw, 27px);
	}

	.bgk-single-project {
		padding: 22px 15px 50px;
	}

	.bgk-single-project__title {
		margin-bottom: 28px;
	}

	.bgk-single-project__all-projects {
		margin: 45px 0 55px;
	}

	.bgk-button {
		padding-inline: 42px;
	}

	.bgk-project-navigation {
		padding-inline: 10px;
	}

	.bgk-lightbox {
		grid-template-columns: 50px minmax(0, 1fr) 50px;
	}

	.bgk-lightbox__stage {
		padding: 70px 0;
	}

	.bgk-lightbox__previous,
	.bgk-lightbox__next {
		font-size: 32px;
		padding: 8px;
	}
}

@media (hover: none) {
	.bgk-project-card__overlay {
		align-items: flex-end;
		padding: 28px 18px;
		background: linear-gradient(to top, rgb(43 52 65 / 88%), rgb(43 52 65 / 0%) 75%);
		opacity: 1;
	}

	.bgk-project-card__title,
	.bgk-project-card__title.is-long,
	.bgk-project-card__title.is-very-long {
		font-size: clamp(19px, 5.5vw, 24px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.bgk-project-card__overlay,
	.bgk-project-gallery__link img {
		transition: none;
	}
}
