/* Styles partagés par toutes les pages : menu mobile du header et recherche.
   Inclus automatiquement par tools/sync-pages.php. */

/* ---------- Menu mobile ---------- */

.lfh-mobile-menu {
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  transition: max-height 0.25s ease, visibility 0s linear 0.25s;
}

.lfh-mobile-menu.is-open {
  max-height: 640px;
  visibility: visible;
  transition: max-height 0.25s ease;
}

/* ---------- Recherche ---------- */

html.lfh-search-open {
  overflow: hidden;
}

.lfh-search {
  width: min(720px, calc(100% - 32px));
  max-width: none;
  max-height: none;
  margin: 12vh auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #000;
  font-family: Poppins, ui-sans-serif, system-ui, sans-serif;
  overflow: visible;
}

.lfh-search::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.lfh-search__panel {
  display: flex;
  flex-direction: column;
  max-height: 76vh;
  border: 2px solid #000;
  background: #fff;
  box-shadow: 10px 10px 0 #000;
}

.lfh-search__form {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 20px;
  border-bottom: 2px solid #000;
}

.lfh-search__form > .bi {
  font-size: 1.25rem;
}

.lfh-search__input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 500;
  color: #000;
}

.lfh-search__input::placeholder {
  color: rgba(0, 0, 0, 0.45);
}

.lfh-search__input::-webkit-search-cancel-button {
  display: none;
}

.lfh-search__close {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #000;
  font-size: 1.05rem;
  cursor: pointer;
}

.lfh-search__close:hover,
.lfh-search__close:focus-visible {
  background: #000;
  color: #fff;
}

.lfh-search__status {
  margin: 0;
  padding: 14px 20px 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.5);
}

.lfh-search__status:empty {
  display: none;
}

.lfh-search__results {
  margin: 0;
  padding: 6px 8px 10px;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.lfh-search__hit {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  color: #000;
  text-decoration: none;
  outline: 0;
}

.lfh-search__hit:hover,
.lfh-search__hit:focus-visible {
  background: #F1D13F;
}

.lfh-search__meta {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.5);
}

.lfh-search__title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.lfh-search__section {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
}

.lfh-search__snippet {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.55;
  color: rgba(0, 0, 0, 0.7);
}

.lfh-search mark {
  background: #F1D13F;
  color: inherit;
  padding: 0 1px;
}

.lfh-search__hit:hover mark,
.lfh-search__hit:focus-visible mark {
  background: #000;
  color: #fff;
}

.lfh-search__more {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border: 2px solid #000;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.lfh-search__more:hover,
.lfh-search__more:focus-visible {
  background: #000;
  color: #fff;
  outline: 0;
}

.lfh-search__hint {
  margin: 0;
  padding: 10px 20px 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.45);
}

.lfh-search kbd {
  padding: 1px 6px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.7rem;
}

@media (max-width: 639px) {
  .lfh-search {
    margin-top: 16px;
  }

  .lfh-search__panel {
    max-height: calc(100svh - 48px);
    box-shadow: 6px 6px 0 #000;
  }

  .lfh-search__hint {
    display: none;
  }
}

/* ---------- Chroniques liées (« À lire aussi », « Dernières chroniques ») ---------- */

.lfh-suite {
  font-family: Poppins, ui-sans-serif, system-ui, sans-serif;
}

.lfh-suite--clair {
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  background: #fff;
  color: #000;
}

.lfh-suite--sombre {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  background: #000;
  color: #fff;
}

.lfh-suite__contenu {
  max-width: 1320px;
  margin: 0 auto;
  padding: 56px 24px 72px;
}

@media (min-width: 1024px) {
  .lfh-suite__contenu {
    padding: 80px 32px 96px;
  }
}

/* Plus de marge latérale seulement quand le conteneur (1320 px) a de la place de chaque côté
   (32 px sur ordinateur, comme le header) */
@media (min-width: 1384px) {
  .lfh-suite__contenu {
    padding: 80px 0 96px;
  }
}

.lfh-suite__entete {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.lfh-suite__titre {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
}

.lfh-suite__tout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.18s ease;
}

.lfh-suite__tout:hover {
  transform: translateY(-2px);
}

.lfh-cartes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lfh-carte {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 26px;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.lfh-suite--clair .lfh-carte {
  border: 2px solid #000;
  background: #fff;
  color: #000;
  box-shadow: 8px 8px 0 #000;
}

.lfh-suite--sombre .lfh-carte {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #111;
  color: #fff;
}

.lfh-suite .lfh-carte--avant {
  border-color: #F1D13F;
  background: #F1D13F;
  color: #000;
}

.lfh-carte:hover,
.lfh-carte:focus-visible {
  transform: translate(-3px, -3px);
  outline: 0;
}

.lfh-suite--clair .lfh-carte:hover,
.lfh-suite--clair .lfh-carte:focus-visible {
  box-shadow: 11px 11px 0 #000;
}

.lfh-suite--sombre .lfh-carte:hover,
.lfh-suite--sombre .lfh-carte:focus-visible {
  box-shadow: 8px 8px 0 #F1D13F;
}

.lfh-carte__meta {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.025em;
  opacity: 0.7;
}

.lfh-carte__titre {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.lfh-carte__texte {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  opacity: 0.75;
}

.lfh-carte__lire {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  font-size: 14px;
  font-weight: 700;
}

/* ---------- Charte graphique : couleurs web (Guidelines DA 2026) ----------
   Chaque sujet (tools/sujets.php) reçoit une classe lfh-c-<couleur> qui fixe --c (fond de
   la case) et --sur-c (texte lisible sur ce fond, contraste AA vérifié). */

:root {
  --lfh-beige: #fdf4df;
  --lfh-noir: #000000;
  --lfh-rouge: #e83f13;
  --lfh-bleu: #3c3cef;
  --lfh-ciel: #48bef9;
  --lfh-jaune: #fcd227;
  --lfh-rose: #f7b7c4;
  --lfh-vert: #1c7768;
}

.lfh-c-noir  { --c: var(--lfh-noir);  --sur-c: #fff; }
.lfh-c-rouge { --c: var(--lfh-rouge); --sur-c: #000; }
.lfh-c-bleu  { --c: var(--lfh-bleu);  --sur-c: #fff; }
.lfh-c-ciel  { --c: var(--lfh-ciel);  --sur-c: #000; }
.lfh-c-jaune { --c: var(--lfh-jaune); --sur-c: #000; }
.lfh-c-rose  { --c: var(--lfh-rose);  --sur-c: #000; }
.lfh-c-vert  { --c: var(--lfh-vert);  --sur-c: #fff; }

/* ---------- Sujets et mots-clés (bloc LFH:MOTSCLES des chroniques, pages sujets/) ----------
   Typographie de la charte : Poppins ExtraBold pour les titres, SemiBold pour les textes,
   interlettrage -0,025 em, jamais de capitales, textes alignés à gauche. */

.lfh-motscles {
  max-width: 760px;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.25);
  font-family: Poppins, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.025em;
}

.lfh-motscles__titre {
  margin: 0;
  color: #000;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.lfh-motscles__groupe + .lfh-motscles__groupe,
.lfh-motscles__titre + .lfh-motscles__groupe {
  margin-top: 1.25rem;
}

.lfh-motscles__libelle {
  margin: 0 0 0.6rem;
  color: rgba(0, 0, 0, 0.6);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.lfh-motscles__liste {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lfh-motscles__liste li {
  margin: 0;
  padding: 0;
}

.lfh-motscles__liste li::before {
  content: none;
}

/* Cases : bord noir, ombre portée (comme les tuiles du programme) */
.lfh-motscles__sujet,
.lfh-motscles__mot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 14px;
  border: 2px solid #000;
  border-radius: 0;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.lfh-motscles__sujet {
  background: var(--c, #000);
  color: var(--sur-c, #fff);
  font-weight: 800;
  box-shadow: 4px 4px 0 #000;
}

.lfh-motscles__sujet:hover,
.lfh-motscles__sujet:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #000;
  outline: 0;
}

.lfh-motscles__mot {
  background: var(--lfh-beige);
  color: #000;
  font-weight: 600;
}

.lfh-motscles__mot i {
  font-size: 12px;
  opacity: 0.55;
}

/* Au survol, le mot-clé prend la couleur du sujet principal de la page */
.lfh-motscles__mot:hover,
.lfh-motscles__mot:focus-visible {
  transform: translate(-2px, -2px);
  background: var(--c, #000);
  color: var(--sur-c, #fff);
  box-shadow: 4px 4px 0 #000;
  outline: 0;
}

.lfh-motscles__mot:hover i,
.lfh-motscles__mot:focus-visible i {
  opacity: 1;
}

/* Rangée « Parcourir par sujet » (chroniques.html) : une case par sujet */
.lfh-sujets-puces {
  margin-top: 28px;
  letter-spacing: -0.025em;
}

.lfh-sujets-puces__libelle {
  margin: 0 0 12px;
  color: #000;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.lfh-sujets-puces ul {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lfh-sujets-puces a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px 8px 14px;
  border: 2px solid #000;
  background: var(--c, #fff);
  color: var(--sur-c, #000);
  box-shadow: 4px 4px 0 #000;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.lfh-sujets-puces a span {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  background: var(--sur-c, #000);
  color: var(--c, #fff);
  font-size: 12px;
  font-weight: 800;
}

.lfh-sujets-puces a:hover,
.lfh-sujets-puces a:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #000;
  outline: 0;
}

.lfh-sujets-puces .lfh-sujets-puces__tous {
  border-color: transparent;
  background: none;
  color: #000;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.lfh-sujets-puces .lfh-sujets-puces__tous:hover {
  box-shadow: none;
}

/* Pages par sujet */
.lfh-sujet__contenu {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 1024px) {
  .lfh-sujet__contenu {
    padding: 0 32px;
  }
}

@media (min-width: 1384px) {
  .lfh-sujet__contenu {
    padding: 0;
  }
}

.lfh-sujet-entete {
  padding: 56px 0 44px;
  border-bottom: 2px solid #000;
  background: var(--lfh-beige);
  color: #000;
  letter-spacing: -0.025em;
}

/* En-tête d'un sujet : la case pleine couleur du sujet */
.lfh-sujet-entete--couleur {
  background: var(--c);
  color: var(--sur-c);
}

@media (min-width: 1024px) {
  .lfh-sujet-entete {
    padding: 80px 0 56px;
  }
}

.lfh-sujet__ariane ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
}

.lfh-sujet__ariane li + li::before {
  content: "/";
  margin-right: 6px;
  opacity: 0.6;
}

.lfh-sujet__ariane a {
  color: inherit;
  text-decoration: none;
}

.lfh-sujet__ariane a:hover {
  text-decoration: underline;
}

.lfh-sujet__ariane [aria-current] {
  font-weight: 800;
}

.lfh-sujet__surtitre {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.lfh-sujet__titre {
  max-width: 1000px;
  margin: 10px 0 0;
  font-size: clamp(2.5rem, 7.5vw, 5.25rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.025em;
  overflow-wrap: break-word;
}

.lfh-sujet__intro {
  max-width: 720px;
  margin: 24px 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.6;
}

.lfh-sujet__lien {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 12px 20px;
  border: 2px solid var(--sur-c, #000);
  background: var(--sur-c, #000);
  color: var(--c, #fff);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.16s ease;
}

.lfh-sujet__lien:hover {
  transform: translateY(-2px);
}

/* Chroniques d'un sujet : fond beige, ombre de la couleur du sujet */
.lfh-sujet-chroniques.lfh-suite--clair {
  border-top: 0;
  background: var(--lfh-beige);
}

.lfh-sujet-chroniques .lfh-suite__contenu {
  padding-top: 48px;
}

.lfh-sujet-chroniques .lfh-carte {
  box-shadow: 8px 8px 0 var(--c, #000);
}

.lfh-sujet-chroniques .lfh-carte:hover,
.lfh-sujet-chroniques .lfh-carte:focus-visible {
  box-shadow: 11px 11px 0 var(--c, #000);
}

.lfh-sujet-plus {
  padding: 0 0 80px;
  background: var(--lfh-beige);
  color: #000;
  letter-spacing: -0.025em;
}

.lfh-sujet-plus .lfh-motscles__groupe {
  margin-top: 0;
  padding-top: 32px;
}

.lfh-sujet-plus .lfh-motscles__libelle {
  color: #000;
  font-size: 1.25rem;
  font-weight: 800;
}

/* Tous les sujets : une case de couleur par sujet */
.lfh-sujet-liste {
  padding: 48px 0 96px;
  background: var(--lfh-beige);
  color: #000;
  letter-spacing: -0.025em;
}

.lfh-sujets-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lfh-sujet-carte {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 24px;
  border: 2px solid #000;
  background: var(--c, #fff);
  color: var(--sur-c, #000);
  box-shadow: 8px 8px 0 #000;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.lfh-sujet-carte:hover,
.lfh-sujet-carte:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 11px 11px 0 #000;
  outline: 0;
}

.lfh-sujet-carte .lfh-carte__meta,
.lfh-sujet-carte .lfh-carte__texte {
  opacity: 1;
}

.lfh-sujet-carte__nom {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.lfh-sujet-carte__recents {
  padding-top: 10px;
  border-top: 1px solid currentColor;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
  .lfh-mobile-menu,
  .lfh-mobile-menu.is-open,
  .lfh-carte,
  .lfh-suite__tout,
  .lfh-motscles__sujet,
  .lfh-motscles__mot,
  .lfh-sujets-puces a,
  .lfh-sujet-carte {
    transition: none;
  }
}
