/* Hide overlay by default */
.sbiv-hidden {
  display: none;
}

#sbiv-viewer {
  position: fixed;  /* cover viewport */
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  /* display: flex;              /* center the overlay flex content */
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.sbiv-overlay {
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,1);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Image wrapper shrink-wraps to the image */
.sbiv-image-wrap {
  position: relative;
  display: inline-block; /* shrink to image size */
}

/* Image styling */
#sbiv-image {
  display: block;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  user-select: none;
  touch-action: pan-y;
}

/* Close button top-right of image */
.sbiv-close {
  position: absolute;
  top: 12px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: #fff;
  text-shadow: 2px 2px 1px #000;
  font-size: 24px;
  font-weight: bold;
  line-height: 24px;
  cursor: pointer;
  z-index: 10;
  user-select: none;
  opacity: 0;
  transition: opacity 0.3s; /* smooth fade-in */
}

.sbiv-close:hover {
  opacity: 0.66;
}

/* Navigation arrows */
.sbiv-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 36px;
  background: none;
  border: none;
  color: #fff;
  text-shadow: 2px 2px 1px #000;
  cursor: pointer;
  padding: 8px 12px;
  z-index: 5;
  user-select: none;
}

.sbiv-prev {
  left: 0;
  opacity: 0;
  transition: opacity 0.3s;
}

.sbiv-prev:hover {
  opacity: 0.66;
}

.sbiv-next {
  right: 0;
  opacity: 0;
  transition: opacity 0.3s;
}

.sbiv-next:hover {
  opacity: 0.66;
}

/* Hide arrows on touch devices */
@media (hover: none) {
  .sbiv-nav {
    display: none;
  }

  .sbiv-close {
    opacity: 0.66;
  }
}
