.gallery-section {
  --gallery-name-bg: var(--transparent-400);
}

.gallery-section .container {
  row-gap: 2rem;
}

.gallery-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 1rem;
}

.gallery-item {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gallery-image {
  aspect-ratio: 1;
  object-fit: cover;
  height: 16rem;

  @media (width >= 56.25rem) {
    height: auto;
  }
}

.gallery-link {
  display: flex;
  justify-content: center;
  align-items: center;
}

.gallery-link span {
  background-color: var(--gallery-name-bg);
  transition: opacity 0.3s;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  height: 100%;
  width: 100%;
  opacity: 0;
}

.gallery-link:focus-visible span,
.gallery-link:hover span {
  opacity: 1;
}

.gallery-button {
  justify-self: center;
}