/* Gallery page — masonry-style grid */

.gallery-page { background: var(--paper); }

.gallery-head { padding-block: clamp(3rem, 7vw, 5rem) clamp(1.5rem, 4vw, 2.5rem); }
.back-link { text-decoration: none; }
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.gallery-head .section-title { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem); max-width: 20ch; }
.gallery-sub { margin-top: 1rem; color: var(--ink-soft); font-size: 1.1rem; max-width: 46ch; }

.gallery { padding-bottom: clamp(3.5rem, 8vw, 6rem); }
.gallery-group { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.3rem, 1rem + 1.4vw, 1.9rem); color: var(--ink); margin: clamp(2.2rem, 5vw, 3.4rem) 0 1.2rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }
.gallery-group:first-child { margin-top: 0; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  grid-auto-flow: dense;
  gap: 1rem;
  margin-bottom: clamp(1rem, 3vw, 2rem);
}
.gallery-grid figure { margin: 0; overflow: hidden; border-radius: 12px; }
.gallery-grid a { display: block; width: 100%; height: 100%; position: relative; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1); }
.gallery-grid a::after { content: ""; position: absolute; inset: 0; background: rgba(138,18,32,0); transition: background 0.3s ease; }
.gallery-grid a:hover img { transform: scale(1.05); }
.gallery-grid a:hover::after { background: rgba(138,18,32,0.16); }
.gallery-grid a:focus-visible { outline: 3px solid var(--marigold); outline-offset: 3px; }

.g-wide { grid-column: span 2; }
.g-tall { grid-row: span 2; }

.gallery-cta { background: var(--ink); color: var(--paper); text-align: center; padding-block: clamp(4rem, 8vw, 6rem); }
.gallery-cta .section-title { font-size: clamp(2rem, 1.4rem + 3vw, 3.2rem); }
.gallery-cta-lede { margin: 1.1rem auto 2rem; color: rgba(245,238,227,0.82); font-size: 1.15rem; max-width: 40ch; }

@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 180px; }
}
@media (max-width: 620px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; gap: 0.7rem; }
  .g-wide { grid-column: span 2; }
  .g-tall { grid-row: span 2; }
}
