.gallerybox {
  padding: 80px 0;
  background-color: var(--darkred);
}
.gallerybox__head {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 80px;
}
.gallerybox__head + .gallerybox-images {
  padding-top: 50px;
}
.gallerybox-images {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.gallerybox__column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1 33.333%;
}
.gallerybox__column:nth-child(1) .gallerybox__item:nth-child(1) figure img {
  max-height: 310px;
}
.gallerybox__column:nth-child(1) .gallerybox__item:nth-child(2) figure img {
  max-height: 254px;
}
.gallerybox__column:nth-child(2) .gallerybox__item:nth-child(1) figure {
  flex-direction: column-reverse;
}
.gallerybox__column:nth-child(2) .gallerybox__item:nth-child(1) figure img {
  max-height: 314px;
}
.gallerybox__column:nth-child(2) .gallerybox__item:nth-child(2) figure {
  flex-direction: column-reverse;
}
.gallerybox__column:nth-child(2) .gallerybox__item:nth-child(2) figure img {
  max-height: 310px;
}
.gallerybox__column:nth-child(3) .gallerybox__item:nth-child(1) figure img {
  max-height: 254px;
}
.gallerybox__column:nth-child(3) .gallerybox__item:nth-child(2) figure img {
  max-height: 310px;
}

.gallerybox__item {
  display: flex;
  justify-content: center;
}
.gallerybox__item figure {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
}
.gallerybox__item figure img {
  width: 100%;
  height: 100vh;
  -o-object-fit: cover;
     object-fit: cover;
  border-radius: 8px;
  overflow: hidden;
}
.gallerybox__item figure figcaption {
  padding: 20px 26px;
  font-weight: 400;
  background-color: var(--highlight);
  color: #fff;
  border-radius: 8px;
}

.gallerybox-opts {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 50px;
}

@media screen and (max-width: 1130px) {
  .gallerybox {
    padding: 60px 0;
  }
  .gallerybox__head {
    gap: 16px;
    margin-bottom: 25px;
  }
  .gallerybox__head + .gallerybox-images {
    padding-top: 25px;
  }
  .gallerybox__desc {
    font-size: 18px;
    line-height: 130%;
  }
  .gallerybox-images {
    gap: 16px;
  }
  .gallerybox__column {
    gap: 16px;
  }
  .gallerybox__item {
    display: flex;
    justify-content: center;
  }
  .gallerybox__item figure {
    gap: 16px;
  }
  .gallerybox__item figure figcaption {
    padding: 10px 13px;
    font-size: 16px;
    line-height: 130%;
  }
  .gallerybox-opts {
    margin-top: 25px;
  }
}
@media screen and (max-width: 580px) {
  .gallerybox-images {
    flex-wrap: wrap;
  }
  .gallerybox__column {
    flex: 1 50%;
  }
  .gallerybox__column .gallerybox__item figure img {
    aspect-ratio: 4/3 !important;
  }
  .gallerybox__column:nth-child(1) .gallerybox__item:nth-child(1) figure img {
    max-height: -moz-max-content;
    max-height: max-content;
  }
  .gallerybox__column:nth-child(1) .gallerybox__item:nth-child(2) figure img {
    max-height: -moz-max-content;
    max-height: max-content;
  }
  .gallerybox__column:nth-child(2) .gallerybox__item:nth-child(1) figure {
    flex-direction: column;
  }
  .gallerybox__column:nth-child(2) .gallerybox__item:nth-child(1) figure img {
    max-height: -moz-max-content;
    max-height: max-content;
  }
  .gallerybox__column:nth-child(2) .gallerybox__item:nth-child(2) figure {
    flex-direction: column;
  }
  .gallerybox__column:nth-child(2) .gallerybox__item:nth-child(2) figure img {
    max-height: -moz-max-content;
    max-height: max-content;
  }
  .gallerybox__column:nth-child(3) .gallerybox__item:nth-child(1) figure img {
    max-height: -moz-max-content;
    max-height: max-content;
  }
  .gallerybox__column:nth-child(3) .gallerybox__item:nth-child(2) figure img {
    max-height: -moz-max-content;
    max-height: max-content;
  }
}