ul.ImageGallery,
.ImageGallery {
  list-style: none;
  padding: 3em 0;
  margin: 0;
  display: grid;
  gap: 0.5em;
}
@media (orientation: portrait) {
  ul.ImageGallery,
  .ImageGallery {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (orientation: landscape) {
  ul.ImageGallery,
  .ImageGallery {
    grid-template-columns: repeat(5, 1fr);
  }
}
ul.ImageGallery ul,
.ImageGallery ul {
  padding: 0;
}
ul.ImageGallery li,
.ImageGallery li {
  padding: 0;
}
ul.ImageGallery figure,
.ImageGallery figure {
  padding: 0;
  margin: 0 !important;
}
ul.ImageGallery figcaption,
.ImageGallery figcaption {
  display: none;
}
ul.ImageGallery img,
.ImageGallery img {
  display: block;
  height: 100%;
  max-height: 100%;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
}
ul.ImageGallery > *,
.ImageGallery > * {
  grid-column: auto/span 2;
  max-width: 100%;
  padding: 0;
  border-radius: 0.15em;
  overflow: hidden;
  background: white;
  display: flex;
  width: 100%;
  height: 100%;
  align-content: center;
  justify-content: center;
}
ul.ImageGallery > *:nth-child(6n+3), ul.ImageGallery > *:nth-child(6n+3) + *,
.ImageGallery > *:nth-child(6n+3),
.ImageGallery > *:nth-child(6n+3) + * {
  grid-column: auto/span 1;
  align-content: img;
}
ul.ImageGallery > *:nth-child(6n+3) img, ul.ImageGallery > *:nth-child(6n+3) + * img,
.ImageGallery > *:nth-child(6n+3) img,
.ImageGallery > *:nth-child(6n+3) + * img {
  height: 100%;
  aspect-ratio: 2/3;
}
@media (min-width: 50.625em) {
  ul.ImageGallery > *:nth-child(6n+3) img, ul.ImageGallery > *:nth-child(6n+3) + * img,
  .ImageGallery > *:nth-child(6n+3) img,
  .ImageGallery > *:nth-child(6n+3) + * img {
    aspect-ratio: unset;
  }
}
