/**
  Customized version of:
  https://cdn.jsdelivr.net/gh/paulirish/lite-youtube-embed@master/src/
*/

lite-youtube {
  position: relative;
  display: block;
  contain: content;
  background-position: center center;
  background-size: cover;
  cursor: pointer;
  filter: saturate(0);
}

/* gradient */
lite-youtube::before {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  height: 60px;
  padding-bottom: 50px;
  width: 100%;
  transition: all 0.2s cubic-bezier(0, 0, 0.2, 1);
}

/* responsive iframe with a 16:9 aspect ratio
  thanks https://css-tricks.com/responsive-iframes/
*/
lite-youtube::after {
  content: "";
  display: block;
  padding-bottom: calc(100% / (16 / 9));
}
lite-youtube > iframe {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

/* play button */
lite-youtube > .lty-playbtn {
  width: 10%;
  height: 20%;
  position: absolute;
  top: 40%;
  left: 45%;
  z-index: 1;
  background: url("data:image/svg+xml,<svg fill='none' stroke-width='0' xmlns='http://www.w3.org/2000/svg' stroke='currentColor' viewBox='0 0 24 24' height='1em' width='1em' style='overflow: visible; color: currentcolor;'><path fill='currentColor' fill-rule='evenodd' d='M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm14.024-.983a1.125 1.125 0 0 1 0 1.966l-5.603 3.113A1.125 1.125 0 0 1 9 15.113V8.887c0-.857.921-1.4 1.671-.983l5.603 3.113Z' clip-rule='evenodd'></path></svg>")
    center no-repeat;
  background-size: cover;
  filter: opacity(75%);
  transition: filter 0.75s cubic-bezier(0, 0, 0.2, 1);
}

/* Post-click styles */
lite-youtube.lyt-activated {
  cursor: unset;
  filter: none;
}
lite-youtube.lyt-activated::before,
lite-youtube.lyt-activated > .lty-playbtn {
  opacity: 0;
  pointer-events: none;
}
