@import url('/css/article-slider-front.css?v=5');

/* =========================
   Conteneur principal
========================= */
.main-article{
  /* ≤ 900px OU 100% - 40px pour garder ~20px de marge de chaque côté */
  max-width: min(900px, calc(100% - 40px));
  margin: 3rem auto 5rem;
  padding: 0 1rem;
  color: var(--white);
  background: linear-gradient(135deg, var(--dark-blue), var(--light-blue), var(--dark-blue));
  background-size: 200% 200%;
  animation: articleGradientShift 10s ease infinite;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  font-family: 'Roboto', Arial, sans-serif;
}

@keyframes articleGradientShift{
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* =========================
   En-tête
========================= */
.page-header{ text-align: center; }
.page-header h1,
.page-header h2{
  margin: 0;
  color: var(--white);
}

/* =========================
   Corps d’article
========================= */
.article-content{
  padding: 2rem 2.5rem 3rem;
  line-height: 1.6;
  font-size: 1.1rem;
  color: var(--white);
}
.article-content p{ margin-bottom: 1.5rem; }

.article-image{
  margin-bottom: 2rem;
  text-align: center;
}
.article-image img{
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.6);
  transition: transform 0.3s ease;
}
.article-image img:hover{ transform: scale(1.02); }

.article-video{
  width: 100%;
  max-height: 400px;
  margin: 2rem 0;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.7);
}

/* Date (fallback) */
article time{
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-style: italic;
  color: var(--yellow);
  font-weight: 600;
}
.article-date{
  text-align: left;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  font-style: italic;
  color: #999;   /* gris doux */
  font-weight: 400;
}

/* =========================
   Article introuvable
========================= */
.article-introuvable{
  max-width: 600px;
  margin: 8rem auto;
  text-align: center;
  color: #ff6347;
}
.article-introuvable h1{
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

/* =========================
   Navigation / Boutons
========================= */
.article-buttons{
  margin-top: 2rem;          /* espace avec le bloc de partage au-dessus */
  text-align: center;
}
.article-navigation{
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
  margin-bottom: 3rem;
}
.article-navigation .btn{
  flex: 1 1 auto;
  text-align: center;
}

/* =========================
   Liste d’articles (pages listées)
========================= */
.actualites-list{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}
.article-preview{
  background-color: var(--dark-blue);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  color: var(--white);
}
.article-preview header{ margin-bottom: 1rem; }
.article-preview h2{
  margin: 0.2rem 0 1rem;
  font-size: 1.8rem;
}
.article-preview h2 a{
  color: var(--yellow);
  text-decoration: none;
  transition: color 0.3s ease;
}
.article-preview h2 a:hover{ color: var(--cta-hover); }
.article-meta{
  font-size: 0.9rem;
  color: var(--yellow);
  font-style: italic;
}
.article-excerpt{
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--white);
}
.article-preview .article-image img{
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

/* Pagination simple (liste) */
.pagination{
  text-align: center;
  margin: 3rem 0;
  font-size: 1.1rem;
  color: var(--white);
}

/* =========================
   Auteur de l’article
========================= */
.article-author{
  margin-top: 2rem;
  font-size: 0.95rem;
  text-align: center;
  color: var(--white);
  opacity: 0.9;
}
.article-author a{
  color: var(--yellow);
  font-weight: 600;
  text-decoration: none;
}
.article-author a:hover{ color: var(--cta-hover); }

/* =========================
   Partage
========================= */
.share-wrapper{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;        /* espace entre le texte et le bouton “Partager” */
  flex-wrap: wrap;
  margin-top: 2rem;
  margin-bottom: 4rem; /* espace sous le bloc de partage (avant le bouton primary) */
}
.share-wrapper p{
  margin: 0;
  font-size: 1.2rem;
  color: var(--white);
}

/* Hook local (si besoin) pour le bouton ghost */
.share-btn{}
.share-btn i{
  font-size: 1rem;
  line-height: 1;
}

/* Modale de partage */
.share-modal{
  display: none;
  position: absolute;
  bottom: calc(100% + 15px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  background-color: var(--dark-blue);
  padding: 1.5rem;
  border-radius: 10px;
  width: 320px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 10;
}
.share-modal.show{
  display: block;
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
.close{
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  color: var(--white);
  cursor: pointer;
}
.share-icons{
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.share-icons a,
.share-icons button{
  font-size: 2rem;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.3s ease, color 0.3s ease;
}
.share-icons a:hover,
.share-icons button:hover{
  transform: scale(1.3);
  color: var(--yellow);
}

/* =========================
   Sécurité du HTML collé
========================= */
.main-article,
.article-content,
.article-text{
  color: var(--white) !important;
  min-width: 0 !important; /* fix flexbox */
}
.article-text{
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
/* Héritage des couleurs */
.article-text h1,
.article-text h2,
.article-text h3,
.article-text h4,
.article-text h5,
.article-text h6,
.article-text p,
.article-text li,
.article-text blockquote,
.article-text figure,
.article-text figcaption{
  color: inherit !important;
}
/* Liens dans le contenu (WYSIWYG uniquement) */
.article-text a{
  color: var(--yellow) !important;
  text-decoration: none;
  font-weight: 600;
}
.article-text a:hover,
.article-text a:focus{
  color: var(--cta-hover) !important;
  outline: none;
}
/* Médias bornés */
.article-text img,
.article-text video,
.article-text iframe{
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
}

/* =========================
   Responsive
========================= */
@media (max-width: 768px){
  .main-article{
    /* garde ~20px de marge visuelle (calc(100% - 32px) = 16px de chaque côté) */
    max-width: min(900px, calc(100% - 32px));
    margin: 2rem auto 4rem;
    padding: 1rem;
  }
  .page-header h1{ font-size: 2rem; }
  .page-header h2{ font-size: 1.1rem; }

  .article-content{
    font-size: 1rem;
    padding: 1rem 1.2rem 2rem;
  }

  .article-preview{ padding: 1rem; }
  .article-preview h2{ font-size: 1.5rem; }
  .article-excerpt{ font-size: 1rem; }
  .actualites-list{
    gap: 2rem;
    padding: 1rem;
  }
}

/* Helpers au cas où une largeur 100% traîne */
.article-buttons .btn{ width: auto; }
.article-navigation .btn{ width: auto; }
