main {
  max-width: 80%;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.image-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-link);
  border-radius: 12px;
  overflow: hidden;
  background: var(--background);
}

.image-card:hover {
  border-color: var(--border-link-hover);
}

/* The whole thumbnail is the link out to the full sized original, so it gets
   none of the usual underline an inline link would */
.image-card a {
  display: block;
  border-bottom: none;
  line-height: 0;
}

.image-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.image-card .caption {
  padding: 0.9rem 1.1rem;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--footer);
}

@media (max-width: 600px) {
  main {
    max-width: 92%;
  }

  .gallery {
    grid-template-columns: 1fr;
  }
}
