#image-viewer {
  width: 100%;
  height: 100%;
  overflow: auto;
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  background-color: rgb(0,0,0);
  background-color: rgba(0,0,0,0.9);
}

#image-viewer .close,
#image-viewer .previous,
#image-viewer .next {
  position: absolute;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
}

#image-viewer .close {
  top: 15px;
  right: 30px;
}

#image-viewer .previous,
#image-viewer .next {
  background-color: black;
  opacity: 20%;
  top: 50%;
  padding: 0 5px;
}

#image-viewer .previous {
  right: calc(100% - 70px);
}

#image-viewer .next {
  right: 30px;
}

#image-viewer .close:hover,
#image-viewer .close:focus,
#image-viewer .previous:hover,
#image-viewer .previous:focus,
#image-viewer .next:hover,
#image-viewer .next:focus {
  opacity: 50%;
  text-decoration: none;
  cursor: pointer;
}

#image {
  display: flex;
  margin: auto;
  width: 100%;
  height: 100%;
  animation-name: zoom;
  animation-duration: 0.4s;
}

@keyframes zoom {
  from {transform:scale(0)} 
  to {transform:scale(1)}
}

#image img {
  flex-basis: 1px;
  flex-grow: 1;
  object-fit: contain;
  min-width: 0;
  min-height: 0;
}

#image img:first-child:not(:only-child) {
  object-position: right center;
}

#image img:last-child:not(:only-child) {
  object-position: left center;
}