/* =============================================================================
   PHOTO GRID - rows of photos that fill the full width (home page "Markets Served")
   js/gallery.js works out the rows; each photo keeps its shape.
   ============================================================================= */

.photo-grid {
  position: relative;
  overflow: hidden;
}

.photo-grid__item {
  position: absolute;          /* js/gallery.js sets left / top / width / height */
  margin: 0;
  overflow: hidden;
  background-color: var(--off-white);
}

.photo-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

/* the photo zooms in a little when the mouse is over it */
.photo-grid__item:hover img { transform: scale(1.1); }

/* the title in the middle of each photo */
.photo-grid__item figcaption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  font-family: var(--font-heading);
  font-size: 32px;
  line-height: 1.3;
  color: var(--white);
  text-align: center;
  pointer-events: none;
}

/* before js/gallery.js has run (or without JavaScript): a simple grid */
.photo-grid:not(.is-ready) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.photo-grid:not(.is-ready) .photo-grid__item { position: relative; aspect-ratio: 3 / 2; }
