/* ==========================================================
   Gallery — photo mosaic (lightbox styles are in base.css)
   ========================================================== */

.gallery-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: clamp(180px, 22vw, 280px);
  gap: clamp(.75rem, 1.5vw, 1.1rem);
}
.gallery-grid .g-wide { grid-column: span 2; }
.gallery-grid .g-tall { grid-row: span 2; }

.g-tile {
  position: relative; display: block; height: 100%; overflow: hidden;
  border-radius: var(--radius); background: var(--ink-3);
}
.g-tile img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s cubic-bezier(.2,.7,.2,1), filter .4s;
}
.g-tile::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(14,11,9,.85) 0%, rgba(14,11,9,0) 45%);
  box-shadow: inset 0 0 0 1px rgba(242,138,30,0); border-radius: inherit;
  transition: box-shadow .3s;
}
.g-tile:hover img, .g-tile:focus-visible img { transform: scale(1.05); }
.g-tile:hover::after, .g-tile:focus-visible::after { box-shadow: inset 0 0 0 2px rgba(242,138,30,.8); }
.g-cap {
  position: absolute; left: 1rem; right: 1rem; bottom: .9rem; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  font-family: var(--display); font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  font-size: .85rem; color: #fff;
}
.g-cap .icon { width: 18px; height: 18px; color: var(--orange); opacity: .85; }

@media (max-width: 760px) {
  .gallery-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: clamp(150px, 38vw, 240px); }
  .gallery-grid .g-wide { grid-column: 1 / -1; }
  /* .g-tall-md: tall on tablets only, so an odd group of photos still fills its rows */
  .gallery-grid .g-tall-md { grid-row: span 2; }
}
@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .gallery-grid .g-wide, .gallery-grid .g-tall, .gallery-grid .g-tall-md { grid-column: auto; grid-row: auto; }
  .g-tile { aspect-ratio: 4 / 3; }
  .g-tall .g-tile, .g-tall-md .g-tile { aspect-ratio: 4 / 5; }
  .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
}
