/**
 * Component: Video
 * ================
 * Section vidéo avec player responsive
 */

.video-section {
  padding-block: var(--section-padding);
  background-color: var(--color-bg-alt);
}

.video-section__container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--container-padding);
}

/* Header */
.video-section__header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.video-section__subtitle {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.video-section__title {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

.video-section__description {
  font-size: var(--text-lg);
  color: var(--color-text-light);
  max-width: 700px;
  margin: 0 auto;
}

/* Video wrapper */
.video-section__wrapper {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  background-color: var(--color-black);
}

/* Aspect ratio 16:9 */
.video-section__aspect {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
}

/* Video/iframe */
.video-section__player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-section__player iframe,
.video-section__player video {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Video natif HTML5 */
.video-section__player video {
  object-fit: cover;
  background-color: var(--color-black);
}

/* Play button overlay (pour vidéos HTML5) */
.video-section__play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: background var(--transition-base);
  z-index: 1;
}

.video-section__play-overlay:hover {
  background: rgba(0, 0, 0, 0.5);
}

.video-section__play-overlay.hidden {
  display: none;
}

.video-section__play-button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 4px solid var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.video-section__play-overlay:hover .video-section__play-button {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
}

.video-section__play-icon {
  width: 32px;
  height: 32px;
  color: var(--color-white);
  margin-left: 4px; /* Centrage visuel du triangle */
}

/* Loading state */
.video-section__loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--color-white);
  font-size: var(--text-lg);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .video-section__title {
    font-size: var(--text-3xl);
  }

  .video-section__play-button {
    width: 60px;
    height: 60px;
  }

  .video-section__play-icon {
    width: 24px;
    height: 24px;
  }
}

/* ========================================
   ANIMATIONS
   ======================================== */

.video-section__wrapper {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s var(--ease-out);
}

.video-section__wrapper.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   PRINT
   ======================================== */

@media print {
  .video-section {
    display: none;
  }
}

/* Support multi-vidéos */
#videoContainer {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.video__wrapper {
  width: 100%;
}

.video__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a5f7a;
  margin-bottom: 1rem;
  text-align: center;
}

.video-section__aspect {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* Ratio 16:9 */
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.video__iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
}

@media (max-width: 768px) {
  #videoContainer {
    gap: 2rem;
  }
  
  .video__title {
    font-size: 1.25rem;
  }
}