/* css/pages/homepage.css */

#hero-section {
  padding: 0;
  margin: 0;
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  top: -70px;
  margin-left: -50vw; 
  margin-right: -50vw;
  padding-bottom: 2rem;
}

.hero-carousel {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  height: 470px;
  border-radius: 0; /* Suppression des coins arrondis */
  overflow: hidden;
  background-color: var(--clr-bg-card);
  margin: 0;
}

.hero-carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  padding-top: 70px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: #fff;
  display: flex;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.hero-slide::before {
  content: "";
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  filter: blur(12px) brightness(0.4);
  z-index: -1;
}

.hero-slide::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 75%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 20%,
    rgba(0, 0, 0, 0.5) 60%,
    transparent 100%
  );
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hero-slide-content {
  display: grid;
  grid-template-columns: 55% 45%;
  align-items: stretch;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0 5.5%;
  position: relative;
  z-index: 3;
}

.hero-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 2rem;
  padding-bottom: 2rem;
  align-self: start;
}

.hero-info .recommended-title {
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--clr-accent);
}

.hero-info .hero-series-title {
  font-size: 3.3rem;
  font-weight: 800;
  line-height: 1em;
  margin-bottom: 0.8rem;
  color: var(--hero-color, #fff);
  transition: color 0.3s ease, filter 0.3s ease;
}

.hero-info .hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.hero-info .hero-tags .tag {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-info .hero-description {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 90%;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-info .hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-info .hero-cta-button {
  background: rgba(var(--hero-color-rgb), 0.15);
  color: var(--hero-color, #fff);
  border: 2px solid var(--hero-color, #fff);
  text-decoration: none;
  padding: 0.7rem 1.8rem;
  border-radius: 8px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease,
    background-color 0.2s ease, color 0.2s ease;
}

.hero-info .hero-cta-button-anime {
  background: var(--hero-color, var(--clr-primary));
  color: #fff;
  border: 2px solid transparent;
  text-decoration: none;
  padding: 0.7rem 1.8rem;
  border-radius: 8px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease,
    background-color 0.3s ease;
}

.hero-info .hero-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  background-color: var(--hero-color, #fff);
  color: #fff;
}

.hero-info .hero-cta-button-anime:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  filter: brightness(1.1);
}

.hero-info .hero-latest-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 500;
  padding: 0.8rem 0;
  flex-wrap: nowrap; /* Empêche le retour à la ligne */
  min-width: 0;
  position: relative;
  z-index: 5; /* S'assure que le status est devant l'image reco */
}

.hero-info .hero-latest-info .hero-cta-button,
.hero-info .hero-latest-info .hero-cta-button-anime {
  margin: 0;
  white-space: nowrap; /* Empêche le texte de couper sur plusieurs lignes */
  flex-shrink: 0;      /* Empêche le bouton de rétrécir */
  min-width: 0;
}

.hero-info .hero-latest-info .status {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.92rem; /* plus petit */
  opacity: 0.9;
  margin-left: 0.3rem; /* réduit l'espacement */
  white-space: nowrap; /* Empêche le texte de couper */
  flex-shrink: 0;      /* Empêche la déformation */
  min-width: 0;
}

.hero-info .hero-latest-info .status-dot {
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  margin-right: 0.18em;
  vertical-align: middle;
  background-color: #4caf50; /* par défaut vert */
  flex-shrink: 0;
}

.hero-info .hero-latest-info .status-dot.finished {
  background-color: #e53935; /* rouge si fini */
}

.hero-image {
  position: absolute;
  right: 0;
  bottom: -110px;
  width: 45%;
  height: 105%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  pointer-events: none;
}

.hero-image img {
  max-height: 100%;
  max-width: 100%;
  height: auto;
  width: auto;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

/* Navigation */
.hero-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
}
.hero-carousel-arrow:hover {
  background-color: rgba(0, 0, 0, 0.6);
}
.hero-carousel-arrow.prev {
  left: 20px;
}
.hero-carousel-arrow.next {
  right: 20px;
}

.hero-carousel-nav {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.8rem;
  z-index: 10;
}

.hero-nav-dot {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 5em;
  background-color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease, width 0.3s ease;
  overflow: hidden;
}

.hero-nav-dot::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: #fff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0s;
  z-index: 0;
}

.hero-nav-dot.active {
  transform: scale(1.2);
  width: 50px;
}

.hero-nav-dot.active::before {
  animation: fillDot 5s linear forwards;
}

@keyframes fillDot {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

/* --- Réduction taille boutons desktop --- */
.hero-info .hero-latest-info .hero-cta-button,
.hero-info .hero-latest-info .hero-cta-button-anime {
  font-size: 0.9rem;
  padding: 0.6rem 1.8rem;
  border-radius: 0.5rem;
}

/* --- SECTION RESPONSIVE MOBILE --- */
@media (max-width: 992px) {
  .hero-carousel {
    height: 450px;
    min-height: 0;
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
    margin: 0;
  }
  /* CORRECTION : On réactive le fond flou sur mobile */
  .hero-slide::before {
    display: block;
  }

  /* CORRECTION : On réactive le dégradé pour la lisibilité */
  .hero-slide::after {
    opacity: 1;
  }

  .hero-slide-content {
    display: block;
    grid-template-columns: none;
    padding: 0;
    height: 100%;
    position: relative;
  }

  .hero-info {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    padding: 1.5rem;
    padding-bottom: 3rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
    background: none;
    backdrop-filter: none;
  }

  .hero-info .recommended-title,
  .hero-info .hero-description,
  .hero-info .hero-latest-info {
    display: none;
  }

  .hero-info .hero-series-title {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2); /* On peut remettre une ombre légère si besoin */
  }

  .hero-info .hero-tags {
    margin-bottom: 0rem;
  }

  .hero-info .hero-actions {
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: auto;
    margin-bottom: 0;
    gap: 0.7rem;
  }

  .hero-info .hero-actions a {
    flex-grow: 1;
    text-align: center;
  }

  .hero-latest-info {
    display: none !important; /* Cacher le statut sur mobile */
  }

  .hero-image {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 65%;
    height: 80%;
    align-items: flex-end;
    justify-content: flex-end;
    z-index: 2;
    transform: translateX(10%);
  }

  .hero-image img {
    max-height: 100%;
    max-width: 100%;
    object-position: bottom right;
  }

  .mobile-only {
    display: block;
  }

  .hero-info .hero-mobile-status {
    margin-top: 0.3rem;
    margin-bottom: 0.7rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
  }
  .hero-info .hero-mobile-status .status {
    display: flex;
    align-items: center;
    gap: 0.3em;
    font-size: 0.9rem;
    opacity: 0.95;
    font-weight: 600;
  }
  .hero-info .hero-mobile-status .status-dot {
    display: inline-block;
    width: 0.6em;
    height: 0.6em;
    border-radius: 50%;
    margin-right: 0.3em;
    vertical-align: middle;
    background-color: #4caf50;
  }
  .hero-info .hero-mobile-status .status-dot.finished {
    background-color: #e53935;
  }

  .hero-info .hero-mobile-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    width: 100%;
    position: absolute;
    left: 0;
    bottom: 1.2rem;
    z-index: 4;
    padding: 0 1.2rem; /* Respecte le padding latéral du conteneur */
    box-sizing: border-box;
  }
  .hero-info .hero-mobile-actions .hero-cta-button,
  .hero-info .hero-mobile-actions .hero-cta-button-anime {
    font-size: 0.9rem;
    padding: 0.6rem 1.8rem;
    border-radius: 0.5rem;
    min-width: 0;
    flex: 1 1 0;
    margin: 0;
    max-width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
  /* Un seul bouton = largeur 100% */
  .hero-info .hero-mobile-actions:only-child .hero-cta-button,
  .hero-info .hero-mobile-actions:only-child .hero-cta-button-anime,
  .hero-info .hero-mobile-actions .hero-cta-button:only-child,
  .hero-info .hero-mobile-actions .hero-cta-button-anime:only-child {
    flex-basis: 100%;
    width: 100%;
    max-width: 100%;
  }
  /* Deux boutons = sur une ligne, prennent chacun la moitié */
  .hero-info .hero-mobile-actions .hero-cta-button,
  .hero-info .hero-mobile-actions .hero-cta-button-anime {
    width: 100%;
    max-width: 100%;
  }

  /* Cache la version desktop sur mobile */
  .hero-info .hero-latest-info {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .hero-carousel {
    height: 470px;
  }
  .hero-info {
    padding: 1.2rem;
    padding-bottom: 2.4rem;
  }
  .hero-info .hero-series-title {
    margin-right: 3rem;
    font-size: 3rem;
  }
  .hero-info .hero-actions {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    width: 100%;
    margin-top: auto;
    margin-bottom: 0;
  }
  .hero-carousel-arrow {
    width: 36px;
    height: 36px;
  }
  .hero-carousel-arrow.prev {
    left: 10px;
  }
  .hero-carousel-arrow.next {
    right: 10px;
  }
  .hero-carousel-nav {
    bottom: 15px;
  }
  .hero-nav-dot {
    width: 10px;
    height: 10px;
  }
}

.mobile-only {
  display: none;
}

.hero-info .hero-title-link {
  color: inherit;
  text-decoration: none;
}

.hero-info .hero-title-link:hover .hero-series-title {
  filter: brightness(0.7);
}

/* Supprime le padding top du main uniquement sur la homepage */
body#homepage main {
  padding-top: 0 !important;
}