.instagram-gallery {
  height: auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 240px;
  grid-auto-flow: dense;
  gap: .75rem;
}

.instagram-gallery figure {
  height: auto;
  min-height: 0;
  background: #171717;
  cursor: zoom-in;
}

.instagram-gallery .feature {
  grid-column: span 2;
  grid-row: span 2;
}

.instagram-gallery .landscape {
  grid-column: span 2;
}

.instagram-gallery img {
  transition: transform .45s ease, filter .45s ease;
}

.instagram-gallery figure:hover img {
  transform: scale(1.035);
  filter: saturate(1.08);
}

.instagram-gallery figure:focus-visible {
  outline: 3px solid #ff5a00;
  outline-offset: 3px;
}

.gallery-more {
  display: none;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(4rem, 9vw) minmax(0, 1fr) minmax(4rem, 9vw);
  align-items: center;
  background: rgba(0, 0, 0, .94);
  backdrop-filter: blur(8px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100vh;
  padding: 2rem 0 3.5rem;
}

.lightbox-stage img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 5.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, .45);
}

.lightbox-close,
.lightbox-nav {
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: #ff5a00;
}

.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  outline: 3px solid #ff5a00;
  outline-offset: 3px;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font: 300 2rem/1 Inter, sans-serif;
}

.lightbox-nav {
  justify-self: center;
  z-index: 2;
  width: 3.5rem;
  height: 4.5rem;
  border-radius: .25rem;
  font: 300 3.25rem/1 Inter, sans-serif;
}

.lightbox-nav:active {
  transform: scale(.94);
}

.lightbox-counter {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font: 600 .9rem/1 Inter, sans-serif;
  letter-spacing: .12em;
}

@media (max-width: 900px) {
  .instagram-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 220px;
  }

  .instagram-gallery figure {
    height: auto;
  }
}

@media (max-width: 600px) {
  .instagram-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 180px;
    gap: .5rem;
  }

  .instagram-gallery .feature {
    grid-column: span 2;
    grid-row: span 2;
  }

  .instagram-gallery .landscape {
    grid-column: span 2;
  }

  .instagram-gallery figure,
  .instagram-gallery .wide {
    height: auto;
  }

  .instagram-gallery figure:nth-child(n+4) {
    display: none;
  }

  .instagram-gallery figure:nth-child(3) {
    position: relative;
  }

  .gallery-more {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    color: #fff;
    background: rgba(0, 0, 0, .55);
    font: 800 .78rem/1 "Barlow Condensed", sans-serif;
    letter-spacing: .12em;
    text-align: center;
  }

  .gallery-more b {
    font-size: 2rem;
    letter-spacing: 0;
  }

  .gallery {
    padding-inline: 3vw;
  }

  .lightbox {
    grid-template-columns: 3.5rem minmax(0, 1fr) 3.5rem;
  }

  .lightbox-stage {
    padding: 4.5rem 0 5rem;
  }

  .lightbox-stage img {
    max-height: calc(100vh - 9.5rem);
  }

  .lightbox-nav {
    width: 2.75rem;
    height: 3.75rem;
    font-size: 2.75rem;
  }
}
