/* Homepage photo collection and full-size viewer. */

.home-gallery {
	padding-block: clamp(52px, 7vw, 104px);
	border-top: 1px solid var(--border);
}

.home-gallery-heading {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 12px 28px;
	margin-bottom: 24px;
}

.home-gallery-heading h2 {
	margin: 0;
	font-size: clamp(34px, 4.8vw, 62px);
	line-height: 1.1;
}

.home-gallery-heading p {
	margin: 12px 0 0;
	color: var(--muted-strong);
	font-size: 15px;
	line-height: 1.65;
}

.home-gallery-heading .text-link {
	flex-shrink: 0;
}

.home-gallery-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: clamp(18px, 2.5vw, 32px);
}

.home-gallery-filters[hidden] {
	display: none;
}

.home-gallery-filters button {
	min-height: 44px;
	padding: 6px 16px;
	border: 1px solid rgb(24 36 30 / 24%);
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--green-deep);
	font: 600 13px var(--sans);
	cursor: pointer;
}

.home-gallery-filters button:hover {
	border-color: var(--green-deep);
}

.home-gallery-filters button[aria-pressed="true"] {
	border-color: var(--green-deep);
	background: var(--green-deep);
	color: var(--white);
}

.home-gallery [data-gallery-status] {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.home-gallery-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(18px, 2.5vw, 34px) clamp(16px, 2vw, 28px);
}

.home-gallery-card {
	min-width: 0;
	margin: 0;
}

.home-gallery-image-link {
	position: relative;
	display: block;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	border-radius: var(--radius-md);
	background: var(--cream-dark);
	cursor: zoom-in;
}

.home-gallery-image-link img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.home-gallery-expand {
	position: absolute;
	right: 10px;
	bottom: 10px;
	display: grid;
	width: 34px;
	height: 34px;
	place-items: center;
	border-radius: 50%;
	background: var(--green-deep);
	color: var(--white);
	font-size: 20px;
	line-height: 1;
}

.home-gallery-image-link:hover .home-gallery-expand {
	background: var(--gold-light);
	color: var(--green-deep);
}

.home-gallery-card figcaption {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding-top: 10px;
}

.home-gallery-category {
	color: var(--gold-text);
	font-size: 12px;
	font-weight: 700;
}

.home-gallery-caption {
	color: var(--green-deep);
	font-family: var(--serif);
	font-size: clamp(18px, 2vw, 26px);
	line-height: 1.25;
}

html:has(.home-gallery-dialog[open]) {
	overflow: hidden;
}

.home-gallery-dialog {
	--focus-ring: var(--gold-light);
	width: min(96vw, 1120px);
	max-width: none;
	max-height: 94dvh;
	padding: 0;
	border: 1px solid var(--border-light);
	border-radius: var(--radius-md);
	background: var(--green-deep);
	color: var(--white);
}

.home-gallery-dialog::backdrop {
	background: rgb(12 22 17 / 91%);
}

.home-gallery-viewer {
	padding: clamp(10px, 2vw, 24px);
}

.home-gallery-viewer-header,
.home-gallery-viewer-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.home-gallery-viewer-header {
	margin-bottom: 12px;
}

.home-gallery-viewer-footer {
	margin-top: 12px;
}

.home-gallery-viewer-footer p {
	margin: 0;
	font-size: 14px;
	text-align: center;
}

.home-gallery-viewer [data-gallery-position] {
	color: var(--sage);
	font-size: 13px;
}

.home-gallery-viewer button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 44px;
	min-height: 44px;
	padding-inline: 10px;
	border: 1px solid var(--border-light);
	border-radius: var(--radius-sm);
	background: var(--green-card);
	color: var(--white);
	font: 600 14px var(--sans);
	cursor: pointer;
}

.home-gallery-viewer button:hover:not(:disabled) {
	border-color: var(--gold-light);
}

.home-gallery-viewer button:disabled {
	opacity: 0.45;
	cursor: default;
}

.home-gallery-stage {
	display: grid;
	height: min(68dvh, 60vw);
	place-items: center;
	background: var(--ink);
}

.home-gallery-stage img {
	width: 100%;
	height: 100%;
	min-height: 0;
	object-fit: contain;
}

.home-gallery-stage [hidden] {
	display: none;
}

.home-gallery-stage p {
	max-width: 30ch;
	margin: 0;
	padding: 8px;
	text-align: center;
}

.home-gallery-stage a {
	text-decoration: underline;
	text-underline-offset: 4px;
}

@media (max-width: 900px) {
	.home-gallery-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.home-gallery-heading {
		align-items: start;
		flex-direction: column;
		gap: 6px;
		margin-bottom: 16px;
	}
}

@media (max-width: 480px) {
	.home-gallery-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.home-gallery-filters button {
		padding-inline: 10px;
	}
}
