/* 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 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: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.6;
}

.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;
}

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