/* Photoreport archive — scoped styles, mobile-first. */

.photoreport-gallery {
	--pr-gap: clamp(0.5rem, 1.2vw, 0.875rem);
	--pr-radius: 12px;
	--pr-accent: var(--nectar-accent-color, #b87333);
	--pr-ink: #0f172a;
	--pr-muted: #475569;
	--pr-ease: cubic-bezier(0.2, 0.8, 0.2, 1);

	width: min(100% - 2rem, 78rem);
	margin-inline: auto;
	padding-block: clamp(1rem, 2.5vw, 2rem);
}

.photoreport-lede {
	max-width: 65ch;
	margin-block: 0 0.75rem;
	color: var(--pr-muted, #475569);
}

.photoreport-back {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-weight: 600;
	text-underline-offset: 0.2em;
}

.photoreport-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--pr-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.photoreport-grid > li,
.photoreport-menu__grid > li {
	list-style: none;
}

@media (min-width: 640px) {
	.photoreport-grid {
		grid-template-columns: repeat(var(--pr-columns-tablet, 3), minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.photoreport-grid {
		grid-template-columns: repeat(var(--pr-columns, 4), minmax(0, 1fr));
	}
}

.photoreport-item a {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 3 / 2;
	border-radius: var(--pr-radius);
	background: #eef2f7;
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}

.photoreport-item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 400ms var(--pr-ease);
}

.photoreport-item a::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgb(15 23 42 / 0.45), rgb(15 23 42 / 0) 55%);
	opacity: 0;
	transition: opacity 220ms var(--pr-ease);
}

@media (hover: hover) and (pointer: fine) {
	.photoreport-item a:hover img {
		transform: scale(1.035);
	}

	.photoreport-item a:hover::after {
		opacity: 1;
	}
}

.photoreport-item a:focus-visible {
	outline: 3px solid var(--pr-accent);
	outline-offset: 3px;
}

/* Shared photo viewer */
.photoreport-lightbox {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: grid;
	place-items: center;
	padding: clamp(1rem, 4vw, 2.5rem);
	background: #080a10;
}

.photoreport-lightbox[hidden] {
	display: none;
}

html.photoreport-lightbox-open,
html.photoreport-lightbox-open body {
	overflow: hidden;
}

.photoreport-lightbox__backdrop {
	position: absolute;
	inset: 0;
}

.photoreport-lightbox__dialog {
	position: relative;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: clamp(0.5rem, 2vw, 1.5rem);
	width: min(100%, 72rem);
	max-height: 100%;
}

.photoreport-lightbox__figure {
	display: grid;
	place-items: center;
	gap: 0.75rem;
	min-width: 0;
	margin: 0;
}

.photoreport-lightbox__figure img {
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: calc(100vh - 10rem);
	max-height: calc(100dvh - 10rem);
	border-radius: 6px;
	background: #111;
	object-fit: contain;
}

.photoreport-lightbox__counter {
	color: #e2e8f0;
	font-size: 0.875rem;
	letter-spacing: 0.02em;
}

.photoreport-lightbox__close {
	position: absolute;
	top: -0.25rem;
	right: 0;
	z-index: 1;
}

.photoreport-lightbox button {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgb(255 255 255 / 0.28);
	border-radius: 999px;
	background: rgb(255 255 255 / 0.08);
	color: #fff;
	cursor: pointer;
	transition: background-color 180ms ease, border-color 180ms ease;
}

.photoreport-lightbox button:hover {
	border-color: rgb(255 255 255 / 0.55);
	background: rgb(255 255 255 / 0.18);
}

.photoreport-lightbox button:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

@media (max-width: 639px) {
	.photoreport-lightbox__dialog {
		grid-template-columns: 1fr;
	}

	.photoreport-lightbox__nav {
		position: absolute;
		bottom: -3.25rem;
	}

	.photoreport-lightbox__prev {
		left: 0;
	}

	.photoreport-lightbox__next {
		right: 0;
	}

	.photoreport-lightbox__figure img {
		max-height: calc(100vh - 11rem);
		max-height: calc(100dvh - 11rem);
	}
}

/* Archive menu rendered from the "Photo Archive Menu" content block */
.photoreport-menu {
	width: min(100% - 2rem, 78rem);
	margin-inline: auto;
	padding-block: clamp(1.5rem, 4vw, 3rem);
}

.photoreport-menu__title {
	margin: 0 0 0.35rem;
	font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
	line-height: 1.2;
}

.photoreport-menu__lede {
	max-width: 60ch;
	margin: 0 0 1.25rem;
	color: #475569;
}

.photoreport-menu__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.photoreport-menu__link:link,
.photoreport-menu__link:visited {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0.7rem 1rem;
	border-radius: 8px;
	background: #a65f1f;
	background: color-mix(in srgb, var(--nectar-accent-color, #b87333) 86%, #1a1208);
	color: #fff;
	font-weight: 600;
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
	transition: background-color 180ms ease, transform 180ms ease;
}

@media (hover: hover) and (pointer: fine) {
	.photoreport-menu__link:hover {
		background: #8a4c15;
		background: color-mix(in srgb, var(--nectar-accent-color, #b87333) 74%, #1a1208);
		color: #fff;
		transform: translateY(-1px);
	}
}

.photoreport-menu__link:focus-visible {
	outline: 3px solid #1f2937;
	outline-offset: 2px;
}

.photoreport-menu__link[aria-current="page"] {
	background: #1f2937;
	box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.35);
}

.photoreport-menu__more {
	margin: 1rem 0 0;
	font-size: 0.95rem;
}

@media (prefers-reduced-motion: reduce) {
	.photoreport-item img,
	.photoreport-item a::after,
	.photoreport-lightbox button,
	.photoreport-menu__link {
		transition: none;
	}
}
