/*
 * Feuille du catalogue public /aides-publiques/, copiée telle quelle par
 * scripts/generate-aides-publiques.js. Sous l'en-tête du site vitrine, le contenu reprend l'onglet
 * Aides de l'application : fond #FCFCFD, cartes blanches portées par une ombre douce, rayons de
 * 24 px, Dosis pour le texte et Moriarty1 pour le titre de marque.
 *
 * Contrastes (AA, 4,5:1 pour le texte courant) : le texte et les aplats utilisent
 * l'orange principal (blanc dessus : 5,2:1). Le survol des boutons utilise l'orange
 * secondaire. Les teintes « alerte » et « info » ne sont pas l'orange de marque.
 */

@font-face {
  font-family: 'Dosis';
  src: url('/font/Dosis-VariableFont_wght.woff2') format('woff2'), url('/font/Dosis-VariableFont_wght.ttf') format('truetype');
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: 'Moriarty1';
  src: url('/font/Moriarty1.woff2') format('woff2'), url('/font/Moriarty1.otf') format('opentype');
  font-display: swap;
}

:root {
  --navy: #002e72;
  --gris-800: #102449;
  --gris-700: #16305c;
  --gris-600: #46587b;
  --gris-500: #5a6b8c;
  --gris-texte: #526489;
  --gris-400: #8397b8;
  --gris-300: #b6c4da;
  --gris-200: #d3dcea;
  --gris-100: #e1e8f2;
  --gris-50: #ebeff5;
  /* Oranges Moriarty. Mêmes teintes que $orange et $orange-secondary (src/assets/css/var.scss). */
  --orange: #c2410e;
  --orange-secondary: #e14f0b;
  --orange-marque: var(--orange);
  --orange-texte: var(--orange);
  --orange-fonce: var(--orange);
  --fond: #fcfcfd;
  --ombre-carte: 0 1px 2px rgba(0, 27, 69, 0.05),
    0 12px 32px -16px rgba(0, 27, 69, 0.1);
  --ombre-survol: 0 10px 15px -3px rgba(0, 27, 69, 0.1),
    0 4px 6px -4px rgba(0, 27, 69, 0.1);
  --marque: 'Moriarty1', 'Dosis', 'Trebuchet MS', sans-serif;
  /* La hauteur de l'en-tête collé en haut : sous lui se calent la latérale des filtres et le
     haut des résultats quand la pagination y ramène. */
  --haut-barre: 65px;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--fond);
  color: var(--navy);
  font-family: 'Dosis', 'Trebuchet MS', system-ui, sans-serif;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.6;
  /* Un nom d'aide sans espace ne doit jamais élargir la page à 375 px. */
  overflow-wrap: anywhere;
}

a {
  color: var(--navy);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--orange-marque);
  outline-offset: 2px;
}

.icone {
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

summary {
  list-style: none;
  cursor: pointer;
}

summary::-webkit-details-marker {
  display: none;
}

/* ------------------------------------------------------------------------
   L'en-tête du site vitrine et le pied
   ------------------------------------------------------------------------ */

.entete {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
  border-bottom: 1px solid var(--gris-100);
}

.entete-barre {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  box-sizing: border-box;
  max-width: 1920px;
  margin: 0 auto;
  padding: 12px 16px;
}

.logo {
  display: block;
  flex-shrink: 0;
  line-height: 0;
}

.logo img {
  width: 110px;
  height: auto;
}

.menu {
  display: none;
  flex: 1;
  min-width: 0;
}

.menu ul,
.menu-mobile ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}

.menu a {
  color: #000;
  font-size: 15px;
  font-weight: 600;
  line-height: 25px;
  text-decoration: none;
  white-space: nowrap;
}

.menu a:hover,
.menu a[aria-current] {
  color: var(--orange-fonce);
}

.menu a[aria-current] {
  text-decoration: underline;
  text-decoration-color: var(--orange-marque);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.menu-mobile {
  margin-left: auto;
}

.menu-mobile > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--navy);
}

.menu-mobile > summary .icone {
  width: 26px;
  height: 26px;
}

.menu-mobile .menu-fermer,
.menu-mobile[open] .menu-ouvrir {
  display: none;
}

.menu-mobile[open] .menu-fermer {
  display: block;
}

.menu-mobile-panneau {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 16px 20px;
  background: #fff;
  border-top: 1px solid var(--gris-100);
  box-shadow: 0 16px 24px -12px rgba(0, 27, 69, 0.25);
}

.menu-mobile-panneau li a {
  display: block;
  padding: 12px 4px;
  border-bottom: 1px solid var(--gris-100);
  color: #000;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
}

.menu-mobile-panneau li a[aria-current] {
  color: var(--orange-fonce);
}

@media (min-width: 1000px) {
  :root {
    --haut-barre: 71px;
  }

  .entete-barre {
    padding: 15px 40px;
  }

  .logo img {
    width: 120px;
  }

  .menu {
    display: block;
  }

  .menu-mobile {
    display: none;
  }
}

.contenu {
  box-sizing: border-box;
  max-width: 1920px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}

.contenu-lecture {
  max-width: 58rem;
}

@media (min-width: 768px) {
  .contenu {
    padding: 24px 20px 40px;
  }

  .contenu-lecture {
    padding: 24px 24px 40px;
  }
}

.pied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  box-sizing: border-box;
  max-width: 1920px;
  margin: 0 auto;
  padding: 20px 16px 28px;
  border-top: 1px solid var(--gris-100);
  color: var(--gris-500);
  font-size: 14px;
}

.pied p {
  margin: 0;
}

.pied ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pied a {
  color: var(--gris-600);
}

@media (min-width: 768px) {
  .pied {
    padding: 20px 20px 28px;
  }
}

/* ------------------------------------------------------------------------
   Fiches, sources, diagnostic
   ------------------------------------------------------------------------ */

.ariane ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  color: var(--gris-500);
}

.ariane a {
  color: var(--gris-600);
}

.ariane li + li::before {
  content: '›';
  margin-right: 0.25rem;
}

h1 {
  margin: 0.5rem 0 1rem;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  line-height: 1.2;
}

h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.4rem;
  line-height: 1.3;
}

h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.15rem;
}

.chapo {
  font-size: 1.15rem;
}

.maj {
  color: var(--gris-500);
  font-size: 0.9rem;
}

/* Le haut de la fiche, dessiné comme une carte du catalogue. */
.fiche-tete {
  margin: 0 0 2rem;
  padding: 20px 24px 0;
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--ombre-carte);
}

.fiche-tete h1 {
  margin: 12px 0;
  color: var(--gris-800);
}

.fiche-tete .chapo {
  margin: 0 0 16px;
  color: var(--gris-600);
}

.fiche-tete .etiquettes,
.fiche-tete .tailles {
  margin: 0 0 12px;
}

/* La date de mise à jour, juste sous le titre. */
.fiche-tete .maj {
  margin: -4px 0 12px;
}

/* Les cibles de la fiche mènent à la page de leur thème. */
.etiquettes a {
  color: inherit;
  text-decoration: none;
}

.etiquettes a:hover {
  text-decoration: underline;
}

.fiche-tete .bandeau {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 12px 24px;
  margin: 16px -24px 0;
  padding: 16px 24px;
  list-style: none;
  background: rgba(235, 239, 245, 0.5);
  border-top: 1.5px solid var(--gris-100);
  border-radius: 0 0 24px 24px;
}

.bandeau .libelle {
  display: block;
  color: var(--gris-500);
  font-size: 0.85rem;
}

.bandeau strong {
  display: block;
  color: var(--gris-800);
}

.bandeau a {
  color: inherit;
}

.bandeau-montant strong {
  color: var(--orange-texte);
  font-weight: 800;
}

.criteres {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: 0.35rem 1rem;
  margin: 1rem 0;
}

.criteres dt {
  font-weight: 700;
}

.criteres dd {
  margin: 0;
}

.appels {
  margin: 2.5rem 0 2rem;
  padding: 1.5rem;
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--ombre-carte);
}

.appels p {
  margin: 1rem 0 0;
}

.bouton {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--orange);
  border-radius: 999px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
}

.bouton:hover {
  background: var(--orange-secondary);
}

.sources {
  margin: 2rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--gris-200);
  border-radius: 8px;
  font-size: 0.95rem;
}

.sources h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

/* Le bloc « En bref » : la réponse directe, juste sous le haut de fiche (brief, §3.6). */
.en-bref {
  margin: 0 0 1rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border-left: 4px solid var(--orange);
  border-radius: 8px;
  box-shadow: var(--ombre-carte);
}

.en-bref h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.en-bref p {
  margin: 0;
}

/* Les boutons d'appel du corps de la fiche : des liens, la CSP interdit tout formulaire. */
.appel-fiche {
  margin: 1rem 0 2rem;
}

.appel-fiche .bouton {
  max-width: 100%;
  box-sizing: border-box;
  font-size: 1.05rem;
  text-align: center;
}

/* La demande d'aide après « Démarches » : deux courriels préremplis (liens de courriel), côte à côte
   en large, l'un sous l'autre en mobile. Le second, en contour, porte sa ligne d'explication. */
.demande {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem 1rem;
  margin: 1rem 0 2rem;
}

.demande-choix {
  max-width: 100%;
}

.demande .bouton {
  max-width: 100%;
  box-sizing: border-box;
  font-size: 1.05rem;
  text-align: center;
}

.bouton-contour {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--orange);
  color: var(--orange-texte);
}

.bouton-contour:hover {
  background: rgba(194, 65, 14, 0.07);
  color: var(--orange-fonce);
}

.demande-note {
  margin: 0.4rem 0 0;
  padding: 0 0.75rem;
  color: var(--gris-600);
  font-size: 0.9rem;
}

/* Le repli, sur toute la largeur sous les deux boutons : l'adresse en clair, sélectionnée d'un
   clic pour la copier. */
.demande-repli {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0 0.75rem;
  color: var(--gris-600);
  font-size: 0.9rem;
}

.demande-adresse {
  color: var(--navy);
  font-weight: 600;
  overflow-wrap: anywhere;
  user-select: all;
}

/* « expert-comptable » ne se coupe pas à son trait d'union. */
.insecable {
  white-space: nowrap;
}

@media (max-width: 600px) {
  .demande {
    flex-direction: column;
    align-items: stretch;
  }

  .demande .bouton {
    display: block;
  }

  .demande-note,
  .demande-repli {
    text-align: center;
  }
}

/* Le tableau « L'essentiel » (brief, §3.7). */
.essentiel table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--ombre-carte);
  font-size: 0.95rem;
}

.essentiel th,
.essentiel td {
  padding: 8px 16px;
  border-bottom: 1px solid var(--gris-100);
  text-align: left;
  vertical-align: top;
}

.essentiel th {
  width: 34%;
  color: var(--gris-800);
  font-weight: 700;
}

.essentiel tr:last-child th,
.essentiel tr:last-child td {
  border-bottom: 0;
}

/* « Ce que Moriarty vérifie pour vous », dans les Démarches. */
.verifie {
  margin: 1.5rem 0 0;
  padding: 1rem 1.25rem;
  background: rgba(235, 239, 245, 0.5);
  border: 1px solid var(--gris-200);
  border-radius: 16px;
}

.verifie h3 {
  margin-top: 0;
}

.verifie h4 {
  margin: 1rem 0 0.25rem;
  font-size: 1rem;
}

.verifie p {
  margin: 0 0 0.25rem;
  color: var(--gris-600);
  font-size: 0.95rem;
}

.verifie ul {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}

/* La FAQ en accordéon : la question ouvre sa réponse, le chevron se retourne à l'ouverture. */
.faq-question {
  border-bottom: 1px solid var(--gris-100);
}

.faq-question > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0.75rem 0;
}

.faq-question > summary h3 {
  margin: 0;
  font-size: 1.05rem;
}

.faq-question > summary:hover h3 {
  color: var(--orange-texte);
}

.faq-question > summary .chevron {
  width: 16px;
  height: 16px;
  color: var(--gris-texte);
  transition: transform 0.25s;
}

.faq-question[open] > summary .chevron {
  transform: scaleY(-1);
}

.faq-question > p {
  margin: 0 0 1rem;
}

/*
 * Le maillage : « Autres aides de… », « Autres aides en… », « Aides pour le même projet ».
 * Chaque bloc est une rangée de cartes du catalogue qui défile à l'horizontale, cartes calées
 * au bord. La marge négative et le retrait rendent aux cartes la place de leur ombre, de leur
 * levée au survol et du contour de focus, que le défilement couperait sinon.
 */
.maillage h2 {
  font-size: 1.15rem;
}

.rangee-cartes {
  display: flex;
  gap: 16px;
  margin: 0 -8px;
  padding: 8px 8px 24px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 8px;
  scrollbar-color: var(--gris-300) transparent;
  scrollbar-width: thin;
  list-style: none;
}

/* 300 px ; sur une rangée plus étroite, la carte laisse toujours voir le bord de la suivante. */
.rangee-cartes > .carte {
  flex: none;
  width: min(300px, calc(100% - 32px));
  height: auto;
  scroll-snap-align: start;
}

.dispositifs {
  margin: 1rem 0 0;
  font-size: 0.95rem;
}

.voir-aussi {
  margin: 1rem 0 0;
  color: var(--gris-600);
  font-size: 0.95rem;
}

@media (max-width: 600px) {
  .criteres {
    grid-template-columns: minmax(0, 1fr);
  }

  .criteres dd {
    margin-bottom: 0.5rem;
  }

  .essentiel th,
  .essentiel td {
    padding: 8px 12px;
  }

  .essentiel th {
    width: 40%;
  }

  .fiche-tete {
    padding: 16px 16px 0;
  }

  .fiche-tete .bandeau {
    margin: 16px -16px 0;
    padding: 16px;
  }
}

/* /aides-publiques/diagnostic/ : l'encart du cabinet Moriarty. Pas d'attribut style (la CSP de
   ces pages refuse le style en ligne). */
iframe.encart {
  display: block;
  width: 100%;
  min-height: 760px;
  border: 0;
  margin: 16px 0;
}

/* ------------------------------------------------------------------------
   Le catalogue (onglet Aides)
   ------------------------------------------------------------------------ */

.catalogue {
  color: var(--gris-800);
  font-size: 14px;
  line-height: 1.45;
}

.catalogue-tete {
  margin-bottom: 16px;
}

.titre-page {
  margin: 0;
  color: var(--navy);
  font-family: var(--marque);
  font-size: 28px;
  font-weight: 400;
  word-spacing: 0.2em;
  line-height: 1.25;
}

.sous-titre {
  margin: 4px 0 0;
  color: var(--gris-500);
  font-size: 14px;
}

.sans-script {
  margin: 0 0 16px;
  color: var(--gris-500);
}

/* La recherche et les puces, sur la même ligne en grand écran. */
.outils {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.recherche {
  width: 100%;
  max-width: 448px;
}

.recherche-champ {
  position: relative;
}

.recherche-champ .loupe {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--gris-texte);
  pointer-events: none;
}

.recherche input {
  box-sizing: border-box;
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  border: 1.5px solid transparent;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--ombre-carte);
  color: var(--gris-800);
  font: inherit;
  font-size: 14px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.recherche input:focus {
  border-color: var(--gris-300);
}

.recherche input::placeholder {
  color: var(--gris-texte);
  opacity: 1;
}

.elargie {
  margin: 4px 8px 0;
  overflow: hidden;
  color: var(--gris-500);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.puces {
  display: flex;
  flex: 1 1 0;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.puce {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border: 1.5px solid var(--gris-300);
  border-radius: 999px;
  background: #fff;
  color: var(--gris-700);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.puce:hover {
  border-color: var(--gris-400);
}

.puce .coche {
  display: none;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  stroke-width: 2.5;
}

.puce[aria-pressed='true'] {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

.puce[aria-pressed='true'] .coche {
  display: block;
}

/* La barre latérale des filtres et les résultats. */
.disposition {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filtres > summary {
  display: none;
}

.filtres-carte {
  padding: 20px;
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--ombre-carte);
}

.filtres-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.filtres-titre {
  margin: 0;
  color: var(--gris-800);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.effacer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gris-500);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.effacer:hover {
  color: var(--orange-texte);
}

.effacer .icone {
  width: 12px;
  height: 12px;
}

.section {
  border-bottom: 1.5px solid var(--gris-100);
}

.section:last-child {
  border-bottom: 0;
}

.section > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
}

.section-titre {
  color: var(--gris-700);
  font-size: 14px;
  font-weight: 700;
}

.section-compte {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(194, 65, 14, 0.1);
  color: var(--orange-fonce);
  font-size: 12px;
  font-weight: 600;
}

.section > summary .chevron {
  width: 12px;
  height: 12px;
  margin-left: auto;
  color: var(--gris-texte);
  transition: transform 0.25s;
}

.section[open] > summary .chevron {
  transform: scaleY(-1);
}

.section-corps {
  padding-bottom: 16px;
}

.cases {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.case {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -8px;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.case:hover {
  background: rgba(235, 239, 245, 0.6);
}

.case:has(input:checked) {
  background: rgba(194, 65, 14, 0.05);
}

.case input {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--orange);
}

.case-libelle {
  flex: 1;
  min-width: 0;
  color: var(--gris-600);
  font-size: 14px;
  line-height: 1.25;
}

.case-compte {
  color: var(--gris-texte);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.plus {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--orange-texte);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.groupe + .groupe {
  margin-top: 12px;
}

.groupe-titre {
  margin: 0 0 8px;
  color: var(--gris-700);
  font-size: 14px;
  font-weight: 600;
}

/* Une région : chevron des départements à gauche, puis sa case. */
.territoire {
  position: relative;
  padding-left: 24px;
}

.departements > summary {
  position: absolute;
  top: 3px;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  color: var(--gris-texte);
}

.departements > summary .chevron {
  width: 12px;
  height: 12px;
  transform: rotate(-90deg);
}

.departements[open] > summary .chevron {
  transform: none;
}

.departements > .cases {
  margin: 4px 0 4px 4px;
  padding-left: 8px;
  border-left: 1.5px solid var(--gris-200);
}

.departements .case-libelle {
  font-size: 12px;
}

.montants {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.montant-champ {
  flex: 1;
  min-width: 0;
}

.montant-libelle {
  display: block;
  margin-bottom: 4px;
  color: var(--gris-500);
  font-size: 12px;
}

.saisie {
  position: relative;
  display: block;
}

.saisie input {
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  padding: 0 28px 0 12px;
  border: 1.5px solid var(--gris-300);
  border-radius: 24px;
  background: #fff;
  color: var(--gris-800);
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.saisie input:focus {
  border-color: var(--orange);
}

.unite {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--gris-texte);
  font-size: 11px;
}

.montant-tiret {
  padding-bottom: 10px;
  color: var(--gris-texte);
}

.resultats {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  /* La grille compte ses colonnes sur la place qu'elle a, pas sur la largeur de l'écran. */
  container-type: inline-size;
  scroll-margin-top: calc(var(--haut-barre) + 16px);
}

.resultats-tete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.compteur {
  margin: 0;
  color: var(--gris-600);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.compteur:focus {
  outline: none;
}

.actifs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.actif {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  min-height: 24px;
  padding: 2px 6px;
  border: 1.5px solid rgba(194, 65, 14, 0.2);
  border-radius: 8px;
  background: rgba(194, 65, 14, 0.05);
  color: var(--orange-fonce);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  cursor: pointer;
}

.actif .croix {
  width: 10px;
  height: 10px;
}

.actif-reste {
  border-color: var(--gris-200);
  background: var(--gris-50);
  color: var(--gris-600);
  cursor: default;
}

.tout-effacer {
  margin-left: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gris-500);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.tout-effacer:hover {
  color: var(--orange-texte);
}

.grille {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@container (min-width: 520px) {
  .grille {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container (min-width: 760px) {
  .grille {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@container (min-width: 1080px) {
  .grille {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* La carte d'une aide (UserAideCard dans TuileGrille). */
.carte {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--ombre-carte);
  transition: box-shadow 0.2s, transform 0.2s;
}

.carte:hover {
  box-shadow: var(--ombre-survol);
  transform: translateY(-2px);
}

.carte-haut {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.carte > .carte-haut {
  padding: 16px 20px 0;
}

.pastilles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pastille {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-sizing: border-box;
  min-height: 24px;
  padding: 2px 6px;
  border: 1.5px solid;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
}

/* Au-dessus du lien de la carte, pour que son infobulle (la date) s'affiche. */
.pastille[title] {
  position: relative;
  z-index: 1;
  cursor: help;
}

.pastille .icone {
  width: 12px;
  height: 12px;
  margin-right: 2px;
}

.pastille-primaire {
  border-color: rgba(194, 65, 14, 0.2);
  background: rgba(194, 65, 14, 0.05);
  color: var(--orange-fonce);
}

.pastille-succes {
  border-color: rgba(25, 104, 69, 0.2);
  background: rgba(25, 104, 69, 0.05);
  color: #196845;
}

.pastille-alerte {
  border-color: rgba(184, 113, 24, 0.25);
  background: rgba(184, 113, 24, 0.05);
  color: #96590c;
}

.pastille-erreur {
  border-color: rgba(163, 43, 24, 0.2);
  background: rgba(163, 43, 24, 0.05);
  color: #a32b18;
}

.pastille-info {
  border-color: rgba(110, 150, 206, 0.2);
  background: rgba(110, 150, 206, 0.05);
  color: #3f66a6;
}

.carte-corps {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 12px 20px 16px;
}

.carte-titre {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--gris-800);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.375;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  transition: color 0.2s;
}

.carte:hover .carte-titre {
  color: var(--orange-texte);
}

.carte-titre a {
  color: inherit;
  text-decoration: none;
}

/* Toute la carte mène à la fiche. */
.carte-titre a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
}

.carte-titre a:focus-visible {
  outline: none;
}

.carte-titre a:focus-visible::after {
  outline: 3px solid var(--orange-marque);
  outline-offset: 2px;
}

.carte-resume {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--gris-500);
  font-size: 14px;
  line-height: 1.625;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.etiquettes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.etiquettes li {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 24px;
  padding: 2px 6px;
  border: 1.5px solid var(--orange);
  border-radius: 8px;
  color: var(--orange-texte);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
}

.tailles {
  margin: 0;
  color: var(--gris-700);
  font-size: 12px;
  font-weight: 700;
}

.carte-pied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding: 14px 20px;
  border-top: 1.5px solid var(--gris-100);
  border-radius: 0 0 24px 24px;
  background: rgba(235, 239, 245, 0.5);
}

.montant {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--orange-texte);
  font-size: 16px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decouvrir {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
  color: var(--orange-texte);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.decouvrir .fleche {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.carte:hover .decouvrir .fleche {
  transform: translateX(2px);
}

/* L'état vide. */
.vide {
  padding: 48px 16px;
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--ombre-carte);
  text-align: center;
}

.vide p {
  margin: 0 0 16px;
  color: var(--gris-500);
}

.vide .vide-titre {
  margin-bottom: 4px;
  color: var(--gris-800);
  font-size: 18px;
  font-weight: 700;
}

.bouton-plein {
  height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 24px;
  background: var(--orange);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.bouton-plein:hover {
  background: var(--orange-secondary);
}

/* Pages guides (comparatifs, hubs) : tableau large, marges du gabarit .contenu. */
.guide-tableau {
  width: 100%;
  margin: 1rem 0 1.5rem;
  overflow-x: auto;
}

.guide-tableau table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.guide-tableau th,
.guide-tableau td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--gris-100);
  text-align: left;
  vertical-align: top;
}

.guide-tableau th {
  font-weight: 700;
}

.guide-appel {
  margin: 1.25rem 0;
}

/* Comparatif des prêts : colonnes stables, fourchette en avant, cartes sur mobile. */
.guide-comparatif {
  width: 100%;
  margin: 8px 0 28px;
}

.guide-comparatif table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 15px;
}

.comparatif-col-nom {
  width: 24%;
}

.comparatif-col-qui {
  width: 20%;
}

.comparatif-col-montant {
  width: 20%;
}

.comparatif-col-duree {
  width: 14%;
}

.comparatif-col-garantie {
  width: 22%;
}

.guide-comparatif thead th {
  position: sticky;
  top: var(--haut-barre);
  z-index: 2;
  padding: 12px 14px;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  vertical-align: bottom;
}

.guide-comparatif tbody th,
.guide-comparatif tbody td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--gris-200);
  background: #fff;
  text-align: left;
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.guide-comparatif tbody tr:nth-child(even) th,
.guide-comparatif tbody tr:nth-child(even) td {
  background: var(--gris-50);
}

.guide-comparatif .comparatif-nom,
.guide-comparatif a.comparatif-nom {
  color: var(--navy);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
}

.guide-comparatif .comparatif-principal {
  display: block;
  color: var(--navy);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.guide-comparatif .comparatif-detail,
.guide-comparatif .comparatif-qui,
.guide-comparatif .comparatif-integral {
  color: var(--gris-700);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}

.guide-comparatif .comparatif-detail,
.guide-comparatif .comparatif-qui {
  display: block;
}

.guide-comparatif .comparatif-detail {
  margin-top: 4px;
}

.comparatif-etiquette {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.comparatif-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.comparatif-badges li {
  margin: 0;
  padding: 4px 10px;
  border: 1px solid var(--gris-200);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.comparatif-integral {
  margin: 0;
}

@media (max-width: 899px) {
  .guide-comparatif table,
  .guide-comparatif tbody,
  .guide-comparatif tr,
  .guide-comparatif td,
  .guide-comparatif tbody th {
    display: block;
    width: auto;
    min-width: 0;
  }

  .guide-comparatif table {
    table-layout: auto;
  }

  .guide-comparatif thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .guide-comparatif tr {
    margin: 0 0 16px;
    padding: 16px 16px 4px;
    border-top: 4px solid var(--orange);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--ombre-carte);
  }

  .guide-comparatif tbody th,
  .guide-comparatif tbody td {
    padding: 0 0 14px;
    border: 0;
    background: transparent;
  }

  .guide-comparatif tbody tr:nth-child(even) th,
  .guide-comparatif tbody tr:nth-child(even) td {
    background: transparent;
  }

  .comparatif-etiquette {
    position: static;
    display: block;
    width: auto;
    height: auto;
    margin-bottom: 4px;
    overflow: visible;
    clip: auto;
    color: var(--gris-600);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: normal;
  }

  .guide-comparatif .comparatif-nom,
  .guide-comparatif a.comparatif-nom {
    font-size: 20px;
  }
}

/* La pagination (PaginationWithText). */
.pagination-zone {
  display: flex;
  justify-content: center;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 16px 0;
}

.page-bout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1.5px solid var(--gris-300);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 5px 1.5px -4px rgba(0, 27, 69, 0.09);
  color: var(--gris-700);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.page-bout:hover {
  background: var(--gris-50);
}

.page-bout[aria-disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-bout .icone {
  width: 20px;
  height: 20px;
}

.page-bout-texte,
.pages {
  display: none;
}

.page-sur {
  color: var(--gris-700);
  font-size: 14px;
  font-weight: 600;
}

.pages {
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page,
.page-ellipse {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: var(--gris-700);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.page:hover {
  background: var(--orange-secondary);
  color: #fff;
}

.page[aria-current='page'] {
  background: var(--orange);
  color: #fff;
}

@media (min-width: 640px) {
  .pagination {
    justify-content: center;
    width: auto;
    gap: 32px;
  }

  .page-bout {
    padding: 10px 14px;
  }

  .page-bout .icone,
  .page-sur {
    display: none;
  }

  .page-bout-texte {
    display: inline;
  }

  .pages {
    display: flex;
  }
}

/* Sans les données de la recherche (index.json injoignable), les outils ne feraient rien. */
.sans-recherche .outils,
.sans-recherche .laterale {
  display: none;
}

/* Mobile et tablette : les filtres deviennent un panneau repliable au-dessus des résultats. */
@media (max-width: 1023px) {
  .filtres > summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border: 1.5px solid var(--gris-300);
    border-radius: 24px;
    background: #fff;
    color: var(--gris-700);
    font-size: 14px;
    font-weight: 600;
  }

  .filtres > summary .filtre {
    width: 14px;
    height: 14px;
  }

  .filtres[open] > summary {
    margin-bottom: 12px;
  }

  /* Replié tant que recherche.js n'a pas décidé (ouvert en grand écran, fermé ici). */
  .catalogue:not(.pret) .filtres > .filtres-carte {
    display: none;
  }

  .filtres-nombre {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--orange);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
  }

  .recherche input,
  .saisie input {
    /* Sous 16 px, Safari iOS zoome la page au focus du champ. */
    font-size: 16px;
  }
}

@media (min-width: 1024px) {
  .disposition {
    flex-direction: row;
    align-items: flex-start;
  }

  .laterale {
    position: sticky;
    top: calc(var(--haut-barre) + 16px);
    flex-shrink: 0;
    width: 288px;
    max-height: calc(100vh - var(--haut-barre) - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 24px;
  }

  .resultats {
    flex: 1 1 0;
  }

  .filtres-nombre {
    display: none;
  }
}

/* ------------------------------------------------------------------------
   Pages thématiques (région, type d'aide, thème) et « Parcourir le catalogue »
   ------------------------------------------------------------------------ */

.pilier-intro {
  max-width: 60rem;
  margin: 0 0 8px;
  color: var(--gris-700);
  font-size: 16px;
  line-height: 1.6;
}

.pilier-intro p {
  margin: 0 0 12px;
}

.chiffres {
  margin: 0 0 24px;
}

.chiffres h2,
.parcourir h2 {
  margin: 24px 0 12px;
  color: var(--navy);
  font-size: 20px;
}

.chiffres table {
  border-collapse: collapse;
  min-width: min(100%, 24rem);
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--ombre-carte);
  font-size: 14px;
}

.chiffres th,
.chiffres td {
  padding: 8px 16px;
  border-bottom: 1px solid var(--gris-100);
  text-align: left;
}

.chiffres thead th {
  color: var(--gris-500);
  font-weight: 600;
}

.chiffres tbody th {
  font-weight: 600;
}

.chiffres td {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chiffres tbody tr:last-child th,
.chiffres tbody tr:last-child td {
  border-bottom: 0;
}

.pilier .resultats {
  margin-top: 8px;
}

.parcourir {
  margin: 40px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--gris-100);
  font-size: 14px;
  /* Le pied de page y mène (#parcourir) : sous l'en-tête collé, pas dessous. */
  scroll-margin-top: var(--haut-barre);
}

.parcourir-groupes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px 32px;
}

@media (min-width: 900px) {
  .parcourir-groupes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.parcourir h3 {
  margin: 12px 0 8px;
  color: var(--gris-800);
  font-size: 16px;
}

.parcourir ul {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 12rem;
  column-gap: 24px;
}

.parcourir li {
  padding: 3px 0;
  break-inside: avoid;
}

.parcourir-compte {
  color: var(--gris-500);
  font-size: 12px;
}

.parcourir-tout {
  margin: 16px 0 0;
  font-weight: 600;
}
