*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery {
  width: 85%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, 133px);
  grid-auto-rows: 200px;
  justify-content: center;
  gap: 1rem;
}

.gallery__item {
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  grid-column: span 2;
  height: 283px;
  transition: 0.5s filter;
  position: relative;
  border-left: 2px solid white;
  border-right: 2px solid white;
}

.description {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-transform: uppercase;
  text-align: center;
}

.gallery__item:hover .description {
  opacity: 1;
}



.gallery__item:first-of-type {
  grid-column: 2/span 2;
}

/*RESPONSIVE*/
@media screen and (min-width: 270px) and (max-width: 504px) {
  .gallery__item:first-of-type {
    grid-column: 1/span 2;
  }

  .gallery {
    grid-auto-rows: 283px;
  }
}

@media screen and (min-width: 505px) and (max-width: 685px) {
  .gallery__item:nth-of-type(odd) {
    grid-column: 2 /span 2;
  }
}

@media screen and (min-width: 686px) and (max-width: 700px) {
  .gallery__item:nth-of-type(3n + 1) {
    grid-column: 2 /span 2;
  }
}

@media screen and (min-width: 700px) and (max-width: 900px) {
  .gallery__item:nth-of-type(3n + 1) {
    grid-column: 2 /span 2;
  }
}
