/**
 * Section: Gallery
 * Ported from .docs/mockup/about.html lines 154–172 and
 * .docs/mockup/css/about.css lines 209–244 (Example setups gallery block),
 * plus the .gallery-grid rule from the shared responsive block near the end
 * of about.css (900px and 560px breakpoints).
 *
 * Tokens only. The mockup's one hardcoded colour (#fff on the caption text)
 * maps to the --white token defined in tokens.css for exactly this case —
 * pure white, distinct from --off-white, used for text/surfaces on dark or
 * photo backgrounds. The caption gradient's rgba stop is copied verbatim, as
 * the contract allows for overlays that appear that way in the mockup.
 *
 * Mechanism note: gallery.php renders each tile as a real <img> rather than
 * the mockup's background-image, so .gallery-tile owns the aspect-ratio box
 * and the <img> fills it with object-fit: cover. See gallery.php's header
 * comment for why. The rounded corner, hover lift and gradient caption below
 * are otherwise a direct port of the mockup's values.
 */

.gallery {
  padding-block: var(--section-space-m);
  padding-inline: var(--space-gutter);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-s);
}

.gallery-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--duration-normal) var(--ease-out);
}

.gallery-tile:hover {
  transform: translateY(-4px);
}

.gallery-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.gallery-tile .cap {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  width: 100%;
  padding: var(--space-m) var(--space-s) var(--space-s);
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(transparent, rgba(20, 40, 50, 0.72));
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}
