/* Gallery page (/gallery/). Linked only from the gallery page.
   The compact banner and the closing CTA band live in style.css (shared with /testimonials/). */

/* ---------- Gallery grid ----------
   Rows of mixed-width tiles on a 12-column grid, each tile a photo with a caption
   over a soft bottom fade. Hovering (or keyboard focus) lifts the tile. */
.gal { background: #fff; padding: 17px 0 120px; }
.gal__inner { width: 86%; max-width: 1240px; margin: 0 auto; }
.gal__note {
  margin: 0 0 22px;
  font-family: "Open Sans", sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.7em;
  color: #666;
}
.gal__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 300px;
  gap: 18px;
}
.gal__item { grid-column: span 4; }
.gal__item--3 { grid-column: span 3; }
.gal__item--5 { grid-column: span 5; }
.gal__item--7 { grid-column: span 7; }

.gal__tile {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  cursor: zoom-in;
  background: #191919;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08), 0 8px 18px rgba(0, 0, 0, .06);
  transition: transform .3s ease, box-shadow .3s ease;
}
.gal__tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
/* caption fade, as in the reference layout */
.gal__tile::after {
  content: "";
  position: absolute;
  inset: 45% 0 0 0;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0) 0%, rgba(10, 10, 10, .72) 100%);
  pointer-events: none;
}
.gal__cap {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  z-index: 1;
  font-family: "Jost", sans-serif;
  font-weight: 500;
  font-size: 17px;
  line-height: 1.25em;
  color: #fff;
  text-align: left;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.gal__tile:hover,
.gal__tile:focus-visible {
  transform: translateY(-8px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, .12), 0 22px 40px rgba(0, 0, 0, .18);
}
.gal__tile:hover img,
.gal__tile:focus-visible img { transform: scale(1.04); }
.gal__tile:focus-visible { outline: 3px solid #f60000; outline-offset: 3px; }

/* ---------- Lightbox ---------- */
.gal-lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, .9);
}
.gal-lightbox::backdrop { background: rgba(0, 0, 0, .9); }
.gal-lightbox[open] { display: flex; align-items: center; justify-content: center; }
.gal-lightbox__fig { margin: 0; max-width: 90vw; text-align: center; }
.gal-lightbox__img { display: block; max-width: 90vw; max-height: 82vh; margin: 0 auto; object-fit: contain; }
.gal-lightbox__cap {
  margin-top: 14px;
  font-family: "Jost", sans-serif;
  font-size: 18px;
  color: #fff;
}
.gal-lightbox__btn {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 52px;
  cursor: pointer;
  transition: background .2s;
}
.gal-lightbox__btn:hover,
.gal-lightbox__btn:focus-visible { background: #f60000; outline: none; }
.gal-lightbox__close { top: 20px; right: 20px; }
.gal-lightbox__prev { left: 20px; top: 50%; transform: translateY(-50%); }
.gal-lightbox__next { right: 20px; top: 50%; transform: translateY(-50%); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .gal__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 260px; gap: 16px; }
  .gal__item, .gal__item--3, .gal__item--5, .gal__item--7 { grid-column: span 1; }
  .gal { padding-bottom: 80px; }
}
@media (max-width: 600px) {
  .gal__grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 240px; }
  .gal-lightbox__prev, .gal-lightbox__next { top: auto; bottom: 20px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .gal__tile, .gal__tile img { transition: none; }
  .gal__tile:hover, .gal__tile:focus-visible { transform: none; }
  .gal__tile:hover img, .gal__tile:focus-visible img { transform: none; }
}
