/**
 * YouTube Facade - Styles
 * Design identique à un vrai player YouTube
 */

.youtube-facade {
  position: relative;
  width: 100%;
  max-width: 920px;
  aspect-ratio: 920 / 420; /* Ratio 16:9 environ */
  cursor: pointer;
  overflow: hidden;
  background-color: var(--neutral);
  border-radius: 0; /* Ajuster selon votre design */
  transition: transform 0.2s ease;
}

.youtube-facade:hover {
  transform: scale(1.02);
}

.youtube-facade:focus {
  outline: 3px solid #ff0000;
  outline-offset: 2px;
}

/* Image de preview */
.youtube-facade__thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
  width: 100% !important;
}

.youtube-facade:hover .youtube-facade__thumbnail {
  opacity: 0.85;
}

/* Bouton play YouTube */
.youtube-facade__play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 1;
  transition:
    transform 0.2s ease,
    opacity 0.3s ease;
  opacity: 0.9;
}

.youtube-facade:hover .youtube-facade__play-btn {
  transform: translate(-50%, -50%) scale(1.1);
  opacity: 1;
}

.youtube-facade__play-btn svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Animation au clic */
.youtube-facade:active {
  transform: scale(0.98);
}

/* Responsive */
@media (max-width: 920px) {
  .youtube-facade {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .youtube-facade__play-btn {
    width: 54px;
    height: 38px;
  }
}

/* Accessibilité : indiquer que c'est cliquable */
.youtube-facade {
  -webkit-tap-highlight-color: transparent;
}

/* Loading state optionnel */
.youtube-facade.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
