figure {
  border: thin gray solid;
  margin: 0.1em;
  padding: 2px;
}

figcaption {
  font-size: smaller;
  text-align: center;
}

.figcontainer {
    position:relative;
}

.figimage {
    position:relative;
}

.figarrows {
    position:absolute;
    top:0;
    width:100%;
    height:100%;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.figarrows span {
    position:absolute;
    background: #8888;
    border-radius: 50%;
    width:0.8em;
    height:0.8em;
    text-align:center;
    font-weight:800;
    font-size:3em;
    line-height: 2.5rem;
    color: #333;
    cursor:pointer
}

.figarrows span.right {
    right:0px;
}

.figarrows span.left {
    left:0px;
}

.figimage img {
    width:100%;
    object-fit: contain;
}

.figbullets {
    top:0;
    position:absolute;
    display:flex;
    justify-content:center;
    width:100%;
    height:100%;
    align-items:flex-end;
}

.figbullets span {
    border-radius:10px;
    border:solid 2px #888;
    height:10px;
    width:10px;
    margin-bottom:30px;
    margin-left:2px;
    margin-right:2px;
}

.figbullets span.factive {
    background: #ffffffa0;
    border:solid 2px black;
}

.galleryNext,.galleryPrev {
    font-size: 5em;
}

.galleryPreview {
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
}

#gallery {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.2);
}

#gallery .modal-content {
  padding: 10px;
  width: 88%;
  height: 88%;
  position: relative;
  min-height: 300px;
  margin: 2% auto;
  background: #fff;
  box-shadow: 0 0 10px #000;
  border-radius: 4px;

  display:flex;
  flex-direction: column;
  gap: 4px;
}

#gallery .galleryListImage {
    height:100%;
    width:auto;
}

#gallery .galleryImage {
    background-size: contain;
    background-repeat: no-repeat;
    background-position:center;
    width:100%;
    height:100%;
}

#gallery .galleryPrev {
  width:50%;
  height:80%;
  position:absolute;
  top:0px;
  left:0px;
  padding-left:20px;
}

#gallery .galleryPrev span {
  position:relative;
  top:50%;
  cursor:pointer;
}

#gallery .galleryPrev span::before {
  content: '‹'
}

#gallery .galleryNext {
  width:50%;
  height:80%;
  position:absolute;
  top:0px;
  right:0px;
  text-align:right;
  padding-right:20px;
}

#gallery .galleryNext span {
  position:relative;
  top:50%;
  cursor:pointer;
}

#gallery .galleryNext span::before {
  content: '›'
}

#gallery .galleryList {
    display:flex;
    height:15%;
    justify-content: center;
    gap: 4px;
}

#gallery .galleryTitle {
  padding:0;
  margin:0;
  width:100%;
  text-align:center;
  font-size: 20px; /* Prevent images overlapping */
}

#gallery .icon-cancel {
  position:absolute;
  top:0px;
  right:0px;
  background:#777;
  color:#fff;
  font-size:3em;
}

#gallery .icon-cancel::before {
  content: '⨯';
}

#gallery .galleryCaption {
    text-align:center;
}

.hidden { display: none; }
