lite-youtube {
  background-color: #000;
  position: relative;
  display: block;
  contain: content;
  background-position: center center;
  background-size: cover;
  cursor: pointer;
}

@supports (aspect-ratio: auto) {
  /* gradient */
  lite-youtube::before,
  lite-youtube::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    background: linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.35) 0%,
      rgba(0, 0, 0, 0) 25%,
      rgba(0, 0, 0, 0) 75%,
      rgba(0, 0, 0, 0.35) 100%
    );
    height: 100%;
    width: 100%;
    transition: all 1s cubic-bezier(0, 0, 0.2, 1);
  }

  lite-youtube::after {
    opacity: 0;
    background: linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.1) 0%,
      rgba(0, 0, 0, 0) 20%,
      rgba(0, 0, 0, 0) 80%,
      rgba(0, 0, 0, 0.1) 100%
    );
  }

  lite-youtube:hover::before {
    opacity: 0;
  }

  lite-youtube:hover::after {
    opacity: 1;
  }

  lite-youtube.lyt-activated::before,
  lite-youtube.lyt-activated::after {
    display: none;
  }

  lite-youtube {
    aspect-ratio: 16/9;
  }
}

@supports not (aspect-ratio: auto) {
  /* 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;
  border: 0;
}

/* play button */
lite-youtube > .lty-playbtn {
  display: block;
  width: 6rem;
  height: 6rem;
  position: absolute;
  cursor: pointer;
  transform: translate3d(-50%, -50%, 0);
  top: 50%;
  left: 50%;
  z-index: 1;
  background-color: transparent;
  filter: grayscale(100%);
  transition: all 0.3s cubic-bezier(0, 0, 0.2, 1);
  border: none;
  transform: translate3d(-50%, -50%, 0) scale(0.8);
}

lite-youtube > .lty-playbtn.has-consent {
  transform: translate3d(-50%, -50%, 0) scale(1);
  opacity: 1;
}

lite-youtube > .lty-playbtn svg circle {
  transition: all 0.3s cubic-bezier(0, 0, 0.2, 1);
  fill: #000000;
  fill-opacity: 0.6;
}

lite-youtube:hover > .lty-playbtn {
  transform: translate3d(-50%, -50%, 0) scale(1.1);
}

lite-youtube:active > .lty-playbtn {
  transform: translate3d(-50%, -50%, 0) scale(1);
}

lite-youtube:hover > .lty-playbtn svg circle {
  fill: #00b0ff;
  fill-opacity: 1;
}

lite-youtube:hover > .lty-playbtn,
lite-youtube .lty-playbtn:focus {
  filter: none;
}

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

/* Credit/Cite */
lite-youtube > .lty-cite {
  position: absolute;
  bottom: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 0.25rem 0 0 0;
  color: #ffffff;
  padding: 0.45rem 0.5rem;
  font-style: normal;
  font-size: 11px;
}

.lyt-visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

@keyframes rotating {
  from {
    -ms-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    -webkit-transform: rotate(0deg);
    -o-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  to {
    -ms-transform: rotate(360deg);
    -moz-transform: rotate(360deg);
    -webkit-transform: rotate(360deg);
    -o-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}
