/* ## Work Gallery block
--------------------------------------------- */

.work-gallery {
	display: flex;
	flex-direction: column;
	gap: 2.4rem;
	width: 100%;
}

/* Filter bar: two groups of pill buttons between thin rules. */
.work-gallery--filters {
	display: flex;
	flex-wrap: wrap;
	gap: 2.4rem 4.8rem;
	padding: 2.4rem 0;
	border-top: 0.1rem solid var(--color-pebble);
	border-bottom: 0.1rem solid var(--color-pebble);
}

.work-gallery--filters:empty {
	display: none;
}

.work-gallery--group {
	display: flex;
	flex-direction: column;
	gap: 0.8rem;
}

.work-gallery--group-label {
	color: var(--color-stone);
	font-size: 1.3rem;
	font-weight: 600;
	margin: 0;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.work-gallery--chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.8rem;
}

.work-gallery--chip {
	background-color: transparent;
	display: inline-flex;
	align-items: center;
	height: 4.4rem;
	color: var(--color-slate);
	font-size: 1.5rem;
	font-weight: 600;
	font-family: var(--font-body);
	padding: 0 1.8rem;
	border: 0.1rem solid var(--color-slate);
	border-radius: var(--radius-pill);
	cursor: pointer;
	transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.work-gallery--chip:hover {
	background-color: var(--color-linen);
}

.work-gallery--chip.is-active {
	background-color: var(--color-red);
	gap: 0.8rem;
	color: var(--color-white);
	border-color: var(--color-red);
}

.work-gallery--chip.is-active::before {
	background-color: currentColor;
	position: static;
	width: 1.4rem;
	height: 1.4rem;
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.500L19 7.500'/%3E%3C/svg%3E");
	mask-size: contain;
	mask-repeat: no-repeat;
	content: '';
}

.work-gallery--count {
	color: var(--color-stone);
	font-size: 1.5rem;
	margin: 0;
}

/* Photo grid: columns of mixed 4:5 and square photos, as in the design. */
.work-gallery--grid {
	column-gap: 2.4rem;
	columns: 4 24rem;
}

.work-gallery--item {
	display: flex;
	flex-direction: column;
	gap: 1.2rem;
	margin: 0 0 3.2rem;
	break-inside: avoid;
}

.work-gallery--item[hidden] {
	display: none;
}

.work-gallery--open {
	aspect-ratio: 4 / 5;
	background-color: var(--color-photo);
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: var(--radius);
	cursor: zoom-in;
	overflow: hidden;
}

.work-gallery--item:nth-child(even) .work-gallery--open {
	aspect-ratio: 1 / 1;
}

.work-gallery--open img {
	object-fit: cover;
	position: absolute;
	display: block;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	transition: transform 0.3s ease;
}

.work-gallery--open:hover img {
	transform: scale(1.03);
}

.work-gallery--caption {
	display: flex;
	flex-direction: column;
	text-align: left;
}

.work-gallery--title {
	font-size: 1.6rem;
	font-weight: 600;
	margin: 0;
}

.work-gallery--meta {
	color: var(--color-stone);
	font-size: 1.4rem;
	margin: 0;
}

.work-gallery--link {
	display: inline-flex;
	align-items: center;
	min-height: 4.4rem;
	font-size: 1.5rem;
	font-weight: 600;
	text-decoration: underline;
	align-self: flex-start;
	text-underline-offset: 0.5rem;
}

/* Lightbox: the photo on the left, its caption and link on the right. */
.work-gallery--lightbox {
	background-color: var(--color-paper);
	position: fixed;
	width: min(120rem, 94vw);
	max-width: none;
	height: fit-content;
	max-height: 92vh;
	inset: 0;
	color: var(--color-ink);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: var(--radius);
	overflow: auto;
}

.work-gallery--lightbox[open] {
	display: flex;
	flex-wrap: wrap;
}

.work-gallery--lightbox::backdrop {
	background-color: rgba(43, 39, 35, 0.7);
}

.work-gallery--stage {
	flex: 3 1 42rem;
	background-color: var(--color-photo);
	min-width: 0;
}

.work-gallery--stage img {
	object-fit: contain;
	display: block;
	width: 100%;
	max-height: 92vh;
}

.work-gallery--detail {
	flex: 2 1 30rem;
	display: flex;
	flex-direction: column;
	gap: 0.8rem;
	min-width: 0;
	padding: 5.6rem 3.2rem 3.2rem;
}

.work-gallery--detail .work-gallery--title {
	font-size: 2.8rem;
	font-weight: 500;
	line-height: 1.2;
}

.work-gallery--detail .work-gallery--meta {
	font-size: 1.6rem;
}

.work-gallery--more {
	margin: 0;
}

.work-gallery--nav {
	display: flex;
	gap: 1.2rem;
	margin-top: auto;
	padding-top: 2.4rem;
}

.work-gallery--prev,
.work-gallery--next {
	background-color: transparent;
	height: 4.4rem;
	color: var(--color-slate);
	font-size: 1.5rem;
	font-weight: 600;
	font-family: var(--font-body);
	padding: 0 1.8rem;
	border: 0.1rem solid var(--color-slate);
	border-radius: var(--radius-pill);
	cursor: pointer;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.work-gallery--prev:hover,
.work-gallery--next:hover {
	background-color: var(--color-slate);
	color: var(--color-white);
}

.work-gallery--close {
	background-color: var(--color-paper);
	position: absolute;
	width: 4.4rem;
	height: 4.4rem;
	top: 0.8rem;
	right: 0.8rem;
	padding: 0;
	border: 0;
	border-radius: var(--radius-pill);
	cursor: pointer;
	z-index: 1;
}

.work-gallery--close::before {
	background-color: var(--color-ink);
	position: static;
	display: block;
	width: 2.4rem;
	height: 2.4rem;
	margin: 0 auto;
	mask-image: var(--icon-plus);
	mask-size: contain;
	mask-repeat: no-repeat;
	transform: rotate(45deg);
	content: '';
}
