:root {
  --gallery-row-height: 8rem;
  --gallery-gap: 0.04em;
}
.justified-gallery {
  display: flex !important;
  flex-wrap: wrap;
}
.justified-gallery > *, .justified-gallery:after {
  --ratio: calc(var(--w) / var(--h));
  flex-basis: calc(var(--ratio) * var(--gallery-row-height));
}
.justified-gallery > * {
  margin: var(--gallery-gap);
  flex-grow: calc(var(--ratio) * 100);
  position: relative;
  display: none;
}
.justified-gallery > .is-active-image {
  display: block;
}
.justified-gallery::after {
  --w: 2;
  --h: 1;
  content: '';
  flex-grow: 1000000;
}
.justified-gallery > * > img,
.justified-gallery > * > video {
  display: block;
  width: 100%;  
}
.justified-gallery > * > video {
  height: 100%;
}
@media only screen and (min-width: 768px) {
  :root {
    --gallery-row-height: 10rem;
  }
}
@media only screen and (min-width: 1280px) {
  :root {
    --gallery-row-height: 15rem;
  }
}