/*
 * Gallery page (page-gallery.php): filters, fixed-size tiles, and the lightbox.
 * The hero reuses services-index.css.
 */

/* ---------- Filters ---------- */

.gallery-filters {
	position: sticky;
	top: var(--header-h, 0px);
	z-index: 80;
	background: var(--surface);
	border-top: 1px solid var(--rule);
	border-bottom: 1px solid var(--rule);
	padding: 14px var(--gutter);
}
.gallery-filters-inner { max-width: var(--max-w); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; }

.gallery-filter { display: flex; flex-direction: column; gap: 6px; }
.gallery-filter select {
	min-width: 180px;
	border: 1px solid var(--ink);
	border-radius: 0;
	background: transparent;
	padding: 9px 36px 9px 12px;
	font-family: var(--sans);
	font-size: var(--fs-small);
	color: var(--ink);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
	background-size: 6px 6px;
	background-repeat: no-repeat;
}

.gallery-reset {
	font-family: var(--ui);
	font-size: var(--fs-button);
	font-weight: var(--menu-weight);
	letter-spacing: var(--label-tracking);
	text-transform: uppercase;
	color: var(--link);
	text-decoration: underline;
	text-underline-offset: 3px;
	padding: 10px 0;
}
.gallery-count { margin-left: auto; font-size: var(--fs-small); color: var(--ink-soft); padding: 10px 0; }


/* ---------- Tiles: a fixed 240px width each, whatever the screen ---------- */

.gallery-tiles {
	max-width: var(--max-w);
	margin: 0 auto;
	padding: clamp(32px, 4vw, 56px) var(--gutter);
	display: flex;
	flex-wrap: wrap;
	gap: 28px 24px;
}

.gallery-tile { width: 240px; text-align: left; transition: transform .3s ease; cursor: pointer; }
.gallery-tile:hover { transform: translateY(-3px); }
.gallery-tile[hidden] { display: none; }

.gallery-tile-image { display: block; width: 240px; height: 300px; overflow: hidden; border: 1px solid var(--rule); background: var(--surface-warm); transition: border-color .3s ease; }
.gallery-tile:hover .gallery-tile-image { border-color: var(--gold); }
.gallery-tile-image img { width: 100%; height: 100%; object-fit: cover; }

.gallery-tile-title { display: block; margin-top: 12px; font-family: var(--serif); font-size: var(--fs-h4); line-height: 1.2; }
.gallery-tile-caption { display: block; margin-top: 4px; font-size: var(--fs-small); color: var(--ink-soft); }

.gallery-empty { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter) var(--section-pad); font-size: var(--fs-body); color: var(--ink-soft); }
.gallery-empty .text-link { font: inherit; }


/* ---------- Lightbox ---------- */

.modal.lightbox { max-width: 1100px; padding: clamp(24px, 3vw, 40px); display: grid; grid-template-columns: 1fr 320px; gap: clamp(20px, 3vw, 40px); align-items: center; }
/* The photo area holds the arrows, so they always sit inside the box. */
.lightbox-stage { position: relative; padding: 0 56px; }
.lightbox-images { display: flex; gap: 12px; justify-content: center; }
.lightbox-images img { max-height: 70vh; max-width: 100%; height: auto; object-fit: contain; border: 1px solid var(--rule); }
.lightbox-images.pair img { max-width: calc(50% - 6px); }
.lightbox-text h2 { font-size: var(--fs-h3); margin-bottom: 8px; }
.lightbox-text p { font-size: var(--fs-body); color: var(--ink-soft); margin-bottom: 22px; }
.lightbox-text .btn-row { flex-direction: column; align-items: stretch; }

.lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--gold-surface);
	border: 1px solid var(--gold-surface);
	z-index: 2;
}
.lightbox-nav::before { content: ''; position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; border-left: 2px solid var(--on-gold); border-bottom: 2px solid var(--on-gold); transform: translate(-40%, -50%) rotate(45deg); }
.lightbox-nav.next::before { transform: translate(-60%, -50%) rotate(-135deg); }
.lightbox-nav.prev { left: 0; }
.lightbox-nav.next { right: 0; }
.lightbox-nav:hover { background: var(--ink); border-color: var(--ink); }
.lightbox-nav:hover::before { border-color: var(--paper); }


/* ---------- Smaller screens ---------- */

@media (max-width: 900px) {
	.gallery-filter select { min-width: 150px; }
	.gallery-count { margin-left: 0; }
	.modal.lightbox { grid-template-columns: 1fr; }
	.lightbox-stage { padding: 0 48px; }
	.lightbox-images img { max-height: 50vh; }
}

@media (max-width: 560px) {
	.gallery-filters-inner { gap: 10px 14px; }
	.gallery-filter { flex: 1 1 45%; }
	.gallery-filter select { min-width: 0; width: 100%; }
	.gallery-tiles { justify-content: center; }
}
