/* ═══════════════════════════════════════════════════════════════════
   Guides simplifiés (présentation, démarrage, guide d'utilisation)
   S'ajoute à atelier.css : mêmes couleurs et polices, texte plus gros,
   une tâche = un titre, des étapes numérotées, une capture.
   Version auto / vélo : <html data-v="auto|velo">, éléments [data-only="auto|velo"].
   ═══════════════════════════════════════════════════════════════════ */

html[data-v="auto"] [data-only="velo"],
html[data-v="velo"] [data-only="auto"] { display: none !important; }

body { font-size: 1.0625rem; line-height: 1.6; }

/* ── Barre du haut ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 239, 227, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.topbar .brand-name { font-size: 1rem; }
.topbar-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.topbar-nav a {
  padding: 6px 12px; border-radius: 99px;
  font-size: 0.88rem; font-weight: 500; color: var(--ink-3);
}
.topbar-nav a:hover { background: var(--paper-warm); text-decoration: none; }
.topbar-nav a[aria-current="page"] { background: var(--ink); color: var(--paper-warm); }

/* ── Sélecteur auto / vélo ─────────────────────────────────────── */
.vswitch {
  display: inline-flex; padding: 3px;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 99px;
}
.vswitch button {
  padding: 7px 16px; border-radius: 99px;
  font-size: 0.92rem; font-weight: 600; color: var(--ink-3);
  min-height: 40px;
}
.vswitch button[aria-pressed="true"] { background: var(--copper); color: #fff; box-shadow: var(--shadow-1); }
.vswitch-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.vswitch-row .hint { font-size: 0.9rem; color: var(--muted); }

/* ── Mise en page ──────────────────────────────────────────────── */
.page { max-width: 1120px; margin: 0 auto; padding: 0 16px 80px; }
.page-grid { display: grid; grid-template-columns: 1fr; gap: 40px; }
@media (min-width: 1100px) {
  .page-grid.with-toc { grid-template-columns: 240px minmax(0, 1fr); }
}
.content { max-width: 760px; min-width: 0; }

.toc { display: none; }
@media (min-width: 1100px) {
  .toc { display: block; position: sticky; top: 76px; align-self: start; padding-top: 48px; }
  .toc ol { list-style: none; counter-reset: toc; }
  .toc li { counter-increment: toc; }
  .toc a {
    display: flex; gap: 10px; padding: 6px 10px; border-radius: var(--r-sm);
    color: var(--ink-3); font-size: 0.92rem;
  }
  .toc a::before { content: counter(toc); font-family: var(--font-mono); color: var(--muted-2); min-width: 1.2em; }
  .toc a:hover { background: var(--paper-warm); text-decoration: none; }
}

/* ── En-tête de page ───────────────────────────────────────────── */
.hero { padding: 48px 0 28px; }
.hero h1 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(2.1rem, 6vw, 3.2rem); line-height: 1.05; letter-spacing: -0.02em;
}
.hero h1 em { color: var(--copper); }
.hero .lede { margin-top: 14px; max-width: 40ch; }

/* ── Sommaire en tête (téléphone et guide) ─────────────────────── */
.summary {
  margin: 8px 0 8px; padding: 18px 20px;
  background: var(--paper-warm); border: 1px solid var(--rule-soft); border-radius: var(--r-lg);
}
.summary h2 { font-size: 0.8rem; font-family: var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.summary ol { padding-left: 1.4em; columns: 2 220px; column-gap: 24px; }
.summary li { padding: 3px 0; break-inside: avoid; }

/* ── Chapitres et tâches ───────────────────────────────────────── */
.chapter { padding-top: 48px; scroll-margin-top: 64px; }
.chapter > h2 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(1.7rem, 4vw, 2.2rem); line-height: 1.1; letter-spacing: -0.015em;
  padding-bottom: 10px; border-bottom: 2px solid var(--ink);
  display: flex; align-items: baseline; gap: 12px;
}
.chapter > h2 .n { font-family: var(--font-mono); font-size: 0.95rem; color: var(--copper); }
.chapter > p.intro { margin-top: 12px; font-size: 1.08rem; color: var(--ink-2); }

.task { margin-top: 32px; scroll-margin-top: 64px; }
.task h3 { font-size: 1.22rem; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.task > p { margin-top: 8px; }

ol.steps { list-style: none; counter-reset: step; margin-top: 12px; }
ol.steps > li {
  counter-increment: step; position: relative;
  padding: 6px 0 6px 44px; min-height: 36px; color: var(--ink-2);
}
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 4px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: var(--paper-warm);
  display: grid; place-items: center;
  font-weight: 600; font-size: 0.9rem;
}

ul.plain { margin-top: 10px; padding-left: 1.2em; }
ul.plain li { padding: 3px 0; color: var(--ink-2); }

b, strong { color: var(--ink); font-weight: 600; }
.btn-name {
  font-weight: 600; color: var(--ink);
  background: var(--paper-warm); border: 1px solid var(--rule);
  border-radius: 6px; padding: 0 6px; white-space: nowrap;
}

.note {
  margin-top: 12px; padding: 12px 16px;
  background: var(--copper-wash); border-left: 3px solid var(--copper); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--ink-2); font-size: 0.98rem;
}
.note b:first-child { color: var(--copper); }

/* ── Captures ──────────────────────────────────────────────────── */
figure.shot { margin-top: 16px; }
figure.shot a { display: block; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--rule); box-shadow: var(--shadow-2); background: #fff; }
figure.shot img { width: 100%; height: auto; }
figure.shot.phone-shot a { max-width: 300px; }
figure.shot figcaption { margin-top: 8px; font-size: 0.9rem; color: var(--muted); }

/* ── Tableaux simples ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin-top: 14px; }
table.simple { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
table.simple th, table.simple td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
table.simple th { font-size: 0.8rem; font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

/* ── Cartes (présentation) ─────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.box {
  background: var(--paper-warm); border: 1px solid var(--rule-soft); border-radius: var(--r-lg);
  padding: 18px 20px;
}
.box h3 { font-size: 1.05rem; margin-bottom: 8px; }
.box.before h3 { color: var(--muted); }
.box.after { border-color: var(--copper-soft); }
.box.after h3 { color: var(--copper); }
.box ul { padding-left: 1.1em; }
.box li { padding: 3px 0; color: var(--ink-2); }

.moment { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; margin-top: 32px; }
@media (min-width: 860px) { .moment { grid-template-columns: 280px minmax(0, 1fr); gap: 28px; } }
.moment .when { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--copper); }
.moment h3 { font-size: 1.25rem; margin-top: 4px; }
.moment p { margin-top: 6px; }
.moment figure.shot { margin-top: 0; }

/* ── Vidéo ─────────────────────────────────────────────────────── */
.video { margin-top: 24px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--rule); box-shadow: var(--shadow-3); background: var(--ink); }
.video video { display: block; width: 100%; height: auto; }
.video-block { margin-top: 20px; }
.video-block .video { margin-top: 8px; }
.video-label { font-size: 0.95rem; color: var(--ink-2); }
.video-tag {
  display: inline-block; margin-right: 6px; padding: 2px 8px; border-radius: 999px;
  background: var(--copper); color: #fff; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
}
.video-grid { display: grid; grid-template-columns: 1fr; gap: 28px; margin-top: 8px; }

/* ── Liste à cocher ────────────────────────────────────────────── */
ul.checklist { list-style: none; margin-top: 12px; }
ul.checklist li { padding: 8px 0 8px 36px; position: relative; border-bottom: 1px dashed var(--rule-soft); }
ul.checklist li::before {
  content: ''; position: absolute; left: 0; top: 9px;
  width: 22px; height: 22px; border: 2px solid var(--ink-3); border-radius: 5px; background: #fff;
}

/* ── Questions ─────────────────────────────────────────────────── */
details.qa { border-bottom: 1px solid var(--rule-soft); }
details.qa summary { cursor: pointer; padding: 14px 0; font-weight: 600; color: var(--ink); list-style: none; }
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::before { content: '+'; display: inline-block; width: 1.4em; color: var(--copper); font-weight: 700; }
details.qa[open] summary::before { content: '–'; }
details.qa p { padding: 0 0 14px 1.4em; }

/* ── Appels à l'action et pied ─────────────────────────────────── */
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.page-foot {
  margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--rule);
  display: flex; gap: 8px 24px; flex-wrap: wrap; font-size: 0.92rem; color: var(--muted);
}

/* ── Impression : seule la version choisie, sans la barre ──────── */
@media print {
  .topbar, .toc, .vswitch-row, .cta-row, .video { display: none !important; }
  body { font-size: 11pt; background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .chapter > h2, .task h3 { break-after: avoid; }
  .chapter { break-before: auto; }
  .task, figure.shot { break-inside: avoid; }
  figure.shot a { box-shadow: none; }
  details.qa > p { display: block; }
}

/* Téléphone : barre du haut sur une seule ligne */
@media (max-width: 520px) {
  .topbar .brand-name { display: none; }
  .topbar-inner { flex-wrap: nowrap; gap: 8px; }
  .topbar-nav { flex-wrap: nowrap; gap: 2px; }
  .topbar-nav a { padding: 6px 8px; font-size: 0.8rem; white-space: nowrap; }
}
