.galleryBlock {
  padding: 0 64px 112px;
  width: 100%;
}

.galleryBlock__container {
  margin: 0 auto;
  max-width: 1280px;
}

.galleryBlock__grid {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.galleryBlock__mobileControls {
  display: none;
}

.galleryBlock__column {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.galleryBlock__item {
  background: transparent;
  border: 0;
  border-radius: 20px;
  cursor: zoom-in;
  display: block;
  margin: 0;
  overflow: hidden;
  padding: 0;
  width: 100%;
}

.galleryBlock__item--square {
  aspect-ratio: 1 / 1;
}

.galleryBlock__item--landscape {
  aspect-ratio: 416 / 234;
}

.galleryBlock__image {
  display: block;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 400ms ease, filter 280ms ease;
  width: 100%;
}

.galleryBlock__item:hover .galleryBlock__image,
.galleryBlock__item:focus-visible .galleryBlock__image {
  filter: brightness(1.03);
  transform: scale(1.08);
}

.galleryBlock__item:focus-visible {
  outline: 2px solid #00ccff;
  outline-offset: 2px;
}

.galleryBlock__lightbox {
  align-items: center;
  backdrop-filter: blur(2px);
  background: rgba(2, 14, 17, 0.86);
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 0;
  position: fixed;
  transition: opacity 220ms ease;
  z-index: 9999;
}

.galleryBlock__lightbox[hidden] {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.galleryBlock__lightbox:not([hidden]) {
  opacity: 1;
}

.galleryBlock__lightbox-image {
  max-height: 88vh;
  max-width: 88vw;
  object-fit: contain;
  transform: scale(0.97);
  transition: transform 240ms ease;
}

.galleryBlock__lightbox:not([hidden]) .galleryBlock__lightbox-image {
  transform: scale(1);
}

.galleryBlock__lightbox-close,
.galleryBlock__lightbox-nav {
  align-items: center;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-size: 30px;
  height: 52px;
  justify-content: center;
  line-height: 1;
  transition: background-color 180ms ease, transform 180ms ease;
  width: 52px;
}

.galleryBlock__lightbox-close:hover,
.galleryBlock__lightbox-nav:hover {
  background: rgba(0, 0, 0, 0.62);
  transform: translateY(-50%) scale(1.04);
}

.galleryBlock__lightbox-close:hover {
  transform: scale(1.04);
}

.galleryBlock__lightbox-close:focus-visible,
.galleryBlock__lightbox-nav:focus-visible {
  outline: 2px solid #00ccff;
  outline-offset: 2px;
}

.galleryBlock__lightbox-close {
  font-size: 38px;
  line-height: 0.8;
  position: absolute;
  right: 24px;
  top: 24px;
  z-index: 2;
}

.galleryBlock__lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.galleryBlock__lightbox-nav--prev {
  left: 24px;
}

.galleryBlock__lightbox-nav--next {
  right: 24px;
}

body.galleryBlock--lightbox-open {
  overflow: hidden;
}

@media (max-width: 1280px) {
  .galleryBlock {
    padding-left: 40px;
    padding-right: 40px;
  }

  .galleryBlock__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 992px) {
  .galleryBlock {
    padding-bottom: 92px;
    padding-left: 24px;
    padding-right: 24px;
  }

  .galleryBlock__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .galleryBlock__lightbox-close,
  .galleryBlock__lightbox-nav {
    height: 48px;
    width: 48px;
  }

  .galleryBlock__lightbox-nav--prev {
    left: 14px;
  }

  .galleryBlock__lightbox-nav--next {
    right: 14px;
  }
}

@media (max-width: 640px) {
  .galleryBlock {
    padding-bottom: 72px;
    padding-left: 0;
    padding-right: 0;
  }

  .galleryBlock__container {
    max-width: none;
  }

  .galleryBlock__grid {
    align-items: stretch;
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 0 16px;
    scroll-padding: 0 16px;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .galleryBlock__grid::-webkit-scrollbar {
    display: none;
  }

  .galleryBlock__column {
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    gap: 14px;
  }

  .galleryBlock__item {
    border-radius: 16px;
    cursor: pointer;
    flex: 0 0 calc(100vw - 56px);
    max-width: 520px;
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }

  .galleryBlock__item--square,
  .galleryBlock__item--landscape {
    aspect-ratio: 4 / 3;
  }

  .galleryBlock__image {
    transition: transform 300ms ease, filter 220ms ease;
  }

  .galleryBlock__item:hover .galleryBlock__image,
  .galleryBlock__item:focus-visible .galleryBlock__image {
    filter: brightness(1.02);
    transform: scale(1.03);
  }

  .galleryBlock__mobileControls {
    align-items: center;
    display: flex;
    justify-content: center;
    margin-top: 14px;
    padding: 0 16px;
  }

  .galleryBlock__mobileDots {
    display: flex;
    gap: 6px;
    justify-content: center;
    min-width: 0;
    padding: 0 12px;
  }

  .galleryBlock__mobileDot {
    background: rgba(255, 255, 255, 0.25);
    border: 0;
    border-radius: 999px;
    display: block;
    height: 8px;
    padding: 0;
    transition: background-color 180ms ease, transform 180ms ease;
    width: 8px;
  }

  .galleryBlock__mobileDot.is-active {
    background: #00ccff;
    transform: scale(1.15);
  }

  .galleryBlock__mobileNav {
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    font-size: 20px;
    height: 30px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 30px;
  }

  .galleryBlock__lightbox-image {
    max-height: 72vh;
    max-width: 92vw;
  }

  .galleryBlock__lightbox-close {
    right: 12px;
    top: 12px;
  }

  .galleryBlock__lightbox-nav {
    bottom: 20px;
    top: auto;
    transform: none;
  }

  .galleryBlock__lightbox-nav:hover {
    transform: scale(1.02);
  }

  .galleryBlock__lightbox-nav--prev {
    left: calc(50% - 58px);
  }

  .galleryBlock__lightbox-nav--next {
    right: calc(50% - 58px);
  }
}
