/* =========================================================================
   Pelouse Libre — feuille de style unique du comparateur.
   Identité : encre + mousse profonde + bleu signal RTK sur fond vert pâle.
   Signature : la « trace de tonte » — une ligne serpentine que le robot
   dessine sur le terrain (hero + séparateurs de section).
   Pas de framework. Mobile d'abord. Focus clavier et reduced-motion respectés.
   ========================================================================= */

:root {
  /* --- Palette (4–6 valeurs nommées) --- */
  --encre:  #0F1A14;   /* texte, presque noir teinté de vert */
  --gazon:  #355E3B;   /* mousse profonde — structure, titres */
  --rosee:  #F3F5EE;   /* fond, vert-gris très pâle (pas du cream) */
  --rtk:    #1E7FA8;   /* bleu signal satellite — accent unique */
  --terre:  #8A5A3B;   /* brun terre — usage rare (entretien/réparation) */
  --brume:  #D7DCD0;   /* lignes, bordures, séparateurs discrets */

  --encre-doux: #3A4740;
  --rtk-fonce:  #155F80;
  --blanc:      #FBFCF9;

  /* --- Typographie --- */
  --display: "Space Grotesk", system-ui, sans-serif;
  --corps:   "Source Serif 4", Georgia, serif;
  --mono:    "IBM Plex Mono", ui-monospace, monospace;

  /* --- Échelle & rythme --- */
  --pas: 1.5rem;
  --largeur-texte: 68ch;
  --largeur-page: 1140px;
  --rayon: 4px;            /* sobre, presque droit */
}

/* ----------------------------- Base ----------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--rosee);
  color: var(--encre);
  font-family: var(--corps);
  font-size: 1.075rem;
  line-height: 1.7;
  font-feature-settings: "onum" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--gazon);
  line-height: 1.12;
  letter-spacing: -0.015em;
  font-weight: 600;
  margin: 2.4rem 0 0.7rem;
}
h1 { font-size: clamp(2rem, 5.5vw, 3.1rem); color: var(--encre); }
h2 { font-size: clamp(1.45rem, 3.4vw, 2rem); }
h3 { font-size: 1.22rem; color: var(--encre); }

p { margin: 0 0 1.1rem; }

a { color: var(--rtk-fonce); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--gazon); }

:focus-visible {
  outline: 3px solid var(--rtk);
  outline-offset: 2px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; }

.contenance { width: 100%; max-width: var(--largeur-page); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2.4rem); }

/* Étiquette mono : encode une donnée vraie (catégorie, repère), pas une déco */
.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--rtk-fonce);
  margin: 0 0 .6rem;
}

/* ----------------------------- En-tête ----------------------------- */
.site-tete {
  border-bottom: 1px solid var(--brume);
  background: color-mix(in srgb, var(--rosee) 86%, transparent);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(1.1) blur(6px);
}
.site-tete .contenance {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .85rem;
}
.marque { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.marque .logo-trace { width: 34px; height: 22px; flex: none; }
.marque .nom {
  font-family: var(--display); font-weight: 700; font-size: 1.18rem;
  color: var(--encre); letter-spacing: -.02em;
}
.marque .nom b { color: var(--gazon); font-weight: 700; }
.site-nav { display: flex; gap: 1.3rem; flex-wrap: wrap; }
.site-nav a {
  font-family: var(--display); font-size: .94rem; font-weight: 500;
  color: var(--encre-doux); text-decoration: none;
}
.site-nav a:hover { color: var(--rtk-fonce); }

/* ----------------------------- Trace de tonte (signature) ----------------------------- */
/* Ligne serpentine animée : le robot trace son passage. Réutilisée en hero + séparateur. */
.trace {
  display: block; width: 100%; height: auto;
  color: var(--gazon);
}
.trace .chemin {
  fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round;
  stroke-dasharray: 1400; stroke-dashoffset: 1400;
  animation: tondre 3.2s ease-out forwards;
}
.trace .robot { fill: var(--rtk); }
@keyframes tondre { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .trace .chemin { stroke-dashoffset: 0; animation: none; }
}

.separateur-trace { margin: 3.2rem 0; color: var(--brume); }
.separateur-trace svg { display: block; width: 100%; height: 26px; }
.separateur-trace path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ----------------------------- Hero (accueil) ----------------------------- */
.hero { padding-block: clamp(2.6rem, 7vw, 4.6rem) 1.4rem; }
.hero .accroche {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.1rem, 6vw, 3.6rem); line-height: 1.06;
  letter-spacing: -.025em; color: var(--encre); max-width: 18ch; margin: .2rem 0 1rem;
}
.hero .accroche em { color: var(--gazon); font-style: normal; }
.hero .sous { font-size: 1.2rem; max-width: 56ch; color: var(--encre-doux); }
.hero-trace { margin-top: 1.8rem; max-width: 760px; }

/* ----------------------------- Cartes piliers ----------------------------- */
.section-tete { margin-bottom: 1.3rem; }
.grille-piliers {
  display: grid; gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 620px) { .grille-piliers { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .grille-piliers { grid-template-columns: repeat(4, 1fr); } }

.carte-pilier {
  display: flex; flex-direction: column; gap: .5rem;
  background: var(--blanc);
  border: 1px solid var(--brume);
  border-radius: var(--rayon);
  padding: 1.25rem 1.2rem 1.3rem;
  text-decoration: none; color: var(--encre);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.carte-pilier:hover {
  transform: translateY(-3px);
  border-color: var(--gazon);
  box-shadow: 0 10px 28px -18px rgba(15,26,20,.45);
}
.carte-pilier .num {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .14em;
  color: var(--rtk-fonce);
}
.carte-pilier h3 { margin: .2rem 0 .1rem; color: var(--gazon); font-size: 1.15rem; }
.carte-pilier p { margin: 0; font-size: .96rem; color: var(--encre-doux); line-height: 1.55; }

/* ----------------------------- Liste d'articles (générée par build.mjs) ----------------------------- */
.liste-articles { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.carte-article {
  padding: 1.05rem 0; border-bottom: 1px solid var(--brume);
  display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; align-items: baseline;
}
.carte-article a {
  font-family: var(--display); font-weight: 600; font-size: 1.18rem;
  color: var(--encre); text-decoration: none; letter-spacing: -.01em;
}
.carte-article a:hover { color: var(--rtk-fonce); }
.carte-article time {
  font-family: var(--mono); font-size: .76rem; color: var(--encre-doux);
  letter-spacing: .04em; white-space: nowrap;
}
.carte-article p { grid-column: 1 / -1; margin: .15rem 0 0; color: var(--encre-doux); font-size: .98rem; }
.carte-article.vide,
.liste-articles .vide {
  color: var(--encre-doux); font-style: italic; border-bottom: 0;
  padding: 1.05rem 0; list-style: none;
}

/* ----------------------------- Page article / pilier ----------------------------- */
.article { padding-block: 1.8rem 2.6rem; }
.article .corps { max-width: var(--largeur-texte); }
.fil-ariane {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .06em;
  color: var(--encre-doux); margin: 0 0 1.2rem; display: flex; flex-wrap: wrap; gap: .35rem;
}
.fil-ariane a { color: var(--rtk-fonce); text-decoration: none; }
.fil-ariane span { color: var(--brume); }
.article .meta-date { font-family: var(--mono); font-size: .76rem; color: var(--encre-doux); display: block; margin: -.2rem 0 1.4rem; }

.article .corps h2 { border-top: 1px solid var(--brume); padding-top: 1.5rem; }
.article .corps h2:first-of-type { border-top: 0; padding-top: 0; }
.article .corps ul, .article .corps ol { padding-left: 1.3rem; }
.article .corps li { margin: .35rem 0; }
.article .corps blockquote {
  margin: 1.4rem 0; padding: .2rem 0 .2rem 1.2rem;
  border-left: 3px solid var(--rtk); color: var(--encre-doux); font-style: italic;
}

/* Tableaux comparatifs */
.article table, table.comparatif {
  width: 100%; border-collapse: collapse; margin: 1.4rem 0; font-size: .96rem;
  font-family: var(--display);
}
.article th, .article td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--brume); }
.article thead th {
  font-size: .78rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--rtk-fonce); border-bottom: 2px solid var(--gazon);
}
.article tbody tr:hover { background: color-mix(in srgb, var(--brume) 35%, transparent); }

/* Encart entretien / pont réparation (rare, ton « terre ») */
.encart-entretien {
  margin: 1.8rem 0; padding: 1.1rem 1.2rem;
  background: color-mix(in srgb, var(--terre) 9%, var(--blanc));
  border: 1px solid color-mix(in srgb, var(--terre) 35%, var(--brume));
  border-radius: var(--rayon);
}
.encart-entretien h3 { margin-top: 0; color: var(--terre); }

/* Marqueur de lien affilié — bouton sobre (avant branchement réel) */
.lien-affilie, a.lien-affilie {
  display: inline-block; font-family: var(--display); font-weight: 600;
  background: var(--rtk); color: var(--blanc); text-decoration: none;
  padding: .55rem 1rem; border-radius: var(--rayon); margin: .2rem 0;
}
.lien-affilie:hover { background: var(--rtk-fonce); color: var(--blanc); }

/* FAQ */
.faq details {
  border-bottom: 1px solid var(--brume); padding: .8rem 0;
}
.faq summary {
  font-family: var(--display); font-weight: 600; cursor: pointer; color: var(--encre);
}
.faq summary::marker { color: var(--rtk); }

/* ----------------------------- Pied de page ----------------------------- */
.site-pied {
  margin-top: 3rem; border-top: 1px solid var(--brume);
  background: var(--encre); color: var(--rosee);
}
.site-pied .contenance { padding-block: 2.4rem 2rem; display: grid; gap: 1.6rem; }
@media (min-width: 760px) { .site-pied .contenance { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-pied h4 { font-family: var(--display); color: var(--blanc); font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 .7rem; }
.site-pied p, .site-pied li { color: #C8D2C8; font-size: .92rem; line-height: 1.6; }
.site-pied a { color: #BFE0EF; }
.site-pied ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.site-pied .transparence { font-size: .85rem; color: #A9B6A9; }
.site-pied .legal {
  grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 1.1rem; font-family: var(--mono); font-size: .72rem; color: #8FA08F; letter-spacing: .03em;
}
.site-pied .legal b { color: var(--rosee); font-weight: 600; }
