/*
 * IA & Marketing Editorial Blocks
 * Vidéo responsive : YouTube, Vimeo et vidéos auto-hébergées.
 */

.iam-video,
.iam-video * {
  box-sizing: border-box;
}

.iam-video {
  width: 100%;
  margin: 2rem 0;
}

.iam-video--align-left {
  text-align: left;
}

.iam-video--align-center {
  text-align: center;
}

.iam-video--align-right {
  text-align: right;
}

/*
 * Cadre commun.
 */
.iam-video__frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid #3a4049;
  border-radius: 12px;
  background: #121316;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.18);
}

/*
 * Les plateformes intégrées sont placées dans un ratio stable.
 */
.iam-video--youtube.iam-video--ratio-16-9 .iam-video__frame,
.iam-video--vimeo.iam-video--ratio-16-9 .iam-video__frame {
  aspect-ratio: 16 / 9;
}

.iam-video--youtube.iam-video--ratio-4-3 .iam-video__frame,
.iam-video--vimeo.iam-video--ratio-4-3 .iam-video__frame {
  aspect-ratio: 4 / 3;
}

.iam-video--youtube.iam-video--ratio-1-1 .iam-video__frame,
.iam-video--vimeo.iam-video--ratio-1-1 .iam-video__frame {
  aspect-ratio: 1 / 1;
}

/*
 * Les iframes doivent couvrir entièrement leur cadre.
 */
.iam-video__iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/*
 * Les vidéos auto-hébergées conservent leur ratio natif.
 * width: 100% leur permet d’occuper tout l’espace horizontal disponible.
 * height: auto évite tout étirement ou recadrage.
 */
.iam-video--self-hosted .iam-video__frame {
  display: block;
  aspect-ratio: auto;
  line-height: 0;
}

.iam-video__player {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border: 0;
  background: #000;
}

/*
 * Légende et crédit.
 */
.iam-video__caption {
  display: block;
  margin-top: 0.7rem;
  color: #c9d1d9 !important;
  font-size: 0.9rem;
  line-height: 1.55;
}

.iam-video__caption-text {
  color: #c9d1d9 !important;
}

.iam-video__credit {
  display: block;
  margin-top: 0.3rem;
  color: #a9d6ff !important;
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .iam-video {
    margin: 1.5rem 0;
  }

  .iam-video__frame {
    border-radius: 10px;
  }

  .iam-video__caption {
    font-size: 0.86rem;
  }
}