/* ==========================================================================
   SECTION 11: EV CAROUSEL (Vidéos Éducatives)
   ========================================================================== */
/* --- Carousel Wrap (Mapbox: .carousel-wrap) --- */
.ev-section {
  --ev-cyan: var(--cyan);
  --ev-cyan-glow: var(--cyan-glow);
  --ev-bg: #070707;
  --ev-elevated: #111;
  background-color: var(--ev-bg);
  color: #fff;
  padding: var(--pad-y) var(--pad-x);
  position: relative;
  overflow-x: clip;
}
.ev-header { max-width: 1472px; margin: 0 auto 48px; }
.ev-eyebrow { color: var(--ev-cyan); }
.ev-accent { margin: 0 0 24px; }
.ev-heading { font-family: var(--font-display); font-size: clamp(32px, 6vw, 56px); font-weight: 700; color: #fff; line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 14px; max-width: 650px; }
.ev-body { font-size: 15px; line-height: 1.6; color: var(--text-secondary); max-width: 500px; margin: 0; }

/* --- Stage: Mapbox .carousel-wrap + .carousel combined --- */
.ev-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Track: Mapbox .carousel — the perspective container --- */
.ev-track {
  perspective: 750px;
  flex-direction: row;
  flex: none;
  justify-content: center;
  align-items: stretch;
  width: 720px;
  height: 420px;
  max-height: 420px;
  display: flex;
  position: relative;
  transform: translate(0);
  margin: 0 auto;
}

/* --- Cards: Mapbox .home-carousel-slide + .carousel-item --- */
.ev-card {
  position: absolute;
  top: 0;
  left: 0;
  backface-visibility: hidden;
  perspective: 2000px;
  text-align: left;
  width: 720px;
  max-width: 66vw;
  height: 100%;
  max-height: 420px;
  border-radius: 15px;
  overflow: hidden;
  background: var(--ev-elevated);
  transition: box-shadow .4s, color 50ms;
  will-change: transform, z-index, opacity, visibility;
  box-shadow: 0 0 100px 50px #0e1012;
  pointer-events: none;
}
/* Active card: pointer-events + hide text so video + play button dominate */
.ev-card.is-active { pointer-events: auto; }
.ev-card.is-active .ev-card__content { opacity: 0; transition: opacity 0.4s ease; }
.ev-card.is-active .ev-card__overlay { opacity: 0.3; }

/* Play button: Mapbox .home-carousel-video-lightbox pattern */
.ev-card__play { z-index: 4; transition: transform .5s cubic-bezier(.19,1,.22,1), color 50ms; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(.9); width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,0.15); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 2px solid rgba(255,255,255,0.3); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ev-card__play-icon { width: 0; height: 0; border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 4px; }
.ev-card__play:hover { transform: translate(-50%,-50%) scale(1); background: rgba(255,255,255,0.25); }

/* --- Card media: Mapbox .home-carousel-slide-img --- */
.ev-card__media { position: absolute; inset: 0; z-index: 1; }
.ev-card__media img, .ev-card__media video { object-fit: contain; width: 100%; height: 100%; position: absolute; inset: 0; display: block; background: #000; }

/* --- Card overlay: Mapbox .home-carousel-slide-overlay --- */
/* Fix 4: Overlay — exact Mapbox values, stays on ALL cards */
.ev-card__overlay {
  width: 100%; height: 100%;
  pointer-events: none;
  background-image: linear-gradient(90deg, #000, #00000080);
  transition: opacity 1s cubic-bezier(.19,1,.22,1), box-shadow .4s;
  position: absolute; inset: 0%;
  border-radius: 15px;
  box-shadow: inset 0 -175px 175px -75px #0e1012;
  z-index: 2;
}

/* --- Card content: Mapbox .home-carousel-slide-in --- */
/* Fix 5: Content — NO gradient, space-between, Mapbox padding */
.ev-card__content {
  flex-direction: column; flex: 1;
  justify-content: space-between;
  padding: 24px;
  display: flex;
  position: relative;
  border-radius: 15px;
  z-index: 3;
}
.ev-card__num { color: var(--ev-cyan); font-family: var(--font-display); font-size: 48px; font-weight: 800; opacity: 0.15; position: absolute; top: 20px; right: 24px; }
.ev-card__tag { color: var(--ev-cyan); font-size: var(--tag-size); text-transform: uppercase; letter-spacing: var(--tag-spacing); margin-bottom: 8px; }
.ev-card__title { color: #fff; font-family: var(--font-display); font-size: 20px; font-weight: 700; margin: 0 0 6px; line-height: 1.25; }
.ev-card__desc { color: var(--text-secondary); font-size: 13px; line-height: 1.55; margin: 0; }

/* --- Focus overlay: Mapbox .carousel-focus.slider-focus --- */
.ev-focus { width: 100%; position: absolute; inset: 0; z-index: -1; opacity: 0.3; }

/* --- Navigation: Mapbox .carousel-nav --- */
.ev-nav { z-index: 1; grid-column-gap: 4px; grid-template-rows: auto; grid-template-columns: 1fr 1fr; grid-auto-columns: 1fr; display: grid; position: relative; margin-top: 32px; justify-content: center; }
.ev-btn { width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: center; cursor: pointer; color: rgba(255,255,255,0.5); transform-style: preserve-3d; transition: background-color 50ms, transform .2s, color 50ms; flex: none; padding: 0; }
.ev-btn:hover { color: #fff; transform: scale(1.1); background: rgba(255,255,255,0.1); }
.ev-btn--prev { justify-self: end; padding-right: 4px; }
.ev-btn--next { justify-self: start; padding-left: 4px; }
.ev-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* --- Mobile: hide desktop carousel, show clean scroll-snap --- */
@media (max-width: 767px) {
  .ev-stage,
  .ev-nav { display: none !important; }
}
/* Mobile-only EV carousel */
.ev-mobile {
  display: none;
}
@media (max-width: 767px) {
  .ev-mobile {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
    padding: 0 20px;
  }
  .ev-mobile::-webkit-scrollbar { display: none; }
  .ev-mobile__card {
    flex: 0 0 85%;
    scroll-snap-align: center;
    margin-right: 14px;
    border-radius: var(--radius-card-sm);
    overflow: hidden;
    background: #111;
  }
  .ev-mobile__card:last-child { margin-right: 20px; }
  .ev-mobile__media {
    width: 100%;
    aspect-ratio: 16 / 10;
    position: relative;
    overflow: hidden;
  }
  .ev-mobile__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  /* Play button — frosted glass circle */
  .ev-mobile__play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 56px; height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.35);
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    z-index: 2;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
  }
  .ev-mobile__play:active {
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0,229,255,0.25);
    border-color: var(--cyan);
  }
  .ev-mobile__play svg {
    width: 22px; height: 22px;
    margin-left: 2px;
  }

  /* Portrait fullscreen overlay — black bg, video centered */
  .ev-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: evFadeIn 0.25s ease;
  }
  @keyframes evFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  .ev-fullscreen video {
    width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
  .ev-fullscreen__close {
    position: absolute;
    top: env(safe-area-inset-top, 16px);
    right: 16px;
    margin-top: 16px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .ev-fullscreen__close::before,
  .ev-fullscreen__close::after {
    content: '';
    position: absolute;
    width: 18px; height: 2px;
    background: #fff;
    border-radius: 1px;
  }
  .ev-fullscreen__close::before { transform: rotate(45deg); }
  .ev-fullscreen__close::after { transform: rotate(-45deg); }
  /* Duration badge */
  .ev-mobile__duration {
    position: absolute;
    bottom: 8px; right: 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
  }
  .ev-mobile__text {
    padding: 20px;
  }
  .ev-mobile__tag {
    font-size: var(--tag-size);
    font-weight: var(--tag-weight);
    letter-spacing: var(--tag-spacing);
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 6px;
  }
  .ev-mobile__title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 6px;
  }
  .ev-mobile__desc {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
  }
  .ev-mobile__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
  }
  .ev-mobile__dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    cursor: pointer; padding: 0;
    transition: all 0.3s ease;
  }
  .ev-mobile__dot.active {
    background: var(--cyan);
    width: 24px;
    border-radius: 4px;
  }
}
/* --- Tablet (Mapbox responsive overrides) --- */
@media (min-width: 768px) {
  .ev-track { max-height: 49.28vw; }
  .ev-card { max-height: 49.28vw; }
  .ev-track, .ev-card { min-height: 225px; }
  .ev-card__content { padding: 36px; }
}
/* --- Desktop --- */
@media (min-width: 1024px) {
  .ev-card { max-width: 66vw; }
  .ev-card__title { font-size: 24px; }
  .ev-card__content { padding: 54px; }
}
/* --- Wide --- */
@media (min-width: 1200px) {
}


