.ht-photo-wall {
	--_row: 180px;
	padding-block: 5rem var(--wp--preset--spacing--l);
	color: var(--wp--preset--color--green-dark);
}

/* Header */
.ht-photo-wall__header {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--s);
	margin-bottom: var(--wp--preset--spacing--m);
}

.ht-photo-wall__label {
	padding: var(--wp--preset--spacing--xxs) var(--wp--preset--spacing--s);
	color: var(--wp--preset--color--green-dark);
	background-color: var(--wp--preset--color--green-highlight);
	font-family: var(--headings-font);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1;
	border-radius: 0.25rem;
}

.ht-photo-wall__title {
	margin: 0;
	font-family: var(--headings-font);
	font-size: var(--wp--preset--font-size--h-3);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.01em;
	color: var(--wp--preset--color--green-dark);
}

.ht-photo-wall__intro {
	max-width: 40rem;
	margin: 0;
}

/* Mosaic: auto placement with dense packing reproduces the Figma pattern, which repeats every 22 photos */
.ht-photo-wall__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-auto-rows: var(--_row);
	grid-auto-flow: row dense;
	gap: var(--wp--preset--spacing--xxs);
	margin: 0;
	padding: 0;
	list-style: none;
}

.ht-photo-wall__item {
	min-width: 0;
	margin: 0;
}

.ht-photo-wall__item:nth-child(22n + 1),
.ht-photo-wall__item:nth-child(22n + 9) {
	grid-column: span 2;
	grid-row: span 2;
}

.ht-photo-wall__item:nth-child(22n + 5),
.ht-photo-wall__item:nth-child(22n + 13),
.ht-photo-wall__item:nth-child(22n + 18) {
	grid-column: span 2;
}

.ht-photo-wall__item:nth-child(22n + 19) {
	grid-row: span 2;
}

.ht-photo-wall__tile {
	position: relative;
	display: block;
	height: 100%;
	overflow: hidden;
	background-color: var(--wp--preset--color--green-dark-10);
	border-radius: var(--ht-radius--s);
}

.ht-photo-wall__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 500ms ease;
}

/* Hover overlay: green gradient + yellow zoom badge */
a.ht-photo-wall__tile::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, color-mix(in srgb, var(--wp--preset--color--green-dark) 55%, transparent), transparent 50%);
	opacity: 0;
	transition: opacity 300ms ease;
	pointer-events: none;
}

.ht-photo-wall__zoom {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	color: var(--wp--preset--color--green-dark);
	background-color: var(--wp--preset--color--primary);
	border-radius: 50%;
	box-shadow: 0 4px 8px rgb(0 0 0 / 12%);
	opacity: 0;
	transition: opacity 300ms ease;
}

a.ht-photo-wall__tile:hover .ht-photo-wall__image,
a.ht-photo-wall__tile:focus-visible .ht-photo-wall__image {
	transform: scale(1.05);
}

a.ht-photo-wall__tile:hover::after,
a.ht-photo-wall__tile:focus-visible::after,
a.ht-photo-wall__tile:hover .ht-photo-wall__zoom,
a.ht-photo-wall__tile:focus-visible .ht-photo-wall__zoom {
	opacity: 1;
}

a.ht-photo-wall__tile:focus-visible {
	outline: 2px solid var(--wp--preset--color--green-dark);
	outline-offset: 2px;
}

/* Lightbox */
.ht-photo-wall__lightbox {
	width: 100%;
	max-width: 100%;
	height: 100%;
	max-height: 100%;
	margin: 0;
	padding: var(--wp--preset--spacing--l) var(--wp--preset--spacing--xs);
	color: var(--wp--preset--color--mono-white);
	background: transparent;
	border: 0;
}

.ht-photo-wall__lightbox::backdrop {
	background-color: color-mix(in srgb, var(--wp--preset--color--green-dark) 92%, transparent);
}

.ht-photo-wall__lightbox[open] {
	display: grid;
	place-items: center;
}

.ht-photo-wall__lightbox-figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--wp--preset--spacing--xs);
	width: 100%;
	height: 100%;
	margin: 0;
}

.ht-photo-wall__lightbox-image {
	display: block;
	max-width: 100%;
	max-height: calc(100% - 3rem);
	object-fit: contain;
	border-radius: var(--ht-radius--s);
}


.ht-photo-wall__lightbox-button {
	position: fixed;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: var(--wp--preset--color--green-dark);
	background-color: var(--wp--preset--color--primary);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.ht-photo-wall__lightbox-button:focus-visible {
	outline: 2px solid var(--wp--preset--color--mono-white);
	outline-offset: 2px;
}

.ht-photo-wall__lightbox-button--close {
	top: var(--wp--preset--spacing--xs);
	right: var(--wp--preset--spacing--xs);
}

.ht-photo-wall__lightbox-button--prev,
.ht-photo-wall__lightbox-button--next {
	bottom: var(--wp--preset--spacing--xs);
}

.ht-photo-wall__lightbox-button--prev {
	left: var(--wp--preset--spacing--xs);
}

.ht-photo-wall__lightbox-button--next {
	right: var(--wp--preset--spacing--xs);
}

.ht-photo-wall__lightbox--single .ht-photo-wall__lightbox-button--prev,
.ht-photo-wall__lightbox--single .ht-photo-wall__lightbox-button--next {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.ht-photo-wall__image,
	a.ht-photo-wall__tile::after,
	.ht-photo-wall__zoom {
		transition: none;
	}

	a.ht-photo-wall__tile:hover .ht-photo-wall__image,
	a.ht-photo-wall__tile:focus-visible .ht-photo-wall__image {
		transform: none;
	}
}

@media (min-width: 1100px) {
	.ht-photo-wall {
		--_row: 220px;
		padding-block: var(--wp--preset--spacing--xxl);
	}

	.ht-photo-wall__title {
		font-size: var(--wp--preset--font-size--h-1);
		line-height: 0.95;
	}

	.ht-photo-wall__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.ht-photo-wall__lightbox {
		padding: var(--wp--preset--spacing--l) var(--wp--preset--spacing--xxl);
	}

	.ht-photo-wall__lightbox-button--prev,
	.ht-photo-wall__lightbox-button--next {
		top: 50%;
		bottom: auto;
		transform: translateY(-50%);
	}

	.ht-photo-wall__lightbox-button--prev {
		left: var(--wp--preset--spacing--m);
	}

	.ht-photo-wall__lightbox-button--next {
		right: var(--wp--preset--spacing--m);
	}
}
