.gallery-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.gallery-filters button {
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}

.gallery-filters button:hover,
.gallery-filters button.active {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.gallery-showcase {
  position: relative;
  display: grid;
  grid-template-columns: .72fr 1.28fr;
  min-height: 410px;
  margin-top: 48px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(135deg, #111116, #1a1a20);
  overflow: hidden;
}

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

.gallery-showcase video {
  width: 100%;
  height: 100%;
  min-height: 410px;
  object-fit: cover;
}

.showcase-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 42px;
}

.showcase-copy .video-badge {
  position: static;
  margin-bottom: auto;
}

.showcase-copy h3 {
  margin: 24px 0 10px;
  font-family: var(--heading);
  font-size: 31px;
  line-height: 1.15;
}

.showcase-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.gallery-grid-clean {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: auto;
  gap: 16px;
  margin-top: 16px;
}

.gallery-grid-clean .gallery-item {
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  text-align: left;
}

.gallery-grid-clean .gallery-item[hidden] {
  display: none;
}

.gallery-grid-clean .gallery-item:focus-visible {
  outline: 3px solid rgba(223, 36, 55, .45);
  outline-offset: 3px;
}

.gallery-overlay {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  min-height: 42%;
  align-content: end;
  padding: 22px;
  background: linear-gradient(transparent, rgba(8, 8, 11, .92));
  color: #fff;
  transform: translateY(8px);
  transition: transform .3s;
}

.gallery-overlay small {
  color: #d8a1a8;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.gallery-overlay strong {
  font-family: var(--heading);
  font-size: 15px;
}

.gallery-overlay i {
  position: absolute;
  right: 16px;
  bottom: 18px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 50%;
  background: rgba(14, 14, 18, .45);
  font-size: 22px;
  font-style: normal;
  line-height: 1;
}

.gallery-item:hover .gallery-overlay {
  transform: none;
}

.lightbox {
  display: grid;
  grid-template-columns: 60px minmax(0, 1100px) 60px;
  gap: 20px;
}

.lightbox figure {
  min-width: 0;
  margin: 0;
}

.lightbox img {
  width: auto;
  max-width: 100%;
  margin: auto;
  object-fit: contain;
}

.lightbox figcaption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
  color: #c8c8ce;
  font-size: 13px;
}

.lightbox-count {
  color: #777780;
}

.lightbox-close {
  z-index: 2;
}

.lightbox-nav {
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  align-self: center;
  border: 1px solid #3b3b43 !important;
  border-radius: 50%;
  background: rgba(20, 20, 25, .88) !important;
  color: #fff;
  font-size: 22px !important;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.lightbox-nav:hover {
  border-color: var(--red) !important;
  background: var(--red) !important;
}

.lightbox .lightbox-prev,
.lightbox .lightbox-next {
  position: static;
}

@media (max-width: 980px) {
  .gallery-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .gallery-filters {
    justify-content: flex-start;
  }

  .gallery-showcase {
    grid-template-columns: 1fr;
  }

  .gallery-showcase video {
    min-height: 360px;
    order: -1;
  }

  .showcase-copy {
    padding: 28px;
  }

  .showcase-copy .video-badge {
    margin-bottom: 0;
  }

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

  .lightbox {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    gap: 8px;
  }

  .lightbox-nav {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 680px) {
  .gallery-filters {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .gallery-filters button {
    width: 100%;
  }

  .gallery-showcase {
    min-height: 0;
    margin-top: 30px;
  }

  .gallery-showcase video {
    min-height: 240px;
  }

  .showcase-copy h3 {
    font-size: 24px;
  }

  .gallery-grid-clean {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;
  }

  .gallery-grid-clean .gallery-item {
    aspect-ratio: 3 / 4;
  }

  .gallery-overlay {
    padding: 15px;
  }

  .gallery-overlay i {
    right: 11px;
    bottom: 12px;
    width: 29px;
    height: 29px;
  }

  .gallery-overlay strong {
    max-width: 90px;
    font-size: 12px;
  }

  .lightbox {
    display: flex;
    padding: 60px 14px 82px;
  }

  .lightbox figure {
    width: 100%;
  }

  .lightbox-nav {
    position: absolute !important;
    bottom: 18px;
  }

  .lightbox-prev {
    left: calc(50% - 58px);
    right: auto;
  }

  .lightbox-next {
    left: auto;
    right: calc(50% - 58px);
  }

  .lightbox figcaption {
    font-size: 11px;
  }
}
