/* Video Modal - Theater Mode
-------------------------------------------------------------------------------*/
.video-modal,
.video-modal .overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 300;
}

.video-modal {
  overflow: hidden;
  position: fixed;
  opacity: 0;
  z-index: 9999;
  -webkit-transform: translate(500%, 0%);
  transform: translate(500%, 0%);

  /* using flexbox for vertical centering */

  /* Flexbox display */
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  /* Horizontal alignment */
  -webkit-box-pack: center;
  -moz-box-pack: center;
  -ms-flex-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  /* Vertical alignment */
  -webkit-box-align: center;
  -moz-box-align: center;
  -ms-flex-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-transform-style: preserve-3d;
  -moz-transform-style: preserve-3d;
  transform-style: preserve-3d;
}
.video-modal .overlay {
  z-index: 2;
  position: fixed;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
}

.video-modal-content {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: 3;
  height: auto;
  /*   width: 76%; */
  width: calc(100% - 200px);
  max-width: 1000px;
  max-height: calc(100% - 100px);
  margin: 0 auto;
  overflow-y: visible;
}

/* close button */
.close-video-modal {
  display: block;
  position: absolute;
  right: 0;
  top: -40px;
  cursor: pointer;
}

/* using a 16:9 image to resize the video frame */
.video-sizer {
  display: block;
  width: 100%;
  height: auto;
}

/* set the iframe element to stretch to fit its parent element */
iframe#youtube {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.5);
}

/* show the modal */
/* add class to the body */
.show-video-modal .video-modal {
  opacity: 1;
  transform: translate(0%, 0%);
  -webkit-transform: translate(0%, 0%);
}

.show-video-modal .video-modal .overlay {
  opacity: 1;
}

.show-video-modal .video-modal-content {
  transform: translate(0%, 0%);
  -webkit-transform: translate(0%, 0%);
}

/* Mobile Layout Tweaks */
@media (max-width: 640px) {
  .video-modal-content {
    width: calc(100% - 16px);
  }
}
