/* YouTube Facade - Lazy Loading */
.youtube-facade {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background-color: #000;
  cursor: pointer;
  overflow: hidden;
}

.youtube-facade__thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.youtube-facade__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 48"><path fill="%23f00" d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.63 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z"/><path fill="%23fff" d="M45 24 27 14v20z"/></svg>') center/contain no-repeat;
  border: none;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.youtube-facade:hover .youtube-facade__play {
  transform: translate(-50%, -50%) scale(1.1);
  filter: brightness(1.2);
}

.youtube-facade--loading .youtube-facade__play {
  display: none;
}

.youtube-facade--loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: youtube-facade-spin 0.8s linear infinite;
}

@keyframes youtube-facade-spin {
  to { transform: rotate(360deg); }
}

/* Fallback message for blocked YouTube */
.youtube-facade__fallback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff;
  padding: 20px;
  display: none;
}

.youtube-facade--error .youtube-facade__play {
  display: none;
}

.youtube-facade--error .youtube-facade__fallback {
  display: block;
}

.youtube-facade__fallback a {
  color: #ff0000;
  text-decoration: underline;
}
