/*  Case Project 5 Gallery CSS
/* --------------------------------------------------------------*/
/* Styles for the slideshow box containing the images and tools  */
/* --------------------------------------------------------------*/

/* Prevent horizontal overflow from any gallery child */
html, body {
  overflow-x: hidden;
}

/* ==============================================================
VIEWPORT CENTERING (middle of the screen)
============================================================== */
/* Make main take full viewport height so we can center inside it */
main {
  min-height: 100vh;
}

/* Center the gallery article within main */
main .content > article {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 200px);
  width: 100%
}



/* ==============================================================
LIGHTBOX / SLIDESHOW
============================================================== */
/* Styles for the box containing the slideshow and tools */
div#lightbox {
  position: relative;
  width: min(960px, 100%);
  height: auto;
  min-height: 240px; /* prevents it from collapsing */
  margin: 20px auto;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Styles for slideshow title */
div#lightbox h1#lbTitle {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  text-align: center;
  display: block; /* overrides any flex inheritance */
  position: relative;
  left: 0;
  transform: none;
  align-self: auto;
  font-size: 2.4em;
  font-family: Georgia, "Times New Roman", Times, serif;
  color: #8B4513;
  margin: 0 0 10px 0;
}

/* Styles for the left and right arrows to move through the slideshow */
div#lightbox div#lbPrev, div#lightbox div#lbNext {
  position: absolute;
  width: 5%;
  height: 30px;
  color: #F5ECD7;
  text-shadow: 2px 2px 2px #3b2a1a;
  font-size: 20px;
  font-weight: bold;
  top: 87%; /* relative positioning instead of fixed pixels */
  line-height: 30px;
  text-align: center;
  z-index: 1;
  background: rgba(0, 0, 0, 0.0);
  cursor: pointer;
  user-select: none;
}

/* Hovering styles for the left and right arrows */
div#lightbox div#lbPrev:hover, div#lightbox div#lbNext:hover {
  background: rgba(139, 69, 19, 0.5);
}

/* Horizontal position of the left arrow */
div#lightbox div#lbPrev {
  left: 0px;
}

/* Horizontal position of the right arrow */
div#lightbox div#lbNext {
  right: 0px;
}

/* Styles for the box containing slide images */
div#lightbox div#lbImages {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: 100%;
  height: auto;
  overflow: hidden;
  align-items: center;
}

/* Styles for the box containing the slide counter */
div#lightbox div#lbCounter {
  position: absolute;
  z-index: 1;
  width: 70px;
  height: 26px;
  line-height: 20px;
  font-size: 20px;
  background-color: rgba(101, 83, 60, 0.6);
  border-radius: 4px;
  text-align: center;
  color: #F5ECD7;
  top: 70px;
  left: 0px;
  font-family: Georgia, "Times New Roman", Times, serif;
  padding: 3px;
  user-select: none;
}

/* Styles for the play-pause button */
div#lightbox div#lbPlay {
  position: absolute;
  top: 87%;
  left: 47.5%;
  text-align: center;
  font-size: 2.2em;
  width: 40px;
  margin: 0 auto;
  text-shadow: 3px 3px 20px #3b2a1a;
  cursor: pointer;
  user-select: none;
  filter: grayscale(1);
}

/* Hovering styles for the play-pause button */
div#lightbox div#lbPlay:hover {
  position: absolute;
  top: 87%;
  left: 47.5%;
  text-align: center;
  font-size: 2.2em;
  width: 40px;
  margin: 0 auto;
  text-shadow: 3px 3px 20px #3b2a1a;
  cursor: pointer;
  user-select: none;
  filter: grayscale(0.2) sepia(0.4);
}

/* Styles for images within the slideshow box */
div#lbImages img {
  display: block;
  width: min(230px, 70vw); /* shrink thumbnails on mobile */
  height: auto;
  margin-right: 13px;
  filter: opacity(0.8);
  cursor: pointer;
  outline: 2px solid #8B6914;
  box-shadow: 3px 3px 10px #3b2a1a;
  user-select: none;
}

/* Hovering styles for images within the slideshow box */
div#lbImages img:hover {
  filter: opacity(1);
}

body {
  min-height: auto;
  display: block;
}

/* Mobile */
@media (max-width: 600px) {
  div#lightbox {
    height: auto;
    min-height: 200px;
  }

  div#lightbox div#lbPrev,
  div#lightbox div#lbNext {
    top: 86%;
  }

  div#lightbox div#lbPlay {
    top: 86%;
    left: 47.5%;
  }

  /* keep counter placement */
  div#lightbox div#lbCounter {
    top: 55px;
  }

  /* Ensure logo/header images can't widen the page */
  header img {
    max-width: 100%;
    height: auto;
    display: block;
  }
}

/* ---------------------------------------------------------*/
/* Styles for the overlay displaying an image in fullscreen */
/* ---------------------------------------------------------*/

/* Styles for the overlay */
div#lbOverlay {
  position: fixed;
  z-index: 1;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: rgba(101, 83, 60, 0.88);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Styles for the figure box within the overlay */
div#lbOverlay figure {
  display: block;
  width: 80%;
  max-width: 800px;
}

/* Styles for the image within the overlay */
div#lbOverlay figure img {
  display: block;
  margin: auto;
  width: 100%;
  height: auto;
  box-shadow: 5px 5px 20px #3b2a1a;
  animation-name: zoom;
  animation-duration: 1s;
}

/* Styles for the caption within the overlay */
div#lbOverlay figure figcaption {
  text-align: center;
  font-size: 1.25em;
  font-family: Georgia, "Times New Roman", Times, serif;
  color: #F5ECD7;
  margin-top: 10px;
  animation-name: zoom;
  animation-duration: 1s;
}

/* Styles for the overlay close button */
div#lbOverlay div#lbOverlayClose {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #F5ECD7;
  font-size: 40px;
  cursor: pointer;
  user-select: none;
}

/* Hovering styles for the modal window close button */
div#lbOverlay div#lbOverlayClose:hover {
  color: #C8A96E;
  text-shadow: 3px 3px 0px #3b2a1a;
}

/* Keyframe animation for the opening of the modal window figure and caption */
@keyframes zoom {
  from {transform:scale(0)}
  to {transform:scale(1)}
}