.gallery {
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  gap: clamp(10px, 3cqw, 30px);
}
.gallery__item {
  min-height: clamp(10em, 15vw, 298px);
  position: relative;
  border-radius: var(--border-radius);
  box-shadow: none;
  overflow: hidden;
}
.gallery__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: var(--color-primary);
  z-index: 2;
  opacity: 0;
  transition: var(--transition);
}
.gallery__item:hover::before {
  opacity: 0.25;
}
.gallery__item:nth-child(8n+1) {
  grid-column: span 3;
}
.gallery__item:nth-child(8n+2) {
  grid-column: span 5;
}
.gallery__item:nth-child(8n+3) {
  grid-column: span 4;
}
.gallery__item:nth-child(8n+4) {
  grid-column: span 6;
}
.gallery__item:nth-child(8n+5) {
  grid-column: span 4;
}
.gallery__item:nth-child(8n+6) {
  grid-column: span 3;
}
.gallery__item:nth-child(8n+7) {
  grid-column: span 6;
}
.gallery__item:nth-child(8n+8) {
  grid-column: span 5;
}
.gallery__item--hidden {
  display: none;
}
.gallery__item img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.gallery__more {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-20);
  color: var(--color-white);
  z-index: 2;
  text-align: center;
  padding: 1em;
  font-family: var(--font-heading);
  font-weight: var(--font-weight-regular);
  font-optical-sizing: auto;
  letter-spacing: var(--letter-spacing);
}
.gallery__more::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.15));
  z-index: 1;
}
.gallery__more span {
  z-index: 2;
  position: relative;
}
@media screen and (max-width: 860px) {
  .gallery__item:nth-child(8n+1) {
    grid-column: span 6;
  }
  .gallery__item:nth-child(8n+2) {
    grid-column: span 12;
  }
  .gallery__item:nth-child(8n+3) {
    grid-column: span 9;
  }
  .gallery__item:nth-child(8n+4) {
    grid-column: span 9;
  }
  .gallery__item:nth-child(8n+5) {
    grid-column: span 12;
  }
  .gallery__item:nth-child(8n+6) {
    grid-column: span 6;
  }
  .gallery__item:nth-child(8n+7) {
    grid-column: span 10;
  }
  .gallery__item:nth-child(8n+8) {
    grid-column: span 8;
  }
}