/* 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;
}

/* --- FIN SECTION RESPONSIVE MOBILE --- */
/* === Début Pager === */
.pager{
  display:flex; align-items:center; gap:8px;
  justify-content:center; margin:16px 0 24px;
}
.pager-nums{ display:flex; gap:6px; }
.pager-ellipsis{ padding:0 6px; opacity:.7; }

.pager-btn, .pager-num{
  min-width:34px; height:34px; padding:0 10px;
  border-radius:8px; font:inherit; cursor:pointer;
  border:1px solid var(--pager-border, #e5e7eb);
  background: var(--pager-surface, #ffffff);
  color: var(--pager-text, #111111);
}
.pager-num.is-active{
  background: var(--pager-accent, #00b3c6);
  color:#fff; border-color: transparent;
}
.pager-btn[disabled]{ opacity:.45; cursor: default; }

/* Dark mode — essaie toutes ces cibles pour couvrir ton toggle actuel */
html.dark .pager,
body.dark .pager,
[data-theme="dark"] .pager,
.theme-dark .pager{
  --pager-surface: #1f2328;
  --pager-border:  #2b2f35;
  --pager-text:    #e8edf2;
}

/* Fallback automatique si aucun flag de thème : */
@media (prefers-color-scheme: dark){
  .pager{
    --pager-surface: #1f2328;
    --pager-border:  #2b2f35;
    --pager-text:    #e8edf2;
  }
}
/* === Fin Pager === */

/* === Thème Noël === */

/* === Halo polaire === */
/* === FOND NEIGE BLEUTÉ (WHITE MODE) === */
html.theme-noel:not(.dark) .series-card,
html.theme-noel:not(.dark) .chapter-card,
html.theme-noel:not(.dark) .serie-item {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.65) 0%,
    rgba(240, 250, 255, 0.60) 40%,
    rgba(220, 235, 255, 0.55) 100%
  ) !important;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border-radius: 18px;
  border: 1px solid rgba(210, 230, 255, 0.75);

  box-shadow:
    0 4px 12px rgba(0, 0, 30, 0.08),
    inset 0 0 8px rgba(255, 255, 255, 0.15);
}

/* Givre interne très subtil */
html.theme-noel:not(.dark) .series-card::after,
html.theme-noel:not(.dark) .chapter-card::after,
html.theme-noel:not(.dark) .serie-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;

  background: linear-gradient(
    120deg,
    rgba(255,255,255,0.6) 0%,
    rgba(255,255,255,0.15) 50%,
    rgba(200,220,255,0.2) 100%
  );

  opacity: 0.35;
}

/* === FOND NEIGE BLEUTÉ (DARK) === */
html.theme-noel.dark .series-card,
html.theme-noel.dark .chapter-card,
html.theme-noel.dark .serie-item {
  background: linear-gradient(
    145deg,
    rgba(35, 45, 65, 0.55) 0%,
    rgba(40, 55, 80, 0.50) 40%,
    rgba(25, 35, 55, 0.45) 100%
  ) !important;

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border-radius: 18px;
  border: 1px solid rgba(140, 170, 220, 0.35);

  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.35),
    inset 0 0 8px rgba(180, 200, 255, 0.08);
}

/* Givre discret */
html.theme-noel.dark .series-card::after,
html.theme-noel.dark .chapter-card::after,
html.theme-noel.dark .serie-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    120deg,
    rgba(255,255,255,0.15) 0%,
    rgba(255,255,255,0.05) 50%,
    rgba(120,160,220,0.10) 100%
  );
  opacity: 0.25;
}
/* === Fin Halo polaire === */

/* === Cartes givrées === */
html.theme-noel:not(.dark) .series-card,
html.theme-noel:not(.dark) .chapter-card,
html.theme-noel:not(.dark) .serie-item {
  position: relative;
  overflow: visible;
  background: rgba(255, 255, 255, 0.55) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;

  border-radius: 18px;
  border: 2px solid rgba(220, 240, 255, 0.8);

  box-shadow:
    0 0 15px rgba(160, 200, 255, 0.15),
    0 0 25px rgba(200, 230, 255, 0.12),
    inset 0 0 10px rgba(255, 255, 255, 0.25);
}

/* Effet givre interne (WHITE MODE) */
html.theme-noel:not(.dark) .series-card::after,
html.theme-noel:not(.dark) .chapter-card::after,
html.theme-noel:not(.dark) .serie-item::after {
  content: "";
  position: absolute;
  inset: -3px;
  z-index: -1;
  border-radius: inherit;

  background: linear-gradient(
    130deg,
    rgba(255,255,255,0.9) 0%,
    rgba(255,255,255,0) 40%,
    rgba(180,220,255,0.7) 70%,
    rgba(255,255,255,0) 100%
  );

  filter: blur(6px);
  animation: frostGlow 5s linear infinite;
}

@keyframes frostGlow {
  0%   { opacity: 0.55; }
  50%  { opacity: 0.95; }
  100% { opacity: 0.55; }
}

/* === Cartes givrées — version DARK MODE === */
html.theme-noel.dark .series-card,
html.theme-noel.dark .chapter-card,
html.theme-noel.dark .serie-item {
  position: relative;
  overflow: visible;

  background: rgba(25, 30, 45, 0.45) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;

  border-radius: 18px;
  border: 1px solid rgba(140, 170, 220, 0.4);

  box-shadow:
    0 0 10px rgba(100, 150, 255, 0.12),
    0 0 18px rgba(100, 150, 255, 0.10),
    inset 0 0 8px rgba(200, 220, 255, 0.10);
}

/* Effet givre interne — version moins agressive */
html.theme-noel.dark .series-card::after,
html.theme-noel.dark .chapter-card::after,
html.theme-noel.dark .serie-item::after {
  content: "";
  position: absolute;
  inset: -3px;
  z-index: -1;
  border-radius: inherit;

  background: linear-gradient(
    130deg,
    rgba(255,255,255,0.20) 0%,
    rgba(255,255,255,0) 40%,
    rgba(140,180,255,0.35) 70%,
    rgba(255,255,255,0) 100%
  );

  filter: blur(6px);
  animation: frostGlowDark 6s linear infinite;
}

@keyframes frostGlowDark {
  0%   { opacity: 0.20; }
  50%  { opacity: 0.45; }
  100% { opacity: 0.20; }
}


/* Empêche les images de dépasser des cartes */
html.theme-noel .series-card .cover,
html.theme-noel .chapter-card .cover,
html.theme-noel .serie-item .cover {
    overflow: hidden !important;
    border-radius: 16px;
}

/* Si tes images sont dans un élément img, sécurisation */
html.theme-noel .series-card img,
html.theme-noel .chapter-card img,
html.theme-noel .serie-item img {
    border-radius: 16px;
    display: block;
}


/* Empêche l’image de sortir même en hover */
.series-card .cover,
.chapter-card .cover,
.serie-item .cover {
  overflow: hidden !important;
  border-radius: 18px 0 0 18px; /* ou selon ton layout */
  position: relative;
}

/* Et l'image elle-même */
.series-card .cover img,
.chapter-card .cover img,
.serie-item .cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* === Fin Cartes givrées === */

/* === Bouton héros Noël === */
html.theme-noel .hero-cta-button {
  background: linear-gradient(100deg,
    #ff6b81 0%,
    #ff85a0 40%,
    #ffd0dd 100%
  );
  color: white !important;
  border: none !important;
  padding-inline: 24px;
  font-weight: 600;

  box-shadow: 0 5px 18px rgba(255, 80, 120, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s;
}

html.theme-noel .hero-cta-button:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 28px rgba(255, 120, 160, 0.5);
}
/* === Fin Bouton héros Noël === */

/* === Tag boules de Noël === */
html.theme-noel .tag {
  background: radial-gradient(circle at 30% 30%,
    rgba(255,255,255,0.95),
    rgba(255,255,255,0.7),
    rgba(255,255,255,0.35)
  ) !important;

  border: 1px solid rgba(255, 110, 140, 0.35) !important;
  color: #ff5777 !important;
  font-weight: 600;

  box-shadow:
    0 3px 10px rgba(255,120,160,0.25),
    inset 0 0 8px rgba(255,255,255,0.5);
}

/* dark mode tweak */
html.dark.theme-noel .tag {
  background: radial-gradient(circle at 30% 30%,
    rgba(255,255,255,0.2),
    rgba(255,255,255,0.1)
  ) !important;

  border: 1px solid rgba(255, 140, 170, 0.45) !important;
  color: #ff88a2 !important;
}
/* === Fin Tag boules de Noël === */

/* === Fin Thème Noël === */

/* ===== Team badge (homepage) — uniquement style & responsive ===== */
.team-badge{
  /* look */
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .85rem;
  line-height: 1;

  /* couleurs (si tu passes --team-color en inline style, ça suit) */
  color: var(--team-color, #d6b07a);
  background: color-mix(in srgb, var(--team-color, #d6b07a) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--team-color, #d6b07a) 35%, transparent);

  /* anti-casse mobile */
  max-width: 220px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* hover léger */
.team-badge:hover{
  background: color-mix(in srgb, var(--team-color, #d6b07a) 18%, transparent);
  border-color: color-mix(in srgb, var(--team-color, #d6b07a) 55%, transparent);
}

/* Mobile: badge plus petit + max-width en vw */
@media (max-width: 520px){
  .team-badge{
    font-size: .72rem;
    padding: 4px 8px;
    gap: 5px;
    max-width: 34vw;  /* clé: ne ruine jamais la ligne */
  }
}

/* Très petit écran: option pour gagner encore de la place */
@media (max-width: 380px){
  .team-badge{
    max-width: 30vw;
  }
  .team-badge i{
    display: none; /* optionnel */
  }
}
/* ===== Fin Team badge ===== */