/* ==========================================================================
   BLSVision · Pages véhicules générées (/reprogrammation-moteur/)
   Complète site.css, compat.css et pages.css. Tokens existants uniquement.
   Fil d'Ariane, badge « Hors voie publique », fonctions détaillées,
   cartes de motorisation et de modèle.
   ========================================================================== */

/* Fil d'Ariane */
.crumbs { font-size: var(--fs-sm); color: var(--c-text-subtle); }
.crumbs__list { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); list-style: none; padding: 0; margin: 0; }
.crumbs__list li { display: inline-flex; align-items: center; gap: var(--s-2); min-width: 0; overflow-wrap: anywhere; }
.crumbs__list li + li::before { content: "·"; color: var(--c-text-subtle); }
.crumbs__list a { color: var(--c-text-muted); }
.crumbs__list [aria-current="page"] { color: var(--c-text); }

/* En-tête : le titre peut être long (noms de motorisation) */
.vh-hero h1 { overflow-wrap: anywhere; }
.vh-result { margin-top: var(--s-6); }
.vh-result .compat__result { margin-top: 0; }

/* Badge « Hors voie publique » (fonctions de dépollution) */
.vp-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-warn);
  background: var(--c-warn-soft);
  color: var(--c-warn);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  vertical-align: middle;
}

/* Chips du résultat : liens vers le détail des fonctions */
.vh-chip { text-decoration: none; padding-block: 6px; }
/* Chip avec badge : rendu en ligne (icône, libellé puis badge s'enchaînent comme du texte) */
.vh-chip:has(.vp-badge) { display: block; padding: 8px var(--s-4); line-height: 1.6; }
.vh-chip:has(.vp-badge) .icon { display: inline-block; vertical-align: -3px; margin-right: var(--s-2); }
.vh-chip:has(.vp-badge) .vp-badge { margin-left: var(--s-2); }
.vh-chip:hover { border-color: var(--c-line-accent); }

/* Fonctions détaillées */
.vh-functions { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-4); }
@media (min-width: 640px) { .vh-functions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .vh-functions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vh-function {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s-4);
  align-items: start;
  padding: var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--c-line);
  background: var(--c-surface-2);
  scroll-margin-top: calc(var(--header-h) + var(--s-4));
}
.vh-function:target { border-color: var(--c-line-accent); }
.vh-function__body { display: grid; gap: var(--s-2); }
.vh-function__title { font-weight: 600; color: var(--c-text); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.vh-function__text { color: var(--c-text-muted); font-size: var(--fs-sm); }
.vh-offroad { align-items: start; }
.vh-offroad span { color: var(--c-text); font-size: var(--fs-sm); }

/* Cartes de motorisation */
.vh-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
@media (min-width: 640px) { .vh-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .vh-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vh-cards > li { display: grid; min-width: 0; }
.vh-card { display: grid; gap: var(--s-2); align-content: start; padding: var(--s-4) var(--s-5); text-decoration: none; color: var(--c-text); min-width: 0; }
.vh-card__title { font-family: var(--f-display); font-weight: 600; font-size: var(--fs-md); line-height: var(--lh-snug); overflow-wrap: anywhere; }
.vh-card__meta { font-size: var(--fs-xs); color: var(--c-text-subtle); }
.vh-card__figures { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; color: var(--c-text-muted); }
.vh-card__label { color: var(--c-text-subtle); }
.vh-card__stage1 { color: var(--c-accent); font-weight: 600; }
.vh-card__stage1 .vh-card__label { color: inherit; font-weight: 500; }
.vh-card__gain { font-weight: 500; }

/* Cartes de modèle et de marque */
.vh-models { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .vh-models { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .vh-models { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .vh-models { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.vh-models > li { display: grid; min-width: 0; }
.vh-model {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name arrow" "meta arrow";
  align-items: center;
  column-gap: var(--s-3);
  row-gap: var(--s-1);
  padding: var(--s-4) var(--s-5);
  text-decoration: none;
  color: var(--c-text);
}
.vh-model__name { grid-area: name; font-family: var(--f-display); font-weight: 600; font-size: var(--fs-lg); line-height: var(--lh-snug); overflow-wrap: anywhere; }
.vh-model__meta { grid-area: meta; font-size: var(--fs-xs); color: var(--c-text-subtle); }
.vh-model__arrow { grid-area: arrow; width: 18px; height: 18px; color: var(--c-accent); transition: transform var(--t-base) var(--ease); }
.vh-model:hover .vh-model__arrow { transform: translateX(3px); }

/* Sections de génération : ancre sous le header fixe */
.vh-gen { scroll-margin-top: var(--header-h); }

/* Boutons dont le libellé contient un nom de modèle (parfois long) : retour à la ligne permis */
.vh-links .btn { white-space: normal; text-align: center; line-height: 1.25; padding-block: var(--s-2); max-width: 100%; }
/* Chip avec badge : quand le badge passe à la ligne, coins moins arrondis */
.vh-chip:has(.vp-badge) { border-radius: var(--r-md); }

/* Badge discret « Avant 07/2020 » (calculateurs Bosch MDG1) sur les cartes de motorisation */
.vh-card__badge { display: inline-block; margin-left: var(--s-2); padding: 0 6px; border-radius: var(--r-pill); border: 1px solid var(--c-line-strong); color: var(--c-text-muted); font-size: var(--fs-xs); line-height: 1.5; white-space: nowrap; }
