/* hoummi-article.css
 *
 * Mise en forme du corps des articles du blog (pages générées par
 * build-blog.js). Les jetons de couleur viennent de hoummi-branches.css.
 * En-tête, appel et cartes « À lire aussi » emploient les composants de
 * hoummi-branches.css (.hm-s, .hm-titre, .hm-carte) ; cette feuille ne
 * porte que le corps de l'article et les quelques réglages de l'en-tête.
 */

.rich-text-block {
  max-width: 46rem;
  font-size: 1.0625rem;
  line-height: 1.7;
  letter-spacing: 0.2px;
  /* Le gabarit Webflow posait une graisse 100 : illisible sur un texte long. */
  font-weight: 300;
  color: var(--hm-encre, #212221);
}

.rich-text-block h2 {
  margin: 2.5rem 0 1rem;
  font-size: 1.75rem;
  line-height: 1.25;
  font-weight: 400;
}

.rich-text-block h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.35;
  font-weight: 500;
}

.rich-text-block p,
.rich-text-block ul,
.rich-text-block ol {
  margin: 0 0 1rem;
}

.rich-text-block li {
  margin-bottom: 0.4rem;
}

.rich-text-block a {
  color: var(--hm-vert-lisible, #245e42);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rich-text-block figure {
  margin: 2rem 0;
}

.rich-text-block figure img {
  display: block;
  width: 100%;
  height: auto;
}

.rich-text-block figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--hm-encre-tenue, #585858);
}

/* Tableaux : défilement horizontal sur mobile plutôt qu'un débordement de page. */
.rich-text-block table {
  display: block;
  overflow-x: auto;
  width: 100%;
  margin: 1.5rem 0 2rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.rich-text-block th,
.rich-text-block td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--hm-beige, #E6E1D0);
  text-align: left;
  vertical-align: top;
  min-width: 9rem;
}

.rich-text-block thead th {
  border-bottom: 2px solid var(--hm-encre, #212221);
  font-weight: 500;
}

.rich-text-block tbody td:first-child {
  font-weight: 500;
}

.hm-article__faq,
.hm-article__sources {
  margin-top: 3rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--hm-beige, #E6E1D0);
}

.hm-article__sources ul {
  padding-left: 1.1rem;
  font-size: 0.9375rem;
}

.hm-article__auteur {
  margin: 3rem 0 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--hm-beige, #E6E1D0);
  border-radius: var(--hm-r, 2px);
  font-size: 0.9375rem;
}

.hm-article__auteur p:last-child {
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .rich-text-block {
    font-size: 1rem;
  }

  .rich-text-block h2 {
    font-size: 1.45rem;
  }
}

/* En-tête de l'article */
.hm-article__fil {
  margin: 0 0 22px;
  font-size: 13px;
}

.hm-article__tete .hm-titre {
  max-width: 22ch;
  line-height: 1.02;
}

.hm-article__meta {
  margin: 0 0 clamp(28px, 4vw, 48px);
  font-size: 14px;
  letter-spacing: .02em;
  color: var(--hm-encre-tenue, #585858);
}

/* build-blog.js écrit les dimensions réelles de l'image (width/height) pour
   réserver sa place ; height:auto laisse le ratio d'origine s'appliquer. */
.hm-article__visuel {
  margin: 0;
  max-width: 900px;
}

.hm-article__visuel img {
  display: block;
  width: 100%;
  height: auto;
  /* Un seul cadrage pour tous les articles, que la photo soit en portrait
     ou en paysage. */
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--hm-r, 2px);
}

/* Le corps suit l'en-tête sans double marge. */
.hm-article__tete + .hm-article__corps .hm-s__c { padding-top: 0; }

/* Bandeau des pages d'aperçu (brouillons), voir build-blog.js. */
.hm-apercu {
  position: sticky;
  top: 0;
  z-index: 10000;
  padding: 0.6rem 1rem;
  background: var(--hm-corail, #F18B6E);
  color: var(--hm-encre, #212221);
  font-size: 0.875rem;
  text-align: center;
}
