.work {
  padding-right: 0;
  padding-left: 0;
}

.work-head {
  padding-right: 6vw;
  padding-left: 6vw;
}

.gallery {
  display: block;
  width: 100%;
  padding: 18px 14px 2px;
  border-top: 1px solid #2b2b28;
  background: #11110f;
  columns: 3;
  column-gap: 18px;
  column-fill: balance;
}

.gallery .count {
  display: none;
}

.gallery article,
.gallery article.mosaic-compact,
.gallery article.mosaic-medium,
.gallery article.mosaic-wide {
  display: inline-block;
  width: 100%;
  margin: 0 0 18px;
  break-inside: avoid;
  vertical-align: top;
}

.gallery .frame {
  position: relative;
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 8px;
  border: 1px solid #292927;
  background: #080808;
  box-shadow: 0 12px 28px rgba(9, 9, 8, .22), inset 0 0 0 1px rgba(255, 255, 255, .04);
}

.gallery .frame::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, .09);
  pointer-events: none;
}

.gallery .frame > img {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
}

.lightbox {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #11110f;
}

.lightbox figure {
  display: flex;
  width: auto;
  max-width: 96vw;
  margin: 0 auto;
  flex-direction: column;
  align-items: center;
}

.lightbox figure img {
  width: auto;
  height: auto;
  margin: 0 auto;
  padding: 10px;
  border: 1px solid #292927;
  background: #080808;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .48), inset 0 0 0 1px rgba(255, 255, 255, .04);
  outline: 1px solid rgba(255, 255, 255, .09);
  outline-offset: -1px;
}

.lightbox figcaption {
  width: 100%;
  padding: 5px 8px 1px;
  text-align: center;
}

@media (max-width: 1100px) {
  .gallery {
    columns: 3;
  }
}

@media (max-width: 720px) {
  .work-head {
    padding-right: 20px;
    padding-left: 20px;
  }

  .gallery {
    padding: 10px 10px 0;
    columns: 2;
    column-gap: 10px;
  }

  .gallery article,
  .gallery article.mosaic-compact,
  .gallery article.mosaic-medium,
  .gallery article.mosaic-wide {
    margin-bottom: 10px;
  }

  .gallery .frame {
    padding: 6px;
  }

  .gallery .frame::after {
    inset: 5px;
  }

  .lightbox figure img {
    padding: 6px;
  }
}

@media (max-width: 480px) {
  .gallery {
    columns: 1;
  }
}
