.impact-gallery {
	--impact-gallery-ink: #17352a;
	--impact-gallery-muted: #52665c;
	--impact-gallery-green: #0a7d55;
	--impact-gallery-line: #dce8e1;
	color: var(--impact-gallery-ink);
	margin: 1.5rem auto;
	max-width: 1200px;
}

.impact-gallery__list {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
}

.impact-gallery__album {
	align-self: start;
	background: #fff;
	border: 1px solid var(--impact-gallery-line);
	border-radius: 16px;
	box-shadow: 0 1px 2px rgb(16 37 28 / 6%);
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.impact-gallery__album:hover {
	box-shadow: 0 14px 30px -18px rgb(16 37 28 / 45%);
}

.impact-gallery__album[open] {
	grid-column: 1 / -1;
}

/* A full-width open album shows its cover as a slim banner, not a giant photo. */
.impact-gallery__album[open] .impact-gallery__cover-image {
	aspect-ratio: 21 / 7;
	max-height: 320px;
}

.impact-gallery__summary {
	cursor: pointer;
	display: block;
	list-style: none;
}

.impact-gallery__summary::-webkit-details-marker {
	display: none;
}

.impact-gallery__summary:focus-visible {
	outline: 3px solid var(--impact-gallery-green);
	outline-offset: -3px;
}

.impact-gallery__cover {
	display: block;
	overflow: hidden;
	position: relative;
	width: 100%;
}

.impact-gallery__cover-image {
	display: block;
	transition: transform 0.45s ease;
	width: 100%;
}

.impact-gallery__summary:hover .impact-gallery__cover-image {
	transform: scale(1.04);
}

.impact-gallery__badge {
	background: rgb(16 37 28 / 78%);
	border-radius: 999px;
	bottom: 0.7rem;
	color: #fff;
	font-size: 0.78rem;
	font-weight: 700;
	left: 0.7rem;
	letter-spacing: 0.02em;
	padding: 0.28rem 0.7rem;
	position: absolute;
}

.impact-gallery__cover-image {
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.impact-gallery__summary-copy {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	padding: 1.1rem 1.2rem 1.25rem;
}

.impact-gallery__title {
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.25;
	margin: 0;
}

.impact-gallery__intro,
.impact-gallery__section p {
	color: var(--impact-gallery-muted);
}

.impact-gallery__intro {
	font-size: 0.95rem;
	line-height: 1.55;
}

.impact-gallery__open {
	color: var(--impact-gallery-green);
	font-size: 0.9rem;
	font-weight: 700;
	margin-top: 0.2rem;
}

.impact-gallery__album[open] .impact-gallery__open {
	display: none;
}

.impact-gallery__story {
	border-top: 1px solid var(--impact-gallery-line);
	padding: 1.1rem 1.2rem 1.3rem;
}

.impact-gallery__section + .impact-gallery__section {
	margin-top: 1rem;
}

.impact-gallery__section h4 {
	font-size: 1rem;
	margin: 0 0 0.3rem;
}

.impact-gallery__section p {
	font-size: 0.95rem;
	line-height: 1.6;
	margin: 0.35rem 0 0;
}

.impact-gallery__viewer {
	margin-top: 1.25rem;
}

.impact-gallery__story + .impact-gallery__viewer,
.impact-gallery__viewer:first-child {
	margin-top: 0;
}

.impact-gallery__count {
	align-items: baseline;
	color: var(--impact-gallery-ink);
	display: flex;
	flex-wrap: wrap;
	font-size: 0.95rem;
	font-weight: 700;
	gap: 0.6rem;
	margin: 0 0 0.75rem;
}

.impact-gallery__count span {
	color: var(--impact-gallery-muted);
	font-size: 0.85rem;
	font-weight: 400;
}

.impact-gallery__thumbnails {
	display: grid;
	gap: 0.6rem;
	grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
}

.impact-gallery__thumbnails > .impact-gallery__thumbnail {
	appearance: none;
	aspect-ratio: 1;
	background: #eef3f0;
	border: 0;
	border-radius: 10px;
	box-shadow: none;
	box-sizing: border-box;
	cursor: zoom-in;
	display: block;
	line-height: 0;
	min-width: 0;
	overflow: hidden;
	padding: 0;
	position: relative;
	width: 100%;
}

.impact-gallery__thumbnails > .impact-gallery__thumbnail::after {
	background: linear-gradient(to top, rgb(16 37 28 / 45%), transparent 55%);
	content: "";
	inset: 0;
	opacity: 0;
	position: absolute;
	transition: opacity 0.2s ease;
}

.impact-gallery__thumbnails > .impact-gallery__thumbnail:hover::after,
.impact-gallery__thumbnails > .impact-gallery__thumbnail:focus-visible::after {
	opacity: 1;
}

.impact-gallery__thumbnail img {
	display: block;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.35s ease;
	width: 100%;
}

.impact-gallery__thumbnail:hover img {
	transform: scale(1.07);
}

.impact-gallery__thumbnails > .impact-gallery__thumbnail:focus-visible {
	outline: 3px solid var(--impact-gallery-green);
	outline-offset: 2px;
}

/* ---- Photo viewer overlay (built by gallery.js) ---- */

html.impact-lightbox-open {
	overflow: hidden;
}

dialog.impact-lightbox {
	background: rgb(8 20 15 / 96%);
	border: 0;
	box-sizing: border-box;
	color: #fff;
	display: none;
	flex-direction: column;
	height: 100vh;
	height: 100dvh;
	margin: 0;
	max-height: none;
	max-width: none;
	padding: 0;
	width: 100vw;
}

dialog.impact-lightbox[open] {
	display: flex;
}

dialog.impact-lightbox::backdrop {
	background: rgb(8 20 15 / 96%);
}

.impact-lightbox__top {
	align-items: center;
	display: flex;
	flex: 0 0 auto;
	justify-content: space-between;
	padding: 0.75rem 1rem;
}

.impact-lightbox__counter {
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	opacity: 0.85;
}

.impact-lightbox__stage {
	align-items: center;
	display: flex;
	flex: 1 1 auto;
	justify-content: center;
	min-height: 0;
	position: relative;
	touch-action: pan-y;
}

.impact-lightbox__image {
	border-radius: 6px;
	box-shadow: 0 20px 50px -20px rgb(0 0 0 / 70%);
	display: block;
	max-height: 100%;
	max-width: min(100%, 1400px);
	object-fit: contain;
	opacity: 1;
	transition: opacity 0.2s ease;
	user-select: none;
	width: auto;
}

dialog.impact-lightbox.is-loading .impact-lightbox__image {
	opacity: 0.25;
}

.impact-lightbox__caption {
	color: #e8f1ec;
	flex: 0 0 auto;
	font-size: 0.95rem;
	line-height: 1.5;
	margin: 0;
	padding: 0.85rem 1.25rem 1.25rem;
	text-align: center;
}

.impact-lightbox__caption[hidden] {
	display: none;
}

dialog.impact-lightbox .impact-lightbox__btn,
dialog.impact-lightbox .impact-lightbox__btn:hover,
dialog.impact-lightbox .impact-lightbox__btn:focus,
dialog.impact-lightbox .impact-lightbox__btn:active {
	align-items: center;
	appearance: none;
	background: rgb(255 255 255 / 12%);
	border: 1px solid rgb(255 255 255 / 25%);
	border-radius: 50%;
	box-shadow: none;
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	height: 46px;
	justify-content: center;
	padding: 0;
	text-shadow: none;
	transition: background 0.15s ease, border-color 0.15s ease;
	width: 46px;
}

dialog.impact-lightbox .impact-lightbox__btn:hover,
dialog.impact-lightbox .impact-lightbox__btn:focus-visible {
	background: var(--impact-gallery-green);
	border-color: var(--impact-gallery-green);
}

dialog.impact-lightbox .impact-lightbox__btn:focus-visible {
	outline: 3px solid #f4c542;
	outline-offset: 2px;
}

dialog.impact-lightbox .impact-lightbox__btn[hidden] {
	display: none;
}

.impact-lightbox__btn svg {
	fill: none;
	height: 22px;
	stroke: currentcolor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2.4;
	width: 22px;
}

dialog.impact-lightbox .impact-lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
}

.impact-lightbox__nav--prev {
	left: 1rem;
}

.impact-lightbox__nav--next {
	right: 1rem;
}

@media (max-width: 600px) {
	.impact-gallery__thumbnails {
		gap: 0.4rem;
		grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
	}

	dialog.impact-lightbox .impact-lightbox__btn {
		height: 42px;
		width: 42px;
	}

	.impact-lightbox__nav--prev {
		left: 0.4rem;
	}

	.impact-lightbox__nav--next {
		right: 0.4rem;
	}

	.impact-lightbox__image {
		border-radius: 0;
		max-width: 100%;
	}
}

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