/* Bannière « Live » (accueil, sous le hero) — carrousel de 4 visuels.
   Largeur calée sur .page-content (style.css) pour garder les mêmes marges que les rangées. */

.cx-live {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 48px), 1600px);
  height: clamp(170px, 14vw, 220px);
  margin: 0 auto 2.4rem;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0a0f;
  isolation: isolate;
}

.cx-live__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s cubic-bezier(0.23, 1, 0.32, 1), visibility 0s linear 0.9s;
}

.cx-live__slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.9s cubic-bezier(0.23, 1, 0.32, 1), visibility 0s;
}

.cx-live__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.04);
  transition: transform 4s ease-out;
  will-change: transform;
  pointer-events: none;
  user-select: none;
}

.cx-live__slide.is-active .cx-live__img { transform: scale(1); }

/* Voile sombre à gauche pour la lisibilité du texte */
.cx-live__slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(5, 5, 5, 0.9) 0%, rgba(5, 5, 5, 0.6) 32%, rgba(5, 5, 5, 0) 62%);
  pointer-events: none;
}

.cx-live__content {
  position: absolute;
  z-index: 1;
  left: clamp(20px, 3vw, 40px);
  top: 50%;
  transform: translateY(-50%);
  max-width: min(520px, 55%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.cx-live__content > * {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.cx-live__slide.is-active .cx-live__content > * { opacity: 1; transform: none; }
.cx-live__slide.is-active .cx-live__title { transition-delay: 0.08s; }
.cx-live__slide.is-active .cx-live__text { transition-delay: 0.16s; }

/* Étiquette LIVE : bloc rouge plein, façon incrustation TV */
.cx-live__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  background: #e50914;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
}

.cx-live__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: cxLiveBlink 1.2s ease-in-out infinite;
}

@keyframes cxLiveBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.cx-live__title {
  margin: 0;
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #fff;
}

.cx-live__text {
  margin: 0;
  font-size: clamp(0.82rem, 1vw, 0.95rem);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.68);
}

.cx-live__slide[data-live-href] { cursor: pointer; }

.cx-live__slide.is-active .cx-live__actions { transition-delay: 0.22s; }

.cx-live__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.cx-live__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.cx-live__btn svg { width: 14px; height: 14px; }

.cx-live__btn--watch {
  background: rgba(255, 255, 255, 0.95);
  color: #000;
}

.cx-live__btn--watch:hover { background: #fff; transform: translateY(-1px); }

.cx-live__btn--catalog {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cx-live__btn--catalog:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }

.cx-live__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.cx-live__dots {
  position: absolute;
  z-index: 2;
  right: clamp(16px, 2.4vw, 28px);
  bottom: clamp(14px, 1.8vw, 20px);
  display: flex;
  gap: 6px;
}

.cx-live__dots button {
  position: relative;
  width: 18px;
  height: 3px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  overflow: hidden;
  transition: width 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.cx-live__dots button::before {
  /* zone de clic plus large que la barre */
  content: '';
  position: absolute;
  inset: -10px -2px;
}

.cx-live__dots button.is-active { width: 34px; }

.cx-live__dots button.is-active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  border-radius: inherit;
  transform-origin: left;
  animation: cxLiveFill var(--cx-live-delay, 3s) linear forwards;
}

.cx-live.is-paused .cx-live__dots button.is-active::after { animation-play-state: paused; }

@keyframes cxLiveFill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Mêmes largeurs que .page-content / .reco-section aux mêmes points de rupture */
@media (min-width: 1400px) {
  .cx-live { width: min(calc(100% - 56px), 1400px); }
}

/* Bannière basse : la phrase saute pour laisser la place aux boutons */
@media (max-width: 1279px) {
  .cx-live__text { display: none; }
}

@media (max-width: 1023px) {
  .cx-live { width: calc(100% - 32px); }
  .cx-live__content { max-width: 68%; }
}

@media (max-width: 767px) {
  .cx-live {
    height: 150px;
    border-radius: 10px;
    margin-bottom: 1.8rem;
  }
  .cx-live__actions { margin-top: 4px; gap: 6px; }
  .cx-live__btn { height: 32px; padding: 0 14px; font-size: 0.75rem; }
  .cx-live__btn svg { width: 12px; height: 12px; }
  .cx-live__slide::after {
    background: linear-gradient(90deg, rgba(5, 5, 5, 0.88) 0%, rgba(5, 5, 5, 0.55) 45%, rgba(5, 5, 5, 0.1) 80%);
  }
  .cx-live__content { left: 16px; max-width: 75%; gap: 7px; }
  .cx-live__text { display: none; }
  .cx-live__dots { right: 14px; bottom: 12px; }
  .cx-live__dots button { width: 12px; }
  .cx-live__dots button.is-active { width: 22px; }
}

@media (max-width: 479px) {
  .cx-live { width: calc(100% - 28px); height: 140px; }
  .cx-live__content { left: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .cx-live__img,
  .cx-live__slide.is-active .cx-live__img { transform: none; transition: none; }
  .cx-live__dot { animation: none; }
}

/* Mode chaîne : un seul visuel (le sport à l'antenne) + l'événement en cours */
.cx-live.is-channel .cx-live__dots { display: none; }
.cx-live__badge.is-next { background: rgba(255, 255, 255, 0.92); color: #000; }
.cx-live__text.is-event { display: block; color: rgba(255, 255, 255, 0.88); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (max-width: 767px) {
  .cx-live__text.is-event { font-size: 0.78rem; }
}
