/* Lite YouTube Embed - Facade for lazy loading YouTube videos */

.lite-youtube {
  background-color: #000;
  position: relative;
  display: block;
  contain: content;
  background-position: center center;
  background-size: cover;
  cursor: pointer;
  aspect-ratio: 16/9;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
}

/* Thumbnail background image */
.lite-youtube::before {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  background-image: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.4) 100%);
  height: 100%;
  width: 100%;
  z-index: 1;
}

/* Play button */
.lite-youtube > .lty-playbtn {
  width: 68px;
  height: 48px;
  position: absolute;
  cursor: pointer;
  transform: translate3d(-50%, -50%, 0);
  top: 50%;
  left: 50%;
  z-index: 2;
  background-color: #212121;
  background-color: rgba(33, 33, 33, 0.8);
  border-radius: 14%;
  transition: all 0.2s cubic-bezier(0, 0, 0.2, 1);
}

/* Play button triangle */
.lite-youtube > .lty-playbtn::before {
  content: "";
  border-style: solid;
  border-width: 11px 0 11px 19px;
  border-color: transparent transparent transparent #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-40%, -50%);
}

.lite-youtube > .lty-playbtn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Hover state */
.lite-youtube:hover > .lty-playbtn {
  background-color: #f00;
  opacity: 1;
  transform: translate3d(-50%, -50%, 0) scale(1.1);
}

/* YouTube red play button when activated */
.lite-youtube.lyt-activated {
  cursor: unset;
}

.lite-youtube.lyt-activated > .lty-playbtn {
  opacity: 0;
  pointer-events: none;
}

/* Remove the aspect ratio once iframe is loaded */
.lite-youtube > iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
