/*** Gallery index page styles ***/
.image-gallery-index {
  margin: 2em 4em 2em 2em;
}

.image-gallery-index figure {
  display: inline-block;
  height: 250px;
  width: 375px;
  margin: 0 0 2em 2em;
  position: relative;
  vertical-align: middle;
}

.image-gallery-index a {
  align-items: center;
  background-color: rgba(0,0,0,0.6);
  box-shadow: 0 6px 14px 2px rgba(0,0,0,0.3);
  display: flex;
  justify-content: center;
  height: 250px;
  max-width: 375px;
  overflow: hidden;
  position: relative;
}

.image-gallery-index img {
  max-height: 100%;
  max-width: 100%;
}

.image-gallery-index figcaption {
  background: rgba(0,0,0,0.8);
  bottom: 0;
  box-sizing: border-box;
  color: white;
  font-family: 'Trocchi', 'Georgia', serif;
  padding: 0.25em 0.4em;
  position: absolute;
  width: 100%;
}


/*** Gallery leaf page styles ***/
.image-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style-type: none;
  margin: 2em 4em 2em 2em;
  padding: 0;
}

.image-gallery li {
  align-items: center;
  background: rgba(200, 200, 200, 0.2);
  display: flex;
  height: 250px;
  justify-content: center;
  margin: 0 0 0.5em 0.5em;
  vertical-align: middle;
  max-width: 375px;
}

.image-gallery li.section-title {
  background: none;
  display: block;
  height: auto;
  margin: 0 0 0 2em;
  padding: 0;
  width: auto;
}

.image-gallery img {
  cursor: pointer;
  display: none;
  margin: auto;
  max-height: 100%;
  max-width: 100%;
}

.image-gallery img[src] {
  background: rgba(0, 0, 0, 0.2);
}

.image-gallery li.vis {
  background: none;
}

.vis img {
  display: block;
}

.full-size-container {
  background-color: rgba(0, 0, 0, 0.95);
  /* background-image is set by lghtbox viewer */
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  bottom: 0;
  left: 0;
  margin: 0;
  position: fixed;
  right: 0;
  top: 0;
  /* Make sure the lightbox is rendered on top of footer elements. */
  z-index: 1;
}

.full-size-container img {
  left: 50%;
  max-height: 100%;
  max-width: 100%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.full-size-container figcaption {
  background-image: linear-gradient(0deg, black, transparent);
  bottom: 0;
  box-sizing: border-box;
  color: white;
  padding: 1em;
  position: absolute;
  text-align: center;
  text-shadow: 1px 0 0 black;
  width: 100%;
}

.full-size-container figcaption:empty {
  visibility: hidden;
}

.lb-btn {
  align-items: center;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  height: 40px;
  justify-content: center;
  position: absolute;
  width: 40px;

  /* Styles that toggle when buttons are hidden */
  transition: none;
  opacity: 1;
  visibility: visible;
}

.ui-hidden .lb-btn {
  transition: all 500ms;
  opacity: 0;
  /* Prevents user interaction on the hidden element. */
  visibility: hidden;
}

.lb-btn:hover {
  background: rgba(255,255,255,0.75);
}

.lb-btn::before,
.lb-btn:after {
  content: '';
  position: absolute;
}

.lb-close {
  top: 60px;
  right: 60px;
}

.lb-close::before {
  height: 4px;
  width: 25px;
  background: black;
  transform: rotate(45deg);
}

.lb-close::after {
  background: black;
  height: 4px;
  width: 25px;
  transform: rotate(-45deg);
}

.lb-prev {
  top: calc(50% - 40px / 2);
  left: 60px;
}

.lb-prev::before {
  border-top: 4px solid black;
  border-left: 4px solid black;
  box-sizing: border-box;
  transform: translateX(3px) rotate(-45deg);
  width: 18px;
  height: 18px;
}

.lb-next {
  top: calc(50% - 40px / 2);
  right: 60px;
}

.lb-next::before {
  border-top: 4px solid black;
  border-right: 4px solid black;
  box-sizing: border-box;
  transform: translateX(-3px) rotate(45deg);
  width: 18px;
  height: 18px;
}

@media (max-width: 749px) {
  .image-gallery-index {
    margin: 0;
  }

  .image-gallery-index figure {
    display: block;
    margin: 2em auto;
    max-width: 350px;
    width: auto;
  }

  .image-gallery {
    justify-content: center;
    margin: 0.5em;
  }

  .image-gallery li.section-title,
  .image-gallery li {
    margin: 0.5em;
  }

  .lb-close {
    right: 20px;
    top: 20px;
  }

  .lb-prev {
    left: 20px;
  }

  .lb-next {
    right: 20px;
  }
}