/* =========================================================
   hero.css
   HERO CEMID (INDEX UNIQUEMENT) - FORMAT RECTANGULAIRE MOBILE
   - rectangle panoramique arrondi sur TOUS les appareils
   - ratio 1900:800 (2.375:1) = format paysage même sur mobile
   - animations (glow + grain + kenburns)
   - slider avec opacity + dots + flèches
   ========================================================= */

.hero{
  padding: 32px 0 70px;
  margin-top: 80px;       /* laisse la place à la navbar fixed */
  background: transparent;
}

/* conteneur du hero (reste dans la largeur du site) */
.hero-container{
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* cadre arrondi avec ratio 1900:800 = 2.375:1 TOUJOURS préservé */
.hero-frame{
  position: relative;
  width: 100%;
  
  /* Ratio 1900:800 = aspect-ratio 2.375 / 1 - FORMAT PAYSAGE */
  aspect-ratio: 2.375 / 1;
  
  /* Hauteurs maximales par taille d'écran */
  max-height: 540px;
  min-height: 180px; /* hauteur minimum pour mobile */
  
  border-radius: 32px;
  overflow: hidden;

  background: linear-gradient(135deg, rgba(0,51,204,0.08), rgba(255,215,0,0.06));
  border: 1px solid rgba(0,51,204,0.10);
  box-shadow: 0 22px 70px rgba(15,23,42,0.12);

  transform: translateZ(0);
}

/* glow animé (derrière l'image) */
.hero-frame::before{
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,215,0,0.22), transparent 35%),
    radial-gradient(circle at 80% 30%, rgba(0,51,204,0.18), transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(255,215,0,0.12), transparent 45%);
  filter: blur(30px);
  animation: heroGlow 10s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes heroGlow{
  0%,100%{ transform: translate3d(0,0,0) scale(1); }
  50%{ transform: translate3d(2%, -2%, 0) scale(1.06); }
}

/* grain léger */
.hero-frame::after{
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
  opacity: .12;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 4;
}

/* slider */
.hero-slider{
  position: absolute;
  inset: 0;
  z-index: 2;
}

.hero-slide{
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-slide.active{
  opacity: 1;
}

/* image plein cadre (aucune bande noire) */
.hero-image{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;

  transform: scale(1.02);
  animation: kenBurns 10s ease-in-out infinite;
}

@keyframes kenBurns{
  0%,100%{ transform: scale(1.02) translate3d(0,0,0); }
  50%{ transform: scale(1.08) translate3d(-1.5%, -1%, 0); }
}

/* overlay neutre (0 noir) : garde juste un léger "shine" */
.hero-overlay{
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,0.20), transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(255,215,0,0.10), transparent 55%);
  pointer-events: none;
  z-index: 3;
}

/* dots */
.hero-controls{
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;

  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(15,23,42,0.10);
  z-index: 6;
}

.hero-dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(15,23,42,0.22);
  cursor: pointer;
  transition: all .25s ease;
}

.hero-dot.active{
  width: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg,#ffd700 0%,#ffed4e 100%);
  box-shadow: 0 10px 22px rgba(255,215,0,0.25);
}

/* flèches */
.hero-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;

  background: rgba(255,255,255,0.55);
  color: #0f172a;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  backdrop-filter: blur(14px);
  box-shadow: 0 10px 26px rgba(15,23,42,0.10);
  transition: all .25s ease;
  z-index: 6;
}

.hero-nav:hover{
  transform: translateY(-50%) scale(1.06);
  background: linear-gradient(135deg,#ffd700 0%,#ffed4e 100%);
  color: #0033cc;
}

.hero-prev{ left: 14px; }
.hero-next{ right: 14px; }

/* ===== RESPONSIVE - GARDE LE FORMAT RECTANGULAIRE ===== */

/* Large Desktop (1440px+) */
@media (min-width: 1441px){
  .hero-frame{
    max-height: 540px;
  }
}

/* Desktop standard (1024px - 1440px) */
@media (max-width: 1440px){
  .hero-frame{
    max-height: 500px;
  }
}

/* Tablette landscape (768px - 1024px) */
@media (max-width: 1024px){
  .hero-frame{
    max-height: 400px; /* Réduit mais garde le ratio */
    border-radius: 28px;
  }
  .hero-nav{
    width: 42px;
    height: 42px;
  }
}

/* Tablette portrait & Mobile large (600px - 768px) */
@media (max-width: 768px){
  .hero{
    padding: 24px 0 40px;
    margin-top: 70px;
  }
  .hero-container{
    padding: 0 16px;
  }
  .hero-frame{
    /* GARDE LE RATIO 2.375:1 - Format rectangulaire panoramique */
    max-height: 280px;
    min-height: 160px;
    border-radius: 24px;
  }
  
  /* Garde les flèches sur tablette */
  .hero-nav{
    width: 38px;
    height: 38px;
  }
  .hero-prev{ left: 10px; }
  .hero-next{ right: 10px; }
  
  .hero-controls{
    bottom: 12px;
  }
}

/* Mobile (480px - 600px) */
@media (max-width: 600px){
  .hero-frame{
    /* TOUJOURS rectangulaire - ratio 2.375:1 préservé */
    max-height: 240px;
    min-height: 140px;
    border-radius: 20px;
  }
  
  /* Cache les flèches sur mobile, garde les dots */
  .hero-nav{
    display: none;
  }
  
  .hero-controls{
    bottom: 10px;
    padding: 8px 12px;
    gap: 8px;
  }
}

/* Mobile standard (375px - 480px) */
@media (max-width: 480px){
  .hero{
    padding: 20px 0 40px;
    margin-top: 65px;
  }
  .hero-container{
    padding: 0 12px;
  }
  .hero-frame{
    /* Format rectangulaire panoramique maintenu */
    max-height: 220px;
    min-height: 130px;
    border-radius: 18px;
  }
  
  .hero-controls{
    bottom: 8px;
    padding: 6px 10px;
  }
}

/* Petit mobile (320px - 375px) */
@media (max-width: 375px){
  .hero-container{
    padding: 0 10px;
  }
  .hero-frame{
    /* Même sur petit écran = rectangulaire */
    max-height: 200px;
    min-height: 120px;
    border-radius: 16px;
  }
  
  .hero-controls{
    gap: 6px;
    padding: 6px 10px;
  }
  .hero-dot{
    width: 8px;
    height: 8px;
  }
  .hero-dot.active{
    width: 18px;
  }
}

/* Très petit mobile (< 320px) */
@media (max-width: 320px){
  .hero-frame{
    max-height: 180px;
    min-height: 110px;
    border-radius: 14px;
  }
}

/* ===== FALLBACK POUR NAVIGATEURS SANS ASPECT-RATIO ===== */
@supports not (aspect-ratio: 2.375 / 1) {
  .hero-frame{
    height: 0;
    padding-bottom: 42.105%; /* 800/1900 = 42.105% - RATIO PRÉSERVÉ */
    max-height: none;
  }
  
  .hero-slider{
    position: absolute;
    inset: 0;
  }
}

/* ===== OPTIMISATIONS PERFORMANCE ===== */
.hero-frame,
.hero-slide,
.hero-image{
  will-change: transform;
}

/* Désactive les animations si l'utilisateur préfère */
@media (prefers-reduced-motion: reduce){
  .hero-frame::before,
  .hero-image{
    animation: none;
  }
  
  .hero-slide{
    transition: opacity 0.3s ease;
  }
  
  .hero-dot,
  .hero-nav{
    transition: all 0.15s ease;
  }
}

/* ===== AMÉLIORATION VISUELLE ===== */
/* Bordure subtile qui s'illumine au survol du hero */
.hero-frame{
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.hero-frame:hover{
  border-color: rgba(0,51,204,0.18);
  box-shadow: 
    0 22px 70px rgba(15,23,42,0.14),
    0 0 0 1px rgba(0,51,204,0.05) inset;
}

/* Amélioration des dots - meilleure visibilité */
.hero-dot:hover:not(.active){
  background: rgba(15,23,42,0.40);
  transform: scale(1.15);
}

/* Animation d'entrée pour le hero */
@keyframes heroFadeIn{
  from{
    opacity: 0;
    transform: translateY(20px);
  }
  to{
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-frame{
  animation: heroFadeIn 0.8s ease-out;
}

/* Accessibilité - focus visible sur les contrôles */
.hero-dot:focus-visible,
.hero-nav:focus-visible{
  outline: 3px solid rgba(0,51,204,0.5);
  outline-offset: 3px;
}

/* ===== FIX SPÉCIAL MOBILE - FORCE LE FORMAT PAYSAGE ===== */
/* Important : empêche le hero de devenir carré sur mobile */
@media (max-width: 768px){
  .hero-frame{
    /* Force explicitement le ratio paysage */
    aspect-ratio: 2.375 / 1 !important;
  }
}

/* Sur très petits écrans, on peut légèrement ajuster le ratio pour plus de visibilité */
/* mais on reste toujours en format paysage (jamais carré) */
@media (max-width: 400px){
  .hero-frame{
    /* Ratio légèrement moins large mais toujours paysage (2:1 au lieu de 2.375:1) */
    aspect-ratio: 2.2 / 1;
    max-height: 190px;
  }
}
}