/* ============================================================
   INFORMATIONS DETAIL — Refonte Premium & SEO
   ============================================================ */

/* ── 1. Hero Header Immersif ── */
.article-hero {
  min-height: 60vh;
  display: flex;
  align-items: flex-end;
  margin-top: -80px; /* Compense la hauteur du header fixe si nécessaire */
}

.article-hero-bg {
  z-index: 1;
}

/* L'overlay assombrit l'image pour garantir un contraste parfait du texte (A11y/SEO) */
.bg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(8, 0, 50, 0.4) 0%, rgba(8, 0, 50, 0.9) 100%);
}

.breadcrumb-light .breadcrumb-item a,
.breadcrumb-light .breadcrumb-item.active {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb-light .breadcrumb-item a:hover {
  color: #fff;
}

/* ── 2. Mode Lecture Focus (Cards & Contenu) ── */
.bg-card-custom {
  background: #ffffff;
  transition: background-color 0.3s ease;
}

[data-bs-theme="dark"] .bg-card-custom {
  background: #121028; /* Teinte sombre subtile tirée de ta palette */
  border-color: rgba(255, 255, 255, 0.05) !important;
}

/* Typographie du corps de l'article */
.article-body h2, 
.article-body h3 {
  font-weight: 800;
  margin-top: 2.5rem;
  margin-bottom: 1.2rem;
  color: #080032;
}

[data-bs-theme="dark"] .article-body h2, 
[data-bs-theme="dark"] .article-body h3 {
  color: #ffffff;
}

.article-body p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #4a4a5e;
  margin-bottom: 1.5rem;
}

[data-bs-theme="dark"] .article-body p {
  color: rgba(255, 255, 255, 0.75);
}

.article-body a {
  color: #6366f1;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ── 3. Actions Flottantes (Sidebar gauche) ── */
aside .sticky-top {
  padding-top: 2rem;
}

.btn-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-icon:hover {
  transform: translateY(-3px);
}

/* ── Bouton Like (Ajustement Mobile & Desktop) ── */
.btn-like {
  font-size: 1.25rem;
  justify-content: center;
  padding: 0.5rem 1.5rem; /* Laisse l'espace horizontal pour l'icône et le chiffre */
}

/* On conserve le cercle parfait avec des dimensions fixes uniquement pour la sidebar Desktop */
aside .btn-icon.btn-like {
  width: 54px;
  height: 54px;
  padding: 0;
  font-size: 1.5rem;
}

.btn-like.liked {
  background-color: #6366f1;
  color: white;
  animation: pulseLike 0.4s ease;
}

@keyframes pulseLike {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ── 4. Grille native pour les articles liés (Le FIX définitif) ── */
.related-grid {
  display: grid;
  /* On utilise auto-fill au lieu de auto-fit pour éviter qu'une carte unique ne s'étire à 100% */
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  align-items: stretch; /* Force toutes les cartes de la même ligne à avoir la même hauteur */
}

.related-card {
  display: flex;
  flex-direction: column;
  height: 100%; /* Prend toute la hauteur de sa cellule Grid */
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 1rem;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.related-card:hover {
  transform: translateY(-5px);
  border-color: #6366f1;
  box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.3);
}

.related-card-img-wrapper {
  width: 100%;
  aspect-ratio: 16/9;
  background-color: rgba(99, 102, 241, 0.1);
  overflow: hidden;
}

.related-card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.related-card:hover .related-card-img-wrapper img {
  transform: scale(1.05);
}

.related-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Pousse le footer vers le bas */
  background: var(--bs-body-bg);
}

.related-card-footer {
  padding: 1rem 1.5rem;
  margin-top: auto; /* Maintient le footer toujours tout en bas */
  border-top: 1px solid rgba(99, 102, 241, 0.1);
  background: var(--bs-body-bg);
}

/* ── Correction Dark Mode pour les cartes liées ── */

/* 1. Mode Clair par défaut */
.related-card-body,
.related-card-footer {
  background-color: #ffffff;
  transition: background-color 0.3s ease;
}
.related-card-img-wrapper {
  background-color: #f3f4f6; /* Gris très clair si l'image casse en mode light */
}

/* 2. Mode Sombre (Dark) */
[data-bs-theme="dark"] .related-card-body,
[data-bs-theme="dark"] .related-card-footer {
  background-color: #121028; /* Le même fond sombre premium que ton site */
  border-top-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .related-card-img-wrapper {
  background-color: rgba(99, 102, 241, 0.1); /* Bleu sombre si l'image casse en mode dark */
}

/* 3. Adaptation du texte en Mode Sombre */
[data-bs-theme="dark"] .related-card-body h3 a,
[data-bs-theme="dark"] .related-card-footer span.text-body {
  color: #ffffff !important;
}

[data-bs-theme="dark"] .related-card-body .text-muted {
  color: rgba(255, 255, 255, 0.6) !important;
}

/* ── 5. FAQ Épurée ── */
.accordion-custom .accordion-item {
  transition: transform 0.2s ease;
}

.accordion-custom .accordion-item:hover {
  transform: translateX(5px);
}

.accordion-custom .accordion-button {
  background: transparent !important;
  color: inherit;
}

.accordion-custom .accordion-button:not(.collapsed) {
  color: #6366f1 !important;
}

/* ── 6. Mobile Sticky Actions ── */
@media (max-width: 991.98px) {
  body {
    padding-bottom: 80px; /* Évite que le contenu soit caché par la barre sticky mobile */
  }
}

/* ── Ajustement Meta Auteur (Mobile) ── */
#author-container img {
  width: 40px !important;
  height: 40px !important;
}
#author-container h6 {
  font-size: 0.85rem;
  margin-bottom: 0.1rem !important;
  color: rgba(255, 255, 255, 0.9);
}
#author-container span {
  font-size: 0.75rem;
}

@media (min-width: 768px) {
  #author-container img {
    width: 50px !important;
    height: 50px !important;
  }
  #author-container h6 {
    font-size: 0.95rem;
  }
  #author-container span {
    font-size: 0.85rem;
  }
}

/* ── Ajustement Meta Auteur (Visibilité Mobile) ── */

/* On contraint l'avatar injecté par JS pour que tout rentre */
#author-container img {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50%;
  margin-right: 0.5rem;
}

#author-container h6 {
  font-size: 0.8rem;
  margin-bottom: 0.1rem !important;
  color: white;
  font-weight: 600;
}

#author-container span {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.8);
}

/* On cache l'en-tête "Auteur" injecté par JS sur mobile pour gagner de la place */
@media (max-width: 575.98px) {
    #author-container h6 {
        display: none !important;
    }
}

/* Desktop : On peut se permettre plus grand */
@media (min-width: 768px) {
  #author-container img {
    width: 48px !important;
    height: 48px !important;
    margin-right: 0.75rem;
  }
  #author-container h6 {
    font-size: 0.9rem;
    display: block !important;
  }
  #author-container span {
    font-size: 0.8rem;
  }
  
  /* On redonne un peu de gap sur desktop */
  #meta-infos-container.gap-2 {
      gap: 1.5rem !important;
  }
}

/* ── Gestion du chevauchement de la carte sur le Header ── */
.article-content-wrapper {
  margin-top: -1rem; /* Sur mobile : on remonte très peu pour ne pas cacher le texte */
}

@media (min-width: 992px) {
  .article-content-wrapper {
    margin-top: -3.5rem; /* Sur desktop : on remonte plus franchement (effet visuel sympa) */
  }
}