/**
 * Styles pour le Hero Levrard Groupe
 * Support: Image, Carrousel, Vidéo (locale/YouTube)
 */

/* ========================================
   STRUCTURE DE BASE
======================================== */

.levrard-hero-groupe {
  position: relative;
  width: 97%;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 30px;
  margin: 0 auto 60px;
}

.hero-groupe-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-groupe-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 2;
  transition: opacity 0.3s ease;
}

.hero-groupe-content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 40px;
  color: var(--levrard-white);
}

.hero-groupe-inner {
  max-width: 800px;
}

/* ========================================
     ALIGNEMENT DU CONTENU
  ======================================== */

.hero-align-left .hero-groupe-content {
  text-align: left;
}

.hero-align-left .hero-groupe-inner {
  margin-left: 0;
  margin-right: auto;
}

.hero-align-center .hero-groupe-content {
  text-align: center;
}

.hero-align-center .hero-groupe-inner {
  margin-left: auto;
  margin-right: auto;
  margin-top: 15%;
}

.hero-align-right .hero-groupe-content {
  text-align: right;
}

.hero-align-right .hero-groupe-inner {
  margin-left: auto;
  margin-right: 0;
}

/* ========================================
     TYPOGRAPHIE
  ======================================== */

.hero-groupe-title {
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
  margin: 0 0 20px 0;
  text-transform: uppercase;
  color: var(--levrard-white);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-groupe-baseline {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 30px 0;
  color: var(--levrard-white);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
}

.hero-groupe-description {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.5;
  margin: 0 0 40px 0;
  color: var(--levrard-white);
  opacity: 0.95;
}

.hero-groupe-cta {
  display: inline-block;
}

/* ========================================
     BACKGROUND : IMAGE UNIQUE
  ======================================== */

.hero-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* ========================================
     BACKGROUND : CARROUSEL
  ======================================== */

.hero-bg-carousel {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.hero-carousel-slide.active {
  opacity: 1;
}

/* ========================================
     BACKGROUND : VIDÉO
  ======================================== */

.hero-bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-bg-video video,
.hero-bg-youtube iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
}

/* YouTube iframe full cover */
.hero-bg-youtube iframe {
  width: 100vw;
  height: 56.25vw; /* 16:9 aspect ratio */
  min-height: 100vh;
  min-width: 177.77vh; /* 16:9 aspect ratio */
}

/* ========================================
     RESPONSIVE DESKTOP
  ======================================== */

@media screen and (max-width: 1400px) {
  .hero-groupe-title {
    font-size: 64px;
  }

  .hero-groupe-baseline {
    font-size: 24px;
  }

  .hero-groupe-description {
    font-size: 18px;
  }
}

@media screen and (max-width: 1200px) {
  .hero-groupe-content {
    padding: 50px 30px;
  }

  .hero-groupe-title {
    font-size: 56px;
  }

  .hero-groupe-baseline {
    font-size: 22px;
  }
}

@media screen and (max-width: 992px) {
  .levrard-hero-groupe {
    border-radius: 20px;
    min-height: 400px;
  }

  .hero-groupe-content {
    padding: 40px 25px;
  }

  .hero-groupe-title {
    font-size: 48px;
  }

  .hero-groupe-baseline {
    font-size: 20px;
    margin-bottom: 25px;
  }

  .hero-groupe-description {
    font-size: 16px;
    margin-bottom: 30px;
  }
}

/* ========================================
     RESPONSIVE MOBILE
  ======================================== */

@media screen and (max-width: 768px) {
  .levrard-hero-groupe {
    border-radius: 15px;
    min-height: 500px;
    margin-bottom: 40px;
  }

  .hero-groupe-content {
    padding: 30px 20px;
    text-align: center !important;
  }

  .hero-groupe-inner {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .hero-groupe-title {
    font-size: 40px;
    margin-bottom: 15px;
  }

  .hero-groupe-baseline {
    font-size: 18px;
    margin-bottom: 20px;
  }

  .hero-groupe-description {
    font-size: 15px;
    margin-bottom: 25px;
  }

  .hero-groupe-cta {
    display: block;
  }

  .hero-groupe-cta .u-cta {
    display: flex;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
  }
}

@media screen and (max-width: 576px) {
  .levrard-hero-groupe {
    border-radius: 10px;
    min-height: 450px;
  }

  .hero-groupe-content {
    padding: 25px 15px;
  }

  .hero-groupe-title {
    font-size: 32px;
  }

  .hero-groupe-baseline {
    font-size: 16px;
    margin-bottom: 15px;
  }

  .hero-groupe-description {
    font-size: 14px;
    margin-bottom: 20px;
  }
}

/* ========================================
     ÉDITEUR GUTENBERG
  ======================================== */

.block-editor-block-list__block[data-type="acf/levrard-group-hero"] {
  margin-bottom: 40px;
}

.block-editor-block-list__block .levrard-hero-groupe {
  border: 2px dashed rgba(231, 51, 49, 0.3);
}

/* Preview simplifiée dans l'éditeur */
.hero-groupe-preview {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f5;
  border: 2px dashed #ddd;
  border-radius: 20px;
  text-align: center;
  padding: 40px 20px;
}

.hero-groupe-preview img {
  max-width: 100%;
  max-height: 350px;
  object-fit: cover;
  border-radius: 10px;
}

/* ========================================
     ANIMATIONS & EFFETS
  ======================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.levrard-hero-groupe .hero-groupe-title,
.levrard-hero-groupe .hero-groupe-baseline,
.levrard-hero-groupe .hero-groupe-description,
.levrard-hero-groupe .hero-groupe-cta {
  animation: fadeIn 0.8s ease-out forwards;
}

.levrard-hero-groupe .hero-groupe-title {
  animation-delay: 0.1s;
}

.levrard-hero-groupe .hero-groupe-baseline {
  animation-delay: 0.2s;
}

.levrard-hero-groupe .hero-groupe-description {
  animation-delay: 0.3s;
}

.levrard-hero-groupe .hero-groupe-cta {
  animation-delay: 0.4s;
}

/* Effet hover sur le background image */
.hero-bg-image {
  transition: transform 20s ease-out;
}

.levrard-hero-groupe:hover .hero-bg-image {
  transform: scale(1.05);
}

/* Désactiver les animations si prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .levrard-hero-groupe * {
    animation: none !important;
    transition: none !important;
  }

  .hero-carousel-slide {
    transition: opacity 0.3s ease !important;
  }
}

/* ========================================
     ACCESSIBILITÉ
  ======================================== */

.levrard-hero-groupe:focus-within {
  outline: 3px solid var(--levrard-red);
  outline-offset: 5px;
}

.hero-groupe-cta .u-cta:focus {
  outline: 3px solid var(--levrard-white);
  outline-offset: 3px;
}

/* Contraste élevé pour les textes */
@media (prefers-contrast: high) {
  .hero-groupe-title,
  .hero-groupe-baseline,
  .hero-groupe-description {
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.8);
  }

  .hero-groupe-overlay {
    opacity: 0.7 !important;
  }
}
