/**
 * Built-in lightbox for gallery_engine, on the native <dialog> element.
 */
.gallery-engine-lightbox {
  border: 0;
  padding: 0;
  /* The browser centres a modal dialog with these two, but themes routinely
     reset margins on every element and knock it into the top corner. */
  inset: 0;
  margin: auto;
  width: fit-content;
  height: fit-content;
  max-width: 92vw;
  max-height: 92vh;
  background: #111111;
  color: #ffffff;
  overflow: hidden;
}
.gallery-engine-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.82);
}
.gallery-engine-lightbox figure {
  margin: 0;
  padding: 16px;
  text-align: center;
}
.gallery-engine-lightbox img {
  display: block;
  margin-inline: auto;
  max-width: 88vw;
  max-height: 72vh;
  width: auto;
  height: auto;
}
.gallery-engine-lightbox figcaption {
  margin-top: 10px;
  font-size: 0.9em;
}
.gallery-engine-lightbox-close {
  position: absolute;
  inset-block-start: 6px;
  inset-inline-end: 10px;
  background: transparent;
  border: 0;
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.gallery-engine-lightbox-thumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 0 16px 16px;
}
.gallery-engine-lightbox-thumb {
  width: 64px;
  height: 46px;
  border: 2px solid transparent;
  padding: 0;
  background-color: #333333;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}
.gallery-engine-lightbox-thumb.active {
  border-color: #ffffff;
}
