/* =========================================================
   AISA – Mise en page des articles News
   Fichier à placer dans le dossier du thème : /wp-content/themes/aisa/news.css
   Il est chargé automatiquement par le code de news-functions.php
   (sur les pages News ET dans l'éditeur, pour voir le rendu en écrivant).
   ========================================================= */

.aisa-news,
body.mce-content-body {
  --news-rouge: var(--aisa-color-primary, #e3000b);
  --news-texte: #647a84;
  --news-titre: #647a84;
  --news-fond: #f5f5f5;
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 0 64px;
  font-size: 18px;
  line-height: 1.75;
  font-weight: 400;
  color: var(--news-texte);
}
body.mce-content-body { padding: 24px; }

/* ---------- Paragraphes ---------- */
.aisa-news p,
body.mce-content-body p {
  margin: 0 0 1.4em;
  font-weight: 400;
  color: var(--news-texte);
}

.aisa-news strong,
body.mce-content-body strong {
  font-weight: 600;
  color: var(--news-titre);
}

/* ---------- Sous-titre (h2 en haut de l'article) ---------- */
.aisa-news h2,
body.mce-content-body h2 {
  font-size: 30px;
  line-height: 1.3;
  font-weight: 500;
  color: var(--news-rouge) !important;
  margin: 0 0 24px;
}

/* ---------- Chapô : texte d'introduction ----------
   Automatique : le 1er paragraphe qui suit le h2.
   Manuel : classe news-chapo (menu « Formats » de l'éditeur). */
.aisa-news h2 + p,
.aisa-news .news-chapo,
body.mce-content-body h2 + p,
body.mce-content-body .news-chapo {
  font-size: 21px;
  line-height: 1.6;
  color: var(--news-titre);
  padding-left: 20px;
  border-left: 4px solid var(--news-rouge);
  margin-bottom: 40px;
}
.aisa-news h2 + p strong,
.aisa-news .news-chapo strong { font-weight: 500; }

/* ---------- Intertitres (h3) ---------- */
.aisa-news h3,
body.mce-content-body h3 {
  position: relative;
  font-size: 24px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--news-titre);
  margin: 64px 0 20px;
  padding-top: 20px;
}
.aisa-news h3::before,
body.mce-content-body h3::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--news-rouge);
}

/* ---------- Liens ---------- */
.aisa-news a,
body.mce-content-body a {
  color: var(--news-rouge);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .2s;
}
.aisa-news a:hover { color: var(--news-titre); }
.aisa-news a u { text-decoration: none; } /* les anciens <u> deviennent inutiles */

/* ---------- Images ---------- */
.aisa-news img,
body.mce-content-body img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
}
.aisa-news p > img:only-child { margin: 48px 0; }      /* image collée seule dans le texte */
.aisa-news figure,
.aisa-news .wp-caption {
  width: 100% !important;
  margin: 48px 0;
}
.aisa-news figcaption,
.aisa-news .wp-caption-text {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.5;
  color: #777;
  text-align: center;
}

/* ---------- Listes ---------- */
.aisa-news ul,
.aisa-news ol { margin: 0 0 1.4em; padding-left: 1.3em; }
.aisa-news li { margin-bottom: .5em; }
.aisa-news ul li::marker { color: var(--news-rouge); }

/* ---------- Chiffres clés ---------- */
.aisa-news .news-chiffres {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 48px 0;
}
.aisa-news .news-chiffres > div {
  background: var(--news-fond);
  border-top: 3px solid var(--news-rouge);
  padding: 20px;
}
.aisa-news .news-chiffres p { margin: 0; }
.aisa-news .news-chiffres b {
  display: block;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 500;
  white-space: nowrap;
  color: var(--news-rouge);
  margin-bottom: 6px;
}
.aisa-news .news-chiffres span,
.aisa-news .news-chiffres div {
  font-size: 15px;
  line-height: 1.45;
}

/* ---------- Encadré (texte mis en avant) ---------- */
.aisa-news .news-encadre,
body.mce-content-body .news-encadre {
  background: var(--news-fond);
  border-left: 4px solid var(--news-rouge);
  padding: 24px 28px;
  margin: 40px 0;
  font-size: 19px;
  color: var(--news-titre);
}
.aisa-news .news-encadre > :last-child { margin-bottom: 0; }

/* ---------- Bloc final (appel à l'action) ---------- */
.aisa-news .news-cta {
  background: var(--news-rouge);
  color: #fff;
  border-radius: 6px;
  padding: 36px 40px;
  margin: 64px 0 0;
}
.aisa-news .news-cta p,
.aisa-news .news-cta strong { color: #fff; }
.aisa-news .news-cta p { font-size: 20px; line-height: 1.5; }
.aisa-news .news-cta > :last-child { margin-bottom: 0; }
.aisa-news .news-cta a { color: #fff; }

/* ---------- Bouton (sur un lien, menu « Formats ») ---------- */
.aisa-news a.news-bouton,
body.mce-content-body a.news-bouton {
  display: inline-block;
  background: var(--news-rouge);
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  padding: 12px 26px;
  border-radius: 4px;
}
.aisa-news a.news-bouton:hover { background: var(--news-titre); color: #fff; }
.aisa-news .news-cta a.news-bouton { background: #fff; color: var(--news-rouge); margin-top: 20px;}
.aisa-news .news-cta a.news-bouton:hover { background: var(--news-titre); color: #fff; }

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  .aisa-news { font-size: 17px; padding: 32px 16px 48px; }
  .aisa-news h2 { font-size: 24px; }
  .aisa-news h2 + p,
  .aisa-news .news-chapo { font-size: 19px; padding-left: 16px; }
  .aisa-news h3 { font-size: 21px; margin-top: 48px; }
  .aisa-news .news-chiffres { grid-template-columns: 1fr 1fr; }
  .aisa-news .news-chiffres b { font-size: 24px; }
  .aisa-news .news-cta { padding: 28px 24px; }
}
