/* image grid. set --ratio on the .gallery to change the tile shape, e.g. style="--ratio: 1" */

.gallery {
  --ratio: 4 / 3;

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(14rem, 100%), 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery figure {
  margin: 0;
}

.gallery img,
.gallery-placeholder {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--ratio);
  object-fit: cover;
  background: #111;
}

.gallery figcaption {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: var(--dim, rgba(255, 255, 255, 0.55));
}

/* stand-in tile until a real image is added */
.gallery-placeholder {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line, rgba(255, 255, 255, 0.18));
  background: none;
  color: var(--dim, rgba(255, 255, 255, 0.55));
  font-size: 0.9rem;
}

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