.yt-video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.yt-video-container iframe {
  border: 0;
}
.material-card:has(.yt-video-container) {
  margin-bottom: 1.875rem;
}

.yt-video-with-poster,
.yt-poster,
.yt-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.25s ease;
}

.yt-poster {
  opacity: 1;
  z-index: 2;
  cursor: pointer;
}

.yt-video-with-poster {
  opacity: 0;
  z-index: 1;
}

.yt-video-container.playing .yt-poster {
  opacity: 0;
  pointer-events: none;
}

.yt-video-container.playing .yt-video-with-poster {
  opacity: 1;
}

.yt-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yt-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  z-index: 9999;
  pointer-events: none;
}

.yt-play-icon::before {
  content: "";
  margin-left: 6px;
  border-left: 18px solid #fff;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
}

.yt-loader {
  position: absolute;
  inset: 0;
  background: #000;
  display: none;
  z-index: 5;
}

.yt-video-container.loading .yt-loader {
  display: block;
}