/*** Video Gallery ***/
.video-gallery,
.video-gallery * {
  box-sizing: border-box;
}

.video-gallery {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  margin-left: -1rem;
  margin-right: -1rem;
}

.video-gallery--one-col-sm .video-gallery__video-wrapper { width: 100%; }
.video-gallery--two-col-sm .video-gallery__video-wrapper { width: 50%; }

/* Wrapper */
.video-gallery__video-wrapper {
  padding: 1rem;
}

.video-gallery__video { 
  overflow: hidden;
}

/* Thumbnail */
.video-gallery__video-thumbnail {
  aspect-ratio: 16 / 9;
  background-color: #f9f9f9;
  overflow: hidden;
  position: relative;
}

.video-gallery__video-thumbnail img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

/* Category */
.video-gallery__category {
  background-color: #ffffff;
  font-size: 0.75rem;
  padding: 0.125rem 0.25rem;
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
}

.video-gallery__category.show-on-hover {
  opacity: 0;
  transform: translateY(0.25rem);
  transition: opacity 0.3s, transform 0.3s;
}

.video-gallery__video:hover .video-gallery__category.show-on-hover,
.video-gallery__video:focus .video-gallery__category.show-on-hover,
.video-gallery__video:active .video-gallery__category.show-on-hover {
  opacity: 1;
  transform: none;
}

/* Duration */
.video-gallery__duration {
  background-color: #ffffff;
  font-size: 0.75rem;
  padding: 0.125rem 0.25rem;
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
}

.video-gallery__duration.show-on-hover {
  opacity: 0;
  transform: translateY(0.25rem);
  transition: opacity 0.3s, transform 0.3s;
}

.video-gallery__video:hover .video-gallery__duration.show-on-hover,
.video-gallery__video:focus .video-gallery__duration.show-on-hover,
.video-gallery__video:active .video-gallery__duration.show-on-hover {
  opacity: 1;
  transform: none;
}

/* Play Button */
.video-gallery__play-button {
  align-items: center;
  background: none;
  border: none;
  border-radius: 0;
  color: initial;
  cursor: pointer;
  display: flex;
  font-family: inherit;
  font-size: inherit;
  font-style: inherit;
  font-weight: inherit;
  height: 100%;
  justify-content: center;
  left: 0;
  letter-spacing: inherit;
  line-height: inherit;
  margin-bottom: 0;
  padding: 0;
  position: absolute;
  text-align: left;
  text-decoration: none;
  top: 0;
  transition: none;
  width: 100%;
}

.video-gallery__play-icon {
  align-items: center;
  aspect-ratio: 1 / 1;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  height: 3rem;
  justify-content: center;
  padding: 0.875rem;
  width: 3rem;
}

.video-gallery__play-icon.show-on-hover {
  opacity: 0;
  transform: translateY(0.25rem);
  transition: opacity 0.3s, transform 0.3s;
}

.video-gallery__video:hover .video-gallery__play-icon.show-on-hover,
.video-gallery__video:focus .video-gallery__play-icon.show-on-hover,
.video-gallery__video:active .video-gallery__play-icon.show-on-hover {
  opacity: 1;
  transform: none;
}

.video-gallery__play-icon:hover,
.video-gallery__play-icon:focus,
.video-gallery__play-icon:active {
  background-color: rgba(255, 255, 255, 1);
}

.video-gallery__play-icon svg {}

.video-gallery__hubspot-video {
  display: none;
  opacity: 0;
  visibility: hidden;
}

.video-gallery__open-video {
  cursor: pointer;
}

/* Details */
.video-gallery__details {
  padding-top: 1rem;
}

/* Title */
.video-gallery__title {
  margin-bottom: 0.5rem;
}

/* Upload Date */
.video-gallery__upload-date {
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

/* No Button */
.video-gallery .video-gallery--no-button,
.video-gallery .video-gallery--no-button:hover,
.video-gallery .video-gallery--no-button:focus,
.video-gallery .video-gallery--no-button:active {
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: initial;
  font-family: inherit;
  font-size: inherit;
  font-style: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  margin-bottom: 0;
  padding: 0;
  text-align: left;
  text-decoration: none;
  transition: none;
}

/*** Video Popup ***/

.video-gallery__popup {
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  height: 100%;
  left: 0;
  opacity: 0;
  position: fixed;
  top: 0;
  visibility: hidden;
  width: 100%;
  z-index: 100000;
}

.video-gallery__popup.is-open {
  display: block;
  opacity: 1;
  visibility: visible;
}

.video-gallery__popup-video {
  height: 100%;
  padding: 1rem;
  width: 100%;
}

/* Responsive iFrames - mainly for Vimeo/YouTube */

#videoGalleryPopupVideo {
  display: inline-block;
  height: auto;
  left:  50%;
  position: absolute;
  top:  50%;
  transform: translate(-50%, -50%);
  width: 100%;
}

#vimeoPlayer,
#youtubePlayer {
  height: 0;
  position: relative;
}

#vimeoPlayer > iframe,
#youtubePlayer > iframe {
  height: 100%;
  left: 0;
  margin: 0 auto;
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
}

#videoGalleryPopupVideo iframe {
  background-color: #000000;
  transition: all 0.15s;
}

/* Popup - HubSpot File */

.video-gallery__popup-video--hubspot-file {
  align-items: center;
  display: flex;
  justify-content: center;
}

.video-gallery__popup-video--hubspot-file video {
  height: auto;
  width: 100%;
}

/* Popup - HubSpot Video */

.video-gallery__popup-video--hubspot-video .hs-video-container {
  height: auto;
}

/* Popup - YouTube */

.video-gallery__popup-video--youtube {
  align-items: center;
  display: flex;
  justify-content: center;
}

/* Popup - Vimeo */

.video-gallery__popup-video--vimeo {
  align-items: center;
  display: flex;
  justify-content: center;
}

/* Video Orientation - Horizontal */

.video-gallery__popup--horizontal video,
.video-gallery__popup--horizontal .hs-video-container,
.video-gallery__popup--horizontal #videoGalleryPopupVideo {
  max-width: 800px;
}

.video-gallery__popup--horizontal .hs-video-wrapper,
.video-gallery__popup--horizontal #vimeoPlayer,
.video-gallery__popup--horizontal #youtubePlayer {
  padding-bottom: 56.25%; !important;
}

/* Video Orientation - Vertical */

.video-gallery__popup--vertical video,
.video-gallery__popup--vertical .hs-video-container,
.video-gallery__popup--vertical #videoGalleryPopupVideo {
  max-width: 320px;
}

.video-gallery__popup--vertical .hs-video-wrapper,
.video-gallery__popup--vertical #vimeoPlayer,
.video-gallery__popup--vertical #youtubePlayer {
  padding-bottom: 177.777777778% !important;
}

/* Popup - Close Button */

.video-gallery__close-button {
  position: absolute;
  right: 1rem;
  top: 1rem;
}

.video-gallery__close-button svg {
  fill: #ffffff;
}

/* Body - prevent scroll when video is open */

body.video-gallery__popup-open {
  overflow: hidden;
}

/* For content that needs to be visually hidden but stay visible for screenreaders */

.video-gallery__show-for-sr {
  border: 0 !important;
  clip: rect(0, 0, 0, 0) !important;
  height: 1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  white-space: nowrap !important;
  width: 1px !important;
}

/* Media Queries */
@media (min-width: 768px) {
  .video-gallery--one-col-md .video-gallery__video-wrapper { width: 100%; }
  .video-gallery--two-col-md .video-gallery__video-wrapper { width: 50%; }
  .video-gallery--three-col-md .video-gallery__video-wrapper { width: 33.3333333333%; }
  .video-gallery--four-col-md .video-gallery__video-wrapper { width: 25%; }
}

@media (min-width: 992px) {
  .video-gallery--one-col-lg .video-gallery__video-wrapper { width: 100%; }
  .video-gallery--two-col-lg .video-gallery__video-wrapper { width: 50%; }
  .video-gallery--three-col-lg .video-gallery__video-wrapper { width: 33.3333333333%; }
  .video-gallery--four-col-lg .video-gallery__video-wrapper { width: 25%; }
  .video-gallery--five-col-lg .video-gallery__video-wrapper { width: 20%; }
  .video-gallery--six-col-lg .video-gallery__video-wrapper { width: 16.66666666666%; }
}