/* Thumbnail grid: the spacing of Simple Image Gallery's "Classic" layout (1px gaps, 8px around). */
.hio-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  margin: 8px 0;
  padding: 8px 0;
  list-style: none;
}

.hio-gallery li {
  margin: 0;
  padding: 0;
}

.hio-gallery a {
  display: block;
  background: #000;
}

.hio-gallery img {
  display: block;
  width: var(--hio-thumb-w, 159px);
  height: var(--hio-thumb-h, 160px);
  max-width: 100%;
  object-fit: cover;
  transition: opacity .2s;
}

.hio-gallery a:hover img,
.hio-gallery a:focus-visible img {
  opacity: .8;
}

/* Lightbox */
.hio-lightbox {
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, .85);
}

.hio-lightbox::backdrop {
  background: transparent;
}

.hio-lightbox figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin: 0;
}

.hio-lightbox img {
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 4rem);
  object-fit: contain;
  background: #fff;
}

.hio-lightbox figcaption {
  margin-top: .5rem;
  color: #ddd;
  font-size: .875rem;
}

.hio-lightbox button {
  position: fixed;
  border: 0;
  border-radius: 50%;
  width: 2.75rem;
  height: 2.75rem;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.hio-lightbox button:hover,
.hio-lightbox button:focus-visible {
  background: rgba(0, 0, 0, .8);
}

.hio-lightbox .hio-close {
  top: .75rem;
  right: .75rem;
}

.hio-lightbox .hio-prev,
.hio-lightbox .hio-next {
  top: 50%;
  transform: translateY(-50%);
}

.hio-lightbox .hio-prev {
  left: .75rem;
}

.hio-lightbox .hio-next {
  right: .75rem;
}
