.custom-portfolio-gallery {
	--portfolio-gallery-gap: 12px;
	--portfolio-gallery-stack-gap: 6.75px;
	--portfolio-gallery-radius: 8px;
	width: 100%;
}

.custom-portfolio-gallery__filters {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 24px;
	margin-bottom: 28px;
	align-items: flex-start;
	justify-content: space-between;
}

.custom-portfolio-gallery__filter-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.custom-portfolio-gallery__filters--with-kind .custom-portfolio-gallery__filter-row--categories {
	margin-inline-start: auto;
}

.custom-portfolio-gallery__filter-row--categories {
	min-width: 0;
}

.custom-portfolio-gallery__category-slider {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	flex: 1 1 auto;
	min-width: 0;
	gap: 8px;
}

.custom-portfolio-gallery__category-viewport {
	min-width: 0;
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-inline: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.custom-portfolio-gallery__category-viewport::-webkit-scrollbar {
	display: none;
}

.custom-portfolio-gallery__category-viewport:focus-visible {
	outline: 2px solid #111;
	outline-offset: 3px;
}

.custom-portfolio-gallery__category-track {
	position: relative;
	display: inline-flex;
	align-items: center;
	min-width: max-content;
	gap: 12px;
}

.custom-portfolio-gallery__category-track .custom-portfolio-gallery__filter {
	flex: 0 0 auto;
	scroll-snap-align: start;
}

.custom-portfolio-gallery__slider-button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid #111;
	border-radius: 4px;
	background: #fff;
	color: #111;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.custom-portfolio-gallery__slider-button::before {
	content: "";
	width: 9px;
	height: 9px;
	border-top: 2px solid currentColor;
	border-left: 2px solid currentColor;
}

.custom-portfolio-gallery__slider-button--prev::before {
	transform: translateX(2px) rotate(-45deg);
}

.custom-portfolio-gallery__slider-button--next::before {
	transform: translateX(-2px) rotate(135deg);
}

.custom-portfolio-gallery__slider-button:hover:not(:disabled),
.custom-portfolio-gallery__slider-button:focus-visible {
	background: #000;
	color: #fff;
}

.custom-portfolio-gallery__slider-button:disabled {
	opacity: 0.35;
	cursor: default;
}

.custom-portfolio-gallery__slider-button[hidden] {
	display: none;
}

.custom-portfolio-gallery__filter-row--categories.is-showing-realizations .custom-portfolio-gallery__filter:not([data-filter-value="all"]) {
	display: none;
}

.custom-portfolio-gallery__select-label {
	position: relative;
	display: inline-flex;
}

.custom-portfolio-gallery__select-label--categories {
	display: none;
}

.custom-portfolio-gallery__select {
	min-height: 36px;
	min-width: 220px;
	padding: 8px 42px 8px 16px;
	border: 1px solid #111;
	border-radius: 4px;
	background: #fff;
	color: #111;
	font: inherit;
	font-size: 14px;
	line-height: 1.2;
	cursor: pointer;
	appearance: none;
}

.custom-portfolio-gallery__select--kind {
	width: 156px;
	min-width: 156px;
}

.custom-portfolio-gallery__select-label::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 16px;
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	pointer-events: none;
	transform: translateY(-65%) rotate(45deg);
}

.custom-portfolio-gallery__filter {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 36px;
	padding: 8px 16px;
	border: 1px solid #111;
	border-radius: 4px;
	background: #fff;
	color: #111;
	font: inherit;
	font-size: 14px;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.custom-portfolio-gallery__filter-icon-wrap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
}

.custom-portfolio-gallery__filter-icon {
	display: block;
	width: 18px;
	height: 18px;
	object-fit: contain;
}

.custom-portfolio-gallery__filter:hover,
.custom-portfolio-gallery__filter:focus-visible,
.custom-portfolio-gallery__filter.is-active {
	background: #000;
	color: #fff;
}

.custom-portfolio-gallery__filter:hover .custom-portfolio-gallery__filter-icon,
.custom-portfolio-gallery__filter:focus-visible .custom-portfolio-gallery__filter-icon,
.custom-portfolio-gallery__filter.is-active .custom-portfolio-gallery__filter-icon {
	filter: brightness(0) invert(1);
}

.custom-portfolio-gallery__grid {
	display: flex;
	flex-direction: column;
	gap: var(--portfolio-gallery-gap);
}

.custom-portfolio-gallery__load-more {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	margin: 28px auto 0;
	padding: 10px 22px;
	border: 1px solid #111;
	border-radius: 4px;
	background: #fff;
	color: #111;
	font: inherit;
	font-size: 14px;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.custom-portfolio-gallery__load-more:hover,
.custom-portfolio-gallery__load-more:focus-visible {
	background: #000;
	color: #fff;
}

.custom-portfolio-gallery__load-more[hidden] {
	display: none;
}

.custom-portfolio-gallery__group {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	gap: var(--portfolio-gallery-gap);
	align-items: stretch;
}

.custom-portfolio-gallery__group--reverse {
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.custom-portfolio-gallery__group--simple {
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.custom-portfolio-gallery__stack {
	display: flex;
	flex-direction: column;
	gap: var(--portfolio-gallery-stack-gap);
}

.custom-portfolio-gallery__item {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--portfolio-gallery-radius);
	background: #f4f4f4;
}

.custom-portfolio-gallery__image {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.custom-portfolio-gallery__item:hover .custom-portfolio-gallery__image {
	transform: scale(1.03);
}

@media (min-width: 992px) {
	.custom-portfolio-gallery__filters--with-kind {
		flex-wrap: nowrap;
	}

	.custom-portfolio-gallery__filter-row--kind {
		flex: 0 0 auto;
	}

	.custom-portfolio-gallery__filter-row--categories {
		flex: 1 1 0;
		flex-wrap: nowrap;
	}

	.custom-portfolio-gallery__stack {
		display: grid;
		grid-template-rows: repeat(2, minmax(0, 1fr));
		min-height: 0;
	}

	.custom-portfolio-gallery__item--small {
		min-height: 0;
		aspect-ratio: auto;
	}
}

.custom-portfolio-lightbox-is-open {
	overflow: hidden;
}

.custom-portfolio-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 32px;
	background: rgba(0, 0, 0, 0.88);
}

.custom-portfolio-lightbox.is-open {
	display: flex;
}

.custom-portfolio-lightbox__image {
	display: block;
	max-width: min(1200px, 88vw);
	max-height: 88vh;
	width: auto;
	height: auto;
	border-radius: 8px;
	object-fit: contain;
	box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.custom-portfolio-lightbox__close,
.custom-portfolio-lightbox__nav {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(255, 255, 255, 0.35);
	background: rgba(0, 0, 0, 0.35);
	color: #fff;
	cursor: pointer;
}

.custom-portfolio-lightbox__close {
	top: 24px;
	right: 24px;
	width: 44px;
	height: 44px;
	border-radius: 999px;
	padding: 0;
	font-size: 0;
	line-height: 0;
}

.custom-portfolio-lightbox__nav {
	top: 50%;
	width: 48px;
	height: 64px;
	border-radius: 4px;
	padding: 0;
	transform: translateY(-50%);
}

.custom-portfolio-lightbox__close::before,
.custom-portfolio-lightbox__close::after {
	content: "";
	position: absolute;
	width: 18px;
	height: 2px;
	background: currentColor;
	border-radius: 999px;
}

.custom-portfolio-lightbox__close::before {
	transform: rotate(45deg);
}

.custom-portfolio-lightbox__close::after {
	transform: rotate(-45deg);
}

.custom-portfolio-lightbox__nav::before {
	content: "";
	width: 18px;
	height: 18px;
	border-top: 5px solid currentColor;
	border-left: 5px solid currentColor;
}

.custom-portfolio-lightbox__nav--prev::before {
	transform: translateX(4px) rotate(-45deg);
}

.custom-portfolio-lightbox__nav--next::before {
	transform: translateX(-4px) rotate(135deg);
}

.custom-portfolio-lightbox__nav--prev {
	left: 24px;
}

.custom-portfolio-lightbox__nav--next {
	right: 24px;
}

.custom-portfolio-lightbox__close:hover,
.custom-portfolio-lightbox__close:focus-visible,
.custom-portfolio-lightbox__nav:hover,
.custom-portfolio-lightbox__nav:focus-visible {
	background: #fff;
	color: #000;
}

@media (max-width: 991px) {
	.custom-portfolio-gallery__grid {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.custom-portfolio-gallery__filter-row {
		flex: 1 1 100%;
		width: 100%;
	}

	.custom-portfolio-gallery__filters--with-kind .custom-portfolio-gallery__filter-row--categories {
		margin-inline-start: 0;
	}

	.custom-portfolio-gallery__category-slider {
		display: none;
	}

	.custom-portfolio-gallery__select-label--categories {
		display: inline-flex;
		width: 100%;
	}

	.custom-portfolio-gallery__select-label--kind {
		width: 100%;
	}

	.custom-portfolio-gallery__select {
		width: 100%;
		min-width: 0;
	}

	.custom-portfolio-gallery__group,
	.custom-portfolio-gallery__group--reverse,
	.custom-portfolio-gallery__group--simple {
		display: contents;
	}

	.custom-portfolio-gallery__stack {
		display: contents;
	}
}

@media (max-width: 575px) {
	.custom-portfolio-gallery__filters {
		gap: 14px;
		margin-bottom: 20px;
	}

	.custom-portfolio-gallery__filter-row {
		gap: 8px;
	}

	.custom-portfolio-gallery__filter {
		min-height: 34px;
		padding: 8px 12px;
		font-size: 13px;
	}

	.custom-portfolio-gallery__select {
		width: 100%;
		min-width: 0;
		min-height: 34px;
		font-size: 13px;
	}

	.custom-portfolio-gallery__load-more {
		min-height: 38px;
		margin-top: 20px;
		padding: 9px 18px;
		font-size: 13px;
	}

	.custom-portfolio-gallery__grid {
		grid-template-columns: 1fr;
	}

	.custom-portfolio-lightbox {
		padding: 16px;
	}

	.custom-portfolio-lightbox__image {
		max-width: 94vw;
		max-height: 82vh;
	}

	.custom-portfolio-lightbox__close {
		top: 12px;
		right: 12px;
	}

	.custom-portfolio-lightbox__nav {
		width: 40px;
		height: 52px;
	}

	.custom-portfolio-lightbox__nav--prev {
		left: 12px;
	}

	.custom-portfolio-lightbox__nav--next {
		right: 12px;
	}
}
