/* house-gallery */

.house-gallery {
  display: block;
  width: 100%;
  padding-top: 0;
  padding-bottom: 0;
}

.house-gallery .wrapper {
  padding: 0;
}

.house-gallery {
  margin: 120px auto;
}

.house-gallery-title {
  font-family: var(--title-font);
  font-weight: 600;
  font-size: 30px;
  line-height: 130%;
  letter-spacing: 0;
  margin-bottom: 30px;
}

.gallery-grid-block {
  display: grid;
  grid-template-rows: 1fr 1fr;
  grid-template-columns: 45.6% 30.6% auto;
  gap: 10px;
  aspect-ratio: 3 / 1.37;
}

.gallery-grid-block-6, .gallery-grid-block-7 {
  aspect-ratio: 3 / 1.35;
}

.gallery-image {
  display: inline-block;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  cursor: pointer;
  margin: auto;

}

.gallery-item {
  overflow: hidden;
}

.gallery-item:first-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.gallery-item:nth-child(3),
.gallery-item:last-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.gallery-item:nth-child(2),
.gallery-item:nth-child(4) {
  border-radius: 10px;
}

.gallery-item-video {
  position: relative;
}

.gallery-item-video::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 1;
}

.gallery-item-video .gallery-item-video-btn {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
  height: fit-content;
  width: fit-content;
  text-align: center;
  z-index: 2;
}

.gallery-item-video .gallery-item-video-btn p {
  font-family: var(--title-font);
  font-weight: 600;
  font-size: 18px;
  line-height: 130%;
  color: var(--background);
  margin: 15px 0 0;
}

.gallery-item-video-btn svg {
  transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  transform: scale(1);
}

.gallery-item-video:hover .gallery-item-video-btn svg {
  transform: scale(1.2);
}

.gallery-grid-block .gallery-button {
  display: block;
  width: 100%;
  height: 100%;
}

.gallery-grid-block.gallery-grid--desk {
  display: flex;
}

.gallery-grid-block.gallery-grid-block-5.gallery-grid--desk {
  display: grid;
}

.gallery-grid-block.gallery-grid--mob {
  display: none;
}

.gallery-slider--mob {
  display: none;
}

.gallery-slider--desk {
  display: grid;
}

@media screen and (min-width: 1000px) {
  .house-gallery-title {
    font-size: 36px;
    margin-bottom: 46px;
  }

  .gallery-grid-block-5 {
    display: grid;
    grid-template-rows: 1fr 1fr;
    grid-template-columns: 45.6% 30.6% auto;
    gap: 10px;
    aspect-ratio: 3 / 1.37;
  }

  .gallery-grid-block-5 .gallery-item:first-child {
    grid-row: span 2;
  }

  .gallery-grid-block-6 {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* пример */
  }

  .gallery-grid-block-6 .gallery-item:first-child {
    grid-row: unset;
  }

  .gallery-grid-block-6 .row1, .gallery-grid-block-6 .row2 {
    display: grid;
    grid-template-columns: 30.6% auto 45.6%;
    height: 50%;
    gap: 10px;
  }

  .gallery-grid-block-6 .row2 {
    grid-template-columns: 45.6% 30.6% auto;
  }

  .gallery-grid-block-7 .row2 {
    grid-template-columns: 22.5% 22.5% 30.6% auto;
  }

  .gallery-grid-block-7 .gallery-item {
    border-radius: 16px;
  }

  .gallery-grid-block-7 .gallery-item:first-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }

  .gallery-grid-block-7 .gallery-item:last-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
}

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

  .gallery-grid-block.gallery-grid--desk {
    display: none;
  }

  .gallery-grid-block.gallery-grid-block-5.gallery-grid--desk {
    display: none;
  }

  .gallery-grid-block.gallery-grid--mob {
    display: grid;
  }

  .gallery-slider--mob {
    display: grid;
  }

  .gallery-slider--desk {
    display: none;
  }

  .gallery-grid-block {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: unset;
    aspect-ratio: unset;
    gap: 10px;
  }

  .gallery-grid-block .gallery-item:first-child {
    grid-row: unset;
  }

  .gallery-grid-block .gallery-item {
    aspect-ratio: 1 / 1;
    width: 100%;
    display: block;
  }

  .gallery-item:nth-child(n) {
    border-radius: 6px;
  }

  .gallery-item.gallery-item-video {
    grid-column: 1 / 3;
    aspect-ratio: 1 / 0.49;
  }

  .house-gallery {
    margin: 80px auto;
  }
}

@media screen and (max-width: 1000px) and (min-width: 641px) {
  .gallery-item:nth-child(3n+1) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }

  .gallery-item:nth-child(3n) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  .gallery-item.gallery-item-video {
    border-radius: 0 6px 6px 0 !important;
  }

  .gallery-grid-block-5 .gallery-item.gallery-item-video {
    grid-column: 2 / 4;
    border-radius: 10px 0 0 10px !important;
  }

  .gallery-grid-block {
    gap: 9px;
  }
}

@media screen and (max-width: 640px) {
  .gallery-grid-block {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-item:nth-child(2n+1) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }

  .gallery-item:nth-child(2n) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  .gallery-item.gallery-item-video {
    border-radius: 0 !important;
  }

  .gallery-grid-block {
    gap: 7px;
  }

  .house-gallery {
    margin: 60px auto;
  }

  .gallery-item.gallery-item-video {
    aspect-ratio: 1 / 0.735;
  }
}

/* popup */

.features-popup .slider .inner {
  border-radius: 10px;
}

.features-popup.popup .close .b {
  width: 18px;
}

.features-popup.popup .close {
  width: 40px;
  height: 40px;
  background: var(--background);
  border-radius: 100px;
}

.fancybox-section .content {
  padding: 0 !important;
}

.fancybox-section.center-popup .content {
  background: transparent;
}

.features-popup .slider .slide {
  background: transparent;
  transition-duration: 0ms !important;
  transform: none !important;
}

.features-popup .fancybox-wrapper .slider .slide img {
  transition-duration: 0ms !important;
  transform: none !important;
  border-radius: 10px;
}

.features-popup .slider {
  pointer-events: none;
}

.features-popup .slider * {
  user-select: none;
  pointer-events: none;
}


@media screen and (min-width: 1601px) {
  .fancybox-section.center-popup .content {
    max-width: 48%;
  }
}

@media screen and (min-width: 1000px) {
  .features-popup.center-popup .popup-top {
    right: 20px;
    top: 20px;
  }
}

@media screen and (max-width: 999px) {
  .features-popup.center-popup .content {
    width: calc(100% - 60px);
  }
}

@media screen and (max-width: 640px) {
  .features-popup.center-popup .content {
    width: calc(100% - 32px);
  }
}