/* Kanayou — identité v1 (passe designer).
   Observatoire de prix indépendant : sobre, précis, honnête.
   Direction : publication statistique sur papier chaud, accent vert cannabis
   foncé (décision utilisateur 2026-09-06 ; l'interdit initial des codes
   cannabis est levé). Une seule famille typo (system stack : pas de webfont, cohérent
   avec « aucun traceur tiers » de la politique de confidentialité).
   Aucune dépendance, aucun framework, aucun JS. */

:root {
  --largeur-max: 60rem;

  /* Neutres chauds (papier / encre) */
  --fond: #fbf9f5;
  --fond-doux: #f3efe6;
  --encre: #221f1a;
  --encre-douce: #5d574c;
  --trait: #e3ddd1;

  /* Accent unique : vert cannabis foncé (décision utilisateur 2026-09-06,
     remplace le bleu outremer initial) */
  --accent: #1e5c3a;
  --accent-fonce: #143f27;

  --erreur: #a3271e;
  --rayon: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--encre);
  background: var(--fond);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
}

::selection { background: var(--accent); color: var(--fond); }

main, .site-header, .site-footer {
  max-width: var(--largeur-max);
  margin-inline: auto;
  padding-inline: 1rem;
}

main { padding-block: 1rem 3.5rem; }

/* Lien d'évitement (AA) : hors écran, visible au focus clavier. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
}
.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--encre);
  color: var(--fond);
  padding: 0.5rem 1rem;
  border-radius: var(--rayon);
  text-decoration: none;
}

/* Focus visible partout, même dessin. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* En-tête */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--trait);
}
.logo { margin: 0; font-size: 1.4rem; font-weight: 800; }
.logo a { color: var(--encre); text-decoration: none; }
/* Signature typographique : le point de donnée. « Kanayou. » */
.logo a::after { content: "."; color: var(--accent); }
.logo a:hover, .logo a:focus-visible { color: var(--accent); }
.site-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--encre-douce);
  text-decoration: none;
  font-size: 0.95rem;
}
.site-nav a:hover, .site-nav a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Pied de page */
.site-footer {
  border-top: 1px solid var(--trait);
  padding-block: 1.75rem 2.25rem;
  color: var(--encre-douce);
  font-size: 0.9rem;
}
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer a { color: var(--encre-douce); }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--accent); }
.footer-note { margin-top: 0.9rem; max-width: 42rem; }

/* Titres et prose */
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
h1 {
  font-size: clamp(1.9rem, 1.3rem + 2.6vw, 2.8rem);
  line-height: 1.15;
  font-weight: 800;
  margin: 1.25rem 0 0.75rem;
}
h2 { font-size: 1.3rem; font-weight: 700; margin: 2.25rem 0 0.6rem; }
h3 { font-size: 1.05rem; margin: 1.25rem 0 0.35rem; }

/* Héros : la promesse, puis un filet accent en signature. */
.hero { padding-block: 1.5rem 0.5rem; }
.hero h1 { margin-top: 0.5rem; }
.hero h1::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 0.25rem;
  background: var(--accent);
  margin-top: 0.9rem;
}
.hero-sub {
  color: var(--encre-douce);
  max-width: 42rem;
  font-size: 1.1rem;
}

/* Liens */
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-fonce); }

/* Tableaux de prix : les chiffres sont les héros.
   Style « tableau statistique » : filet fort sous l'en-tête, filets fins
   entre les lignes, pas de fond zébré. */
table {
  width: 100%;
  border-collapse: collapse;
  margin-block: 1rem;
  font-size: 0.95rem;
}
caption {
  caption-side: bottom;
  text-align: left;
  color: var(--encre-douce);
  font-size: 0.85rem;
  padding-top: 0.6rem;
}
th, td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--trait);
  vertical-align: top;
}
thead th {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--encre-douce);
  border-bottom: 2px solid var(--encre);
  padding-bottom: 0.45rem;
}
thead th a { color: var(--encre-douce); }
tbody th[scope="row"] { font-weight: 600; }
tbody tr:hover { background: var(--fond-doux); }
.num { text-align: right; }
/* Chiffres alignés : indispensable pour comparer des prix. */
.prix, .num { font-variant-numeric: tabular-nums; }
.prix { font-weight: 600; white-space: nowrap; }
/* Valeur de référence (médiane 30 j) : lisible mais en retrait
   du prix courant. */
.prix.ref { font-weight: 400; color: var(--encre-douce); }

/* Filtres par type : pastilles sobres. */
.type-filter, .pagination {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  margin-block: 1.25rem;
}
.type-filter a {
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--trait);
  border-radius: 999px;
  color: var(--encre-douce);
  text-decoration: none;
  font-size: 0.92rem;
}
.type-filter a:hover, .type-filter a:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}
.type-filter a[aria-current="true"] {
  background: var(--encre);
  border-color: var(--encre);
  color: var(--fond);
  font-weight: 600;
}
.pagination { color: var(--encre-douce); font-size: 0.95rem; }

/* Sections de la home */
.comparatif { margin-top: 1.5rem; }

/* Méthodologie en 3 points : compteurs « 01 02 03 »,
   registre relevé de données. */
.methode ol {
  list-style: none;
  counter-reset: etape;
  margin: 1rem 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}
.methode li {
  counter-increment: etape;
  padding-top: 0.5rem;
  border-top: 2px solid var(--encre);
}
.methode li::before {
  content: counter(etape, decimal-leading-zero);
  display: block;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

/* Capture email : panneau chaleureux, sans dark pattern. */
.inscription {
  background: var(--fond-doux);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  padding: 1.5rem 1.5rem 1.25rem;
  margin-block: 2.75rem 2.25rem;
}
.inscription h2 { margin-top: 0; }

/* Ancrage outre-mer : discret et sincère. */
.outremer {
  border-top: 1px solid var(--trait);
  padding-top: 0.5rem;
}
.outremer p { color: var(--encre-douce); max-width: 42rem; }

/* Formulaire d'inscription */
.subscribe-form { margin-block: 1rem; }
.subscribe-form p:not(.form-note):not(.hp-field) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.subscribe-form label {
  flex-basis: 100%;
  margin-bottom: 0.1rem;
  font-weight: 600;
}
.subscribe-form input[type="email"] {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--fond);
  color: var(--encre);
  min-width: min(18rem, 100%);
  font-size: 1rem;
  font-family: inherit;
}
.subscribe-form input[type="email"]:focus-visible {
  border-color: var(--accent);
  outline-offset: 0;
}
.subscribe-form button {
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--accent);
  border-radius: var(--rayon);
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 150ms ease-out;
}
.subscribe-form button:hover { background: var(--accent-fonce); border-color: var(--accent-fonce); }
.subscribe-form button:focus-visible { outline-color: var(--encre); }
.form-note {
  display: block;
  color: var(--encre-douce);
  font-size: 0.85rem;
  max-width: 38rem;
}
.errorlist { color: var(--erreur); margin: 0.25rem 0 0; padding-left: 1rem; }

/* Honeypot : masqué visuellement, présent dans le DOM pour les bots.
   Pas de display:none (certains bots l'ignorent) : hors écran. */
.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Encarts */
.notice {
  background: var(--fond-doux);
  border: 1px solid var(--trait);
  border-left: 3px solid var(--accent);
  border-radius: var(--rayon);
  padding: 0.85rem 1.1rem;
  margin-block: 1.25rem;
}
.notice p { text-wrap: pretty; }
.notice p:first-child { margin-top: 0; }
.notice p:last-child { margin-bottom: 0; }
.table-note { color: var(--encre-douce); font-size: 0.85rem; }

/* Bandeau de fraîcheur : chiffres réels du dernier relevé (jamais décoratif) */
.bandeau-stats {
  color: var(--encre-douce);
  font-size: 0.9rem;
  border-top: 1px solid var(--trait);
  padding-top: 0.6rem;
}
.bandeau-stats strong { color: var(--accent-fonce); }

/* Économie vérifiée : écart prouvé à la médiane 30 j (voir méthodologie) */
.badge-promo {
  display: inline-block;
  background: var(--accent);
  color: var(--fond);
  border-radius: var(--rayon);
  padding: 0.1rem 0.5rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

code {
  background: var(--fond-doux);
  border: 1px solid var(--trait);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

/* Blocs à copier (extraits robots.txt de la page /bot) */
pre {
  background: var(--fond-doux);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  padding: 0.85rem 1.1rem;
  overflow-x: auto;
}
pre code { background: none; border: none; padding: 0; font-size: 0.9rem; }

/* Responsive.
   Mobile (~< 640 px) : les tableaux d'offres deviennent des cartes empilées.
   Les libellés de colonnes sont portés par data-label sur chaque cellule ;
   l'en-tête reste dans le DOM (masqué visuellement) pour les lecteurs d'écran. */
@media (max-width: 40rem) {
  .site-header { flex-direction: column; gap: 0.4rem; align-items: flex-start; }

  table, tbody, tr, caption { display: block; }
  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  tbody tr {
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
    background: var(--fond);
    padding: 0.85rem 1rem;
    margin-block: 0.75rem;
  }
  tbody tr:hover { background: var(--fond); }
  tbody th[scope="row"] {
    display: block;
    border: 0;
    padding: 0 0 0.5rem;
    font-size: 1.02rem;
  }
  td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    border: 0;
    padding: 0.2rem 0;
  }
  td[data-label]::before {
    content: attr(data-label);
    color: var(--encre-douce);
    font-size: 0.85rem;
    font-weight: 400;
    text-align: left;
    white-space: normal;
  }
}

/* Trois points de méthode côte à côte sur écran large. */
@media (min-width: 40rem) {
  .methode ol { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
