.gallery-page {
  color: var(--hero-navy);
  background: #fff;
}

.gallery-page .about-banner {
  min-height: 307px;
}

.gallery-section {
  padding: 67px 0 82px;
  background: #fff url("../about-sbcl/background.png") center / cover no-repeat;
}

.gallery-section__container {
  width: min(1060px, calc(100% - 48px));
  margin: 0 auto;
}

.gallery-tabs {
  display: grid;
  grid-template-columns: repeat(5, 150px);
  justify-content: center;
  gap: 31px;
  margin-bottom: 58px;
}

.gallery-tab {
  min-height: 40px;
  padding: 8px 18px;
  border: 0;
  border-radius: 7px;
  background: rgba(225, 237, 239, .72);
  color: #111;
  font: 500 13px/1.2 Inter, Arial, sans-serif;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease, transform .25s ease;
}

.gallery-tab:hover,
.gallery-tab:focus-visible {
  transform: translateY(-2px);
}

.gallery-tab.is-active {
  background: var(--hero-gold);
  color: #000;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.gallery-card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: #e9ecef;
  cursor: pointer;
  animation: gallery-card-in .35s ease both;
}

.gallery-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .35s ease;
}

.gallery-card:hover img,
.gallery-card:focus-visible img {
  transform: scale(1.055);
}

.gallery-load-more {
  display: block;
  width: 230px;
  height: 48px;
  margin: 50px auto 0;
  border: 0;
  border-radius: 7px;
  background: var(--hero-navy);
  color: #fff;
  font: 500 14px/1 Inter, Arial, sans-serif;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease, transform .25s ease;
}

.gallery-load-more:hover,
.gallery-load-more:focus-visible {
  background: var(--hero-gold);
  color: #000;
  transform: translateY(-2px);
}

.gallery-load-more[hidden] {
  display: none;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  padding: 40px 80px;
  place-items: center;
  background: rgba(0, 0, 0, .78);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
}

.gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.gallery-lightbox__dialog {
  position: relative;
  display: grid;
  width: min(720px, 70vw, 100vh);
  place-items: center;
  transform: translateY(12px) scale(.985);
  transition: transform .28s ease;
}

.gallery-lightbox.is-open .gallery-lightbox__dialog {
  transform: translateY(0) scale(1);
}

.gallery-lightbox__frame {
  display: block;
  width: 100%;
  max-height: 75vh;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
}

.gallery-lightbox__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.gallery-lightbox__close svg,
.gallery-lightbox__arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gallery-lightbox__close,
.gallery-lightbox__arrow {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #111;
  cursor: pointer;
}

.gallery-lightbox__close {
  top: -20px;
  right: -20px;
}

.gallery-lightbox__arrow {
  top: 50%;
  transform: translateY(-50%);
}

.gallery-lightbox__arrow--previous {
  left: -54px;
}

.gallery-lightbox__arrow--next {
  right: -54px;
}

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

@keyframes gallery-card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .gallery-tabs {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    gap: 16px;
  }

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

@media (max-width: 720px) {
  .gallery-page .about-banner {
    min-height: 260px;
  }

  .gallery-section {
    padding: 54px 0 66px;
  }

  .gallery-section__container {
    width: min(100% - 32px, 560px);
  }

  .gallery-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 42px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .gallery-lightbox {
    padding: 30px 52px;
  }

  .gallery-lightbox__dialog {
    width: min(100%, 100vh);
  }

  .gallery-lightbox__arrow--previous {
    left: -46px;
  }

  .gallery-lightbox__arrow--next {
    right: -46px;
  }
}

@media (max-width: 430px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-tabs {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .gallery-tab:first-child {
    grid-column: 1 / -1;
  }

  .gallery-load-more {
    width: min(230px, 100%);
  }
}
