/* Keep outdoor photos and captions aligned when neighbouring cards wrap differently. */
#gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 19px;
}

#gallery > .media-card {
  flex: 0 0 calc((100% - 38px) / 3);
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}

#gallery .card-image {
  flex: 0 0 auto;
  width: 100%;
}

#gallery .card-caption {
  flex: 1 0 auto;
  width: 100%;
  align-items: flex-start;
}

#gallery .card-caption > div {
  min-width: 0;
  overflow-wrap: break-word;
}

#gallery .card-caption strong {
  display: block;
}

@media (max-width: 700px) {
  #gallery { gap: 12px; }
  #gallery > .media-card { flex-basis: calc((100% - 12px) / 2); }
  /* Reserve two title lines so descriptions align even when a name wraps. */
  #gallery .card-caption strong { min-height: 2.9em; }
}
