/*
  Feuille de style de l'index /outils/ (public/outils/index.html).

  public/outils/index.html est généré par .github/scripts/factory-maillage.mjs,
  qui y écrit <link rel="stylesheet" href="/outils/_commun/outil.css"> : ce
  fichier doit exister dans public/ pour être copié tel quel dans dist/ par
  Vite. Sans lui, la règle de réécriture « ** -> /index.html » renvoie le HTML
  de l'application sous cette URL, servi en text/html : le navigateur refuse la
  feuille et l'index s'affiche sans style.

  Mission 31 (#265) : fond clair, rangement par besoin. Mise en page reprise de
  la maquette A « Clair clinique » (docs/rapports/maquettes/a-outils.html, PR
  #226), validée par Huzine le 09/10/2026. Palette, en-tête, logo et boutons
  (.btn-calc, .btn-offre, .btn-member) repris des pages outils elles-mêmes
  (public/outils/<slug>/index.html), pour que /outils/ et ses pages se
  ressemblent. Aucune page outil ne charge ce fichier.

  Classes attendues par l'index généré : .hub, .site-header, .wrap, .logo,
  .nav, .btn-member, .hero, .ariane, .chapo, .chips, .chip, .section,
  .besoin-titre, .lien-fleche, .grille, .card, .outil, .vedette, .mono,
  .etiquette, .besoin, .cta, .suite, .relais-final, .outil-actions, .btn-calc,
  .btn-offre, .site-footer. S'y ajoute .liens-outils, la liste de la section
  #outils-lies que le même script insère dans chaque page outil.
*/

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --ink: #0F2C59;
  --ink-deep: #071828;
  --paper: #F8FAFC;
  --cream: #F1F5F9;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --text: #1E293B;
  --text-mid: #475569;
  --sage: #00B894;
  --sage-glow: #34D399;
  --sage-muted: #ECFDF5;
  --sage-texte: #047857;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  background: var(--paper);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sage-texte); }
a:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; border-radius: 4px; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* En-tête : celui des pages outils (fond nuit, logo serif), avec la navigation de la maquette. */
.site-header {
  background: rgba(7, 24, 40, 0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
  gap: 8px;
}

.logo {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 20px;
  line-height: 1.2;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.logo span { color: var(--sage); }

.nav { display: flex; align-items: center; gap: 2px; }

.nav a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-bottom: 2px solid transparent;
}

.nav a:hover { color: var(--sage-glow); }
.nav a.actif { color: #fff; border-bottom-color: var(--sage-glow); }

.nav a.btn-member {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 100px;
  padding: 0 14px;
  margin-left: 4px;
  font-size: 13px;
  white-space: nowrap;
}

.nav a.btn-member:hover { border-color: var(--sage); color: var(--sage); }
.nav .long { display: none; }

/* Haut de page */
.hero { padding: 4px 0 8px; }

.ariane { font-size: 14px; color: var(--text-mid); padding: 16px 0 4px; }
.ariane a { color: var(--sage-texte); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }

h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  color: var(--ink);
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.15;
  margin: 0;
}

h3 { font-size: 17px; line-height: 1.35; color: var(--ink); font-weight: 700; }

h1, h2 { text-wrap: balance; }

.chapo { font-size: 18px; color: var(--text-mid); max-width: 640px; }

/* Raccourcis vers les groupes */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 14px;
  padding: 4px 0 8px;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
  mask-image: linear-gradient(90deg, #000 85%, transparent);
}

.chips::-webkit-scrollbar { display: none; }
.chips::after { content: ''; flex: 0 0 24px; }

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}

.chip small { color: var(--text-mid); font-weight: 500; font-size: 14px; }
.chip:hover { border-color: var(--sage); }

/* Un groupe par besoin */
.section { padding: 28px 0; scroll-margin-top: 64px; }
.section + .section { border-top: 1px solid var(--border); }

.besoin-titre { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-bottom: 12px; }

.lien-fleche {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  font-weight: 700;
  color: var(--sage-texte);
  text-decoration: none;
}

.lien-fleche:hover { text-decoration: underline; }

.grille { display: grid; gap: 12px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover { border-color: var(--sage); transform: translateY(-2px); }

.outil { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: inherit; }
.outil > div { flex: 1; align-self: stretch; display: flex; flex-direction: column; align-items: flex-start; }
.outil p { color: var(--text-mid); font-size: 15px; margin-top: 4px; }
.outil .besoin { font-size: 14px; color: var(--text); margin-top: 8px; }
.outil .besoin b { color: var(--ink); }
/* Le bouton de chaque carte en bas : alignés d'une carte à l'autre dans une même rangée. */
.outil .cta { margin-top: auto; padding-top: 10px; font-weight: 700; color: var(--sage-texte); font-size: 15px; }

.mono {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--sage-muted);
  color: var(--sage-texte);
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1.1;
}

.vedette { border: 2px solid var(--sage); background: linear-gradient(180deg, #F0FDF9, #fff 60%); }

.etiquette {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sage-texte);
  background: var(--sage-muted);
  border-radius: 6px;
  padding: 3px 8px;
}

.suite {
  margin-top: 14px;
  padding: 6px 16px;
  border-radius: 12px;
  background: var(--cream);
  font-size: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  align-items: center;
  justify-content: space-between;
}

/* Bloc final : vers le bilan gratuit (aucun lien vers l'offre payante, règle du 27/09/2026). */
.relais-final { background: var(--ink-deep); color: #E2E8F0; border-radius: 18px; padding: 24px; }
.relais-final h2 { color: #fff; }
.relais-final p { color: #C3D0DC; margin-top: 8px; }

/* Boutons : ceux des pages outils (.outil-actions), à 48 px de haut pour le pouce. */
.outil-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.outil-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

.outil-actions .btn-calc { background: var(--sage); color: #071828; }
.outil-actions .btn-calc:hover { background: var(--sage-glow); }
.outil-actions .btn-offre { color: var(--sage-texte); border: 1px solid var(--sage); }
.relais-final .outil-actions .btn-offre { color: var(--sage-glow); }

/* Section « Outils liés » insérée dans chaque page outil par factory-maillage.mjs
   (les pages ont leur propre copie, fond clair ; gardée ici pour une page qui lierait ce fichier). */
.liens-outils {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 10px;
}

.liens-outils li { background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.liens-outils a { display: block; padding: 12px 16px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.liens-outils a:hover { color: var(--sage-texte); }

/* Pied de page */
.site-footer {
  background: var(--ink-deep);
  color: #C3D0DC;
  font-size: 14px;
  padding: 28px 0;
  margin-top: 32px;
}

.site-footer .wrap { display: flex; flex-wrap: wrap; column-gap: 18px; }

.site-footer a {
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
}

.site-footer a:hover { color: var(--sage-glow); }

@media (max-width: 759px) {
  .outil-actions a { width: 100%; }
}

@media (min-width: 420px) {
  .nav .long { display: inline; }
  .nav .court { display: none; }
}

@media (min-width: 760px) {
  h1 { font-size: 46px; }
  .nav { gap: 4px; }
  .nav a { padding: 0 10px; font-size: 15px; }
  .chips { flex-wrap: wrap; -webkit-mask-image: none; mask-image: none; }
  .grille.deux { grid-template-columns: 1fr 1fr; }
  .grille.trois { grid-template-columns: repeat(3, 1fr); }
  .relais-final { padding: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
}
