/* Structure commune (mise en page, grilles, composants). Aucune valeur de marque ici :
   tout passe par les variables définies dans /theme-fr.css et /theme-ch.css.
   Le bloc :root ci-dessous n'est qu'un repli neutre si un thème est absent. */
:root {
  --bg: #fff; --bg-alt: #f4f5f7; --surface: #fff;
  --ink: #1c1f24; --body: #1c1f24; --muted: #555d69; --line: #dfe2e7;
  --btn-bg: #1c1f24; --btn-ink: #fff; --btn-border: #1c1f24;
  --cta-bg: #14507a; --cta-ink: #fff; --cta-border: #14507a;
  --btn-radius: .4rem; --btn-weight: 700;
  --hl: #fff6d6; --focus: #14507a;
  --header-bg: #fff; --header-ink: #1c1f24; --brand-bg: transparent; --brand-radius: 0; --brand-pad: 0;
  --footer-bg: #1c1f24; --footer-ink: #fff; --footer-muted: #d0d4da;
  --hero-bg: #fff; --step-num-bg: #eceef1; --step-num-ink: #1c1f24;
  --r-sm: .35rem; --r-md: .5rem; --r-lg: .75rem; --r-xl: 1rem;
  --border-strong: 2px; --border-hair: 1px; --card-border: 1px solid var(--line); --card-shadow: none;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-read: var(--font-ui); --font-data: var(--font-ui);
  --title-weight: 700; --title-tracking: -.01em; --err: #b00020; --todo-bg: #fff6d6; --todo-line: #e0b400;
  --logo-h: 1.8rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--body); font: 1rem/1.55 var(--font-ui); font-variant-numeric: tabular-nums; overflow-wrap: break-word; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .16em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { color: var(--ink); font-weight: var(--title-weight); letter-spacing: var(--title-tracking); line-height: 1.1; margin: 0 0 .6rem; }
h1 { font-size: clamp(1.9rem, 1.2rem + 3.4vw, 3.1rem); margin-top: .5rem; }
h2 { font-size: clamp(1.3rem, 1.05rem + 1.2vw, 1.8rem); margin-top: 1.8rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
.lead { font-family: var(--font-read); font-size: 1.2rem; line-height: 1.5; max-width: 40rem; }
.eyebrow, .count, .step-num, .keyfacts, .specs dt, .env-grid dt, .filters label { font-family: var(--font-data); }
.eyebrow { color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 .5rem; }

.wrap { width: 100%; max-width: 76rem; margin: 0 auto; padding: 0 1rem; }
.page { padding-top: 1rem; padding-bottom: 2rem; }
.prose { max-width: 46rem; margin-left: auto; margin-right: auto; }
.prose ul { padding-left: 1.2rem; }
.skip { position: absolute; left: .5rem; top: -4rem; background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: var(--r-sm); z-index: 10; }
.skip:focus { top: .5rem; }

/* En-tête / pied */
.site-header { background: var(--header-bg); color: var(--header-ink); }
.site-header .bar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .25rem 1rem; }
.brand { display: inline-flex; align-items: center; background: var(--brand-bg); border-radius: 0 0 var(--brand-radius) var(--brand-radius); padding: var(--brand-pad); min-height: 2.75rem; color: inherit; text-decoration: none; }
.logo { height: var(--logo-h); width: auto; max-width: 100%; }
.site-header nav { display: flex; gap: .25rem; align-self: center; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .75rem; color: var(--header-ink); font-weight: 600; }
.site-header :focus-visible { outline-color: var(--header-focus, var(--focus)); }
.site-footer { background: var(--footer-bg); color: var(--footer-ink); margin-top: 3rem; padding: 2rem 0; }
.site-footer a { color: var(--footer-ink); }
.site-footer :focus-visible { outline-color: var(--footer-focus, var(--focus)); }
.foot { display: grid; gap: 1rem; }
.foot-legal { margin: 0; color: var(--footer-muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.foot nav a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.logo--foot { height: 1.5rem; }

/* Boutons */
.button, button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.75rem; padding: .6rem 1.4rem; background: var(--btn-bg); color: var(--btn-ink); border: var(--border-strong) solid var(--btn-border); border-radius: var(--btn-radius); font: inherit; font-weight: var(--btn-weight); text-decoration: none; cursor: pointer; text-align: center; }
.button--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.button--cta { background: var(--cta-bg); color: var(--cta-ink); border-color: var(--cta-border); }
.button--block { display: flex; width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.25rem 0; }
@media (prefers-reduced-motion: no-preference) {
  .button, button { transition: transform .12s ease; }
  .button:hover, button:hover { transform: translateY(-1px); }
  .card a { transition: transform .15s ease; }
  .card a:hover { transform: translateY(-2px); }
}

/* Accueil */
.band { padding: 2.5rem 0; background: var(--bg); }
.band--alt { background: var(--bg-alt); }
.hero { background: var(--hero-bg); padding: 2rem 0 2.5rem; }
.hl { background: var(--hl); color: inherit; padding: 0 .15em; }
.section-title { margin-top: 0; margin-bottom: 1.25rem; }
.more { margin-top: 1.5rem; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: 1fr; }
.step { background: var(--surface); border: var(--card-border); border-radius: var(--r-lg); padding: 1.25rem; box-shadow: var(--card-shadow); }
.step-num { display: inline-block; background: var(--step-num-bg); color: var(--step-num-ink); font-weight: 800; font-size: 1.5rem; line-height: 1; padding: .3rem .55rem; border-radius: var(--r-sm); margin-bottom: .75rem; }

/* Filtres */
.filters { display: grid; gap: .75rem; grid-template-columns: 1fr; background: var(--surface); border: var(--card-border); border-radius: var(--r-lg); padding: 1rem; margin: 1rem 0 1.25rem; }
.filters label, .contact label { display: grid; gap: .3rem; font-size: .9rem; font-weight: 600; color: var(--muted); }
input, select, textarea { font: inherit; font-size: 1rem; min-height: 2.75rem; padding: .55rem .75rem; width: 100%; color: var(--ink); background: #fff; border: var(--border-strong) solid var(--line); border-radius: var(--r-md); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ink); }
.count { color: var(--muted); font-size: .9rem; margin-bottom: .75rem; }

/* Cartes */
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: 1fr; }
.card a { display: block; height: 100%; color: inherit; text-decoration: none; background: var(--surface); border: var(--card-border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--card-shadow); }
.card-photo { aspect-ratio: 4 / 3; background: var(--bg-alt); overflow: hidden; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: .9rem 1rem 1rem; }
.card h3 { margin: 0 0 .15rem; font-size: 1.2rem; }
.card p { margin: 0 0 .25rem; }
.trim, .facts { color: var(--muted); font-size: .92rem; }
.price { font-family: var(--font-data); font-weight: 800; font-size: 1.35rem; color: var(--ink); margin-top: .5rem; letter-spacing: -.01em; }
.price--ask { font-size: 1.05rem; font-weight: 700; color: var(--muted); }
.availability { font-size: .875rem; font-weight: 600; color: var(--muted); margin: .25rem 0 .75rem; }
.availability--now { color: var(--ink); }
.no-photo { background: var(--bg-alt); color: var(--muted); display: grid; place-items: center; aspect-ratio: 4 / 3; width: 100%; }
.empty-state { background: var(--surface); border: var(--border-hair) dashed var(--muted); border-radius: var(--r-lg); padding: 2rem 1.25rem; text-align: center; max-width: 40rem; margin: 1.5rem auto; }
.empty-title { font-weight: 700; font-size: 1.2rem; color: var(--ink); }

/* Fiche */
.crumb { margin: .5rem 0; }
.crumb a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.detail-head h1 { margin-bottom: .2rem; }
.detail-grid { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
.stage figure { margin: 0; display: none; border-radius: var(--r-xl); overflow: hidden; background: var(--bg-alt); scroll-margin-top: 1rem; }
.stage figure:first-child { display: block; }
.stage:has(:target) figure:first-child:not(:target) { display: none; }
.stage figure:target { display: block; }
.stage img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.thumbs { list-style: none; display: flex; gap: .5rem; margin: .6rem 0 0; padding: 0 0 .25rem; overflow-x: auto; }
.thumbs a { display: block; border: var(--border-strong) solid transparent; border-radius: var(--r-md); overflow: hidden; }
.thumbs a:hover { border-color: var(--ink); }
.thumbs img { width: 6rem; height: 4.5rem; max-width: none; object-fit: cover; }
.buy { background: var(--surface); border: var(--card-border); border-radius: var(--r-lg); padding: 1.1rem; box-shadow: var(--card-shadow); }
.price--big { font-size: 2rem; margin: 0 0 .5rem; }
.keyfacts { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.keyfacts li { border: var(--border-hair) solid var(--line); border-radius: 999px; padding: .15rem .7rem; font-size: .9rem; background: var(--bg); }
.buy p:last-child { margin: 0; }
.specs { display: grid; grid-template-columns: minmax(7rem, 40%) 1fr; margin: 0; border-top: var(--border-hair) solid var(--line); }
.specs dt, .specs dd { margin: 0; padding: .6rem 0; border-bottom: var(--border-hair) solid var(--line); }
.specs dt { color: var(--muted); font-size: .9rem; }
.specs dd { font-weight: 600; color: var(--ink); }
.env { background: var(--surface); border: var(--border-strong) solid var(--ink); border-radius: var(--r-lg); padding: 1rem 1.1rem 1.1rem; }
.env h2 { margin-top: 0; }
.env-grid { display: grid; gap: .75rem; grid-template-columns: 1fr; margin: 0; }
.env-grid > div { background: var(--bg-alt); border-radius: var(--r-md); padding: .8rem .9rem; }
.env-grid dt { color: var(--muted); font-size: .85rem; font-weight: 700; margin-bottom: .25rem; }
.env-grid dd { margin: 0; font-family: var(--font-data); font-weight: 800; font-size: 1.25rem; color: var(--ink); }
.todo { background: var(--todo-bg); color: #1c1f24; border-left: 4px solid var(--todo-line); padding: .4rem .6rem; font-size: .9rem; display: inline-block; margin: .5rem 0 0; }

/* Fiche détaillée : colonne principale, historique, état, équipements */
.area-main { display: grid; gap: 1.25rem; min-width: 0; }
.area-main > section { min-width: 0; }
.area-main h2 { margin-bottom: .5rem; }
.description p { margin: 0 0 .75rem; max-width: 65ch; }
.facts { list-style: none; margin: 0; padding: 0; border-top: var(--border-hair) solid var(--line); }
.facts li { padding: .6rem 0; border-bottom: var(--border-hair) solid var(--line); color: var(--ink); }
.equip-lang { color: var(--muted); font-size: .9rem; margin: 0 0 .5rem; }
.equip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1.5rem; border-top: var(--border-hair) solid var(--line); }
.equip + .equip, .equip-more .equip { border-top: 0; }
.equip li { padding: .45rem 0 .45rem 1.4rem; border-bottom: var(--border-hair) solid var(--line); position: relative; color: var(--ink); overflow-wrap: anywhere; }
.equip li::before { content: "✓"; position: absolute; left: 0; color: var(--muted); font-weight: 700; }
.equip-more { margin-top: .25rem; }
.equip-more summary { cursor: pointer; font-weight: 700; padding: .6rem 0; min-height: 2.75rem; display: flex; align-items: center; color: var(--ink); }
.equip-more[open] summary { margin-bottom: 0; }

/* Contact */
.contact { display: grid; gap: 1rem; max-width: 34rem; margin-top: 1rem; }
.about-car { background: var(--bg-alt); border-radius: var(--r-md); padding: .6rem .9rem; display: inline-block; }
.error { color: var(--err); font-size: .9rem; font-weight: 600; }
.error::before { content: "Erreur : "; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (min-width: 40rem) {
  .wrap { padding: 0 1.5rem; }
  .filters { grid-template-columns: repeat(3, 1fr) auto; align-items: end; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .env-grid { grid-template-columns: repeat(3, 1fr); }
  .equip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot { grid-template-columns: auto 1fr auto; align-items: center; gap: 1.5rem; }
  .band { padding: 3.5rem 0; }
  .hero { padding: 3.5rem 0; }
  :root { --logo-h: 2rem; }
}
@media (min-width: 60rem) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .cards--home { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: minmax(0, 1fr) 22rem; grid-template-areas: "gallery buy" "main buy"; column-gap: 2rem; }
  .area-gallery { grid-area: gallery; }
  .area-main { grid-area: main; }
  .buy { grid-area: buy; position: sticky; top: 1rem; align-self: start; }
}
@media (min-width: 75rem) {
  .cards, .cards--home { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Aperçu verrouillé en mode démonstration */
.demo-banner { background: #b00020; color: #fff; text-align: center; font-weight: 700; padding: .5rem 1rem; font-size: .95rem; }
