.gallery {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  padding: 50px 0 80px 0;
  overflow: hidden;
}

.gallery__placeholder {
  position: absolute;
  z-index: 1;
  color: #241216;
  font-size: 40px;
  margin: 20px;
  left: 2%;
  opacity: 0.3;
}

.gallery__demo {
  opacity: 0.3;
}

.gallery__grid {
  padding: 44px 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  grid-template-rows: 274px 274px 274px 274px;
  gap: 16px;
  grid-auto-rows: 274px;
  position: relative;
  animation: 0.7s customBounce ease 0s both;
  z-index: 2;
}

@keyframes customBounce {
  0% {
    gap: 80px;
  }

  20% {
    gap: 50px;
  }

  40% {
    gap: 30px;
  }

  70% {
    gap: 20px;
  }

  100% {
    grid-gap: 16px;
  }
}

.gallery__grid-item {
  color: #fff;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.gallery__grid-item img {
  width: 100%;
  height: 100%;
  box-shadow: rgba(3, 8, 20, 0.1) 0px 0.15rem 0.5rem,
    rgba(2, 8, 20, 0.1) 0px 0.075rem 0.175rem;
  object-fit: cover;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.gallery__item--a {
  grid-column: 3/5;
  grid-row: 1/3;
}

.gallery__item--b {
  grid-column: 1/3;
  grid-row: 3/3;
}

.gallery__item--c {
  grid-column: 4/6;
  grid-row: 3/5;
}

/* double gallery */
.gallery__item--11 {
  grid-column: 3/5;
  grid-row: 5/7;
}

.gallery__item--16 {
  grid-column: 1/3;
}

.gallery__item--18 {
  grid-column: 4/6;
  grid-row: 9/7;
}

.gallery__close {
  position: absolute;
  right: 20px;
  top: 20px;
  transition: 0.3s;
  background-image: url("../images/gallery/close-menu_white.svg");
  width: 40px;
  height: 40px;
  background-repeat: no-repeat;
}

.gallery__close:hover,
.gallery__close:focus {
  cursor: pointer;
}

.gallery__next,
.gallery__prev {
  border-radius: 50%;
  width: 48px;
  height: 48px;
  background-image: url("../images/home-page/slider/arrow.png");
  background-color: #fff;
  background-size: 28px;
  background-repeat: no-repeat;
  background-position: center;
  position: absolute;
  top: 50%;
  cursor: pointer;
}

.gallery__next:hover,
.gallery__prev:hover {
  opacity: 0.8;
}

.gallery__prev {
  left: 10px;
}

.gallery__next {
  right: 10px;
  transform: rotate(180deg);
}

.gallery__modal {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow: auto;
  background-color: rgba(55, 48, 44, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 12;
  animation-name: zoom;
  animation-duration: 0.6s;
  overflow: hidden;
}

.gallery__modal img {
  margin: auto;
  display: block;
  max-width: 640px;
  max-height: 80%;
  object-fit: contain;
  -o-object-fit: contain;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.gallery__modal--content {
  margin: auto;
  display: block;
  max-width: 700px;
  max-height: 80%;
  object-fit: contain;
  -o-object-fit: contain;
  animation-name: zoom;
  animation-duration: 0.6s;
  border-radius: 20px;
}

@keyframes zoom {
  from {
    transform: scale(0);
  }

  to {
    transform: scale(1);
  }
}

/*gallery__thanks*/
.gallery__thanks-title>span {
  background-color: #da7269;
  color: #fff;
  padding: 4px;
  line-height: 56px;
}

.gallery__thanks-grig {
  padding: 44px 0;
  display: flex;
}

.gallery__thanks-grig-item {
  flex-direction: column;
  flex-basis: 50%;
}

.gallery__thanks-grig-item-img-container {
  height: 200px;
  justify-content: center;
  align-items: center;
  display: flex;
}

.gallery__thanks-grig-item-img-container>img {
  max-height: 197px;
}

.gallery__thanks-text {
  padding: 40px 20px 0;
}

@media screen and (max-width: 1024px) {
  .gallery {
    padding: 50px 0 40px 0;
  }

  .gallery__grid {
    grid-template-rows: 200px 200px 200px 200px;
    grid-auto-rows: 200px;
  }

  .gallery__thanks-grig-item-img-container {
    height: 100px;
  }

  .gallery__thanks-grig-item-img-container>img {
    max-height: 80px;
  }
}

@media screen and (max-width: 480px) {


  .gallery__modal img {
    max-width: 70%;
  }

  .gallery__next,
  .gallery__prev {
    width: 36px;
    height: 36px;
    background-size: 18px;
  }

  .hero__dots--gallery-left-bottom,
  .hero__dots--gallery-right-top {
    display: none;
  }

  .gallery__grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 197px;
    grid-auto-rows: 197px;
    padding: 26px 0 10px 0;
  }

  .gallery__item--a {
    grid-column: 1/3;
    grid-row: 3/5;
  }

  .gallery__item--b {
    grid-column: 1/3;
    grid-row: 6;
  }

  .gallery__item--c {
    grid-column: 1/3;
    grid-row: 9/11;
  }

  .gallery__item--1 {
    grid-column: 1/2;
    grid-row: 2;
  }

  .gallery__item--2 {
    grid-column: 2;
    grid-row: 2;
  }

  .gallery__item--3 {
    grid-column: 2;
    grid-row: 5;
  }

  .gallery__item--4 {
    grid-column: 1;
    grid-row: 6/5;
  }

  .gallery__item--5 {
    grid-column: 2/3;
    grid-row: 7;
  }

  .gallery__item--6 {
    grid-column: 1/2;
    grid-row: 7;
  }

  .gallery__item--7 {
    grid-column: 1/2;
    grid-row: 8;
  }

  .gallery__item--8 {
    grid-column: 2/3;
    grid-row: 8;
  }

  .gallery__item--9 {
    grid-column: 1/2;
  }

  .gallery__item--11 {
    grid-column: 1/3;
    grid-row: 13/15;
  }

  .gallery__item--12 {
    grid-column: 1/2;
    grid-row: 12;
  }

  .gallery__item--13 {
    grid-column: 2/3;
  }

  .gallery__item--14 {
    grid-column: 2/3;
    grid-row: 15;
  }

  .gallery__item--15 {
    grid-column: 1/2;
  }

  .gallery__thanks-title {
    font-size: 32px;
    line-height: 40px;
  }

  .gallery__item--18 {
    grid-column: 1/3;
    grid-row: 19/21;
  }

  .gallery__thanks-title>span {
    line-height: 43px;
  }

  .gallery__thanks-grig {
    padding: 30px 0;
    flex-direction: column;
  }

  .gallery__thanks-grig-item {
    flex-basis: 100%;
  }

  .gallery__thanks-grig-item-img-container {
    height: auto;
  }

  .gallery__thanks-grig-item-img-container>img {
    max-height: 160px;
    width: auto;
  }

  .gallery__thanks-text {
    padding: 30px 0;
  }

  .gallery__thanks {
    padding: 50px 0 0px 0;
  }
}