/* ============================================================
   Encre Atelier — cahier d’atelier
   EB Garamond (titres) + Source Sans 3 (texte)
   ============================================================ */

:root {
  --blue: #A8321E;
  --blue-700: #8E2918;
  --blue-900: #1C1A17;
  --ink: #0F0E0C;
  --text: #1C1A17;
  --muted: #5E5850;
  --cyan: #E2BFB5;
  --cyan-100: #F6E6E1;
  --cyan-50: #FBF8F1;
  --paper: #F4EFE4;
  --paper-2: #EAE3D4;
  --white: #FFFFFF;
  --line: #D9D0BE;
  --line-strong: #B9B1A2;
  --coral: #B4442F;
  --coral-100: #FBEAE5;
  --green: #1D7A55;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;

  --radius: 10px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(28, 26, 23, .06), 0 2px 8px rgba(28, 26, 23, .05);
  --shadow: 0 6px 24px rgba(28, 26, 23, .10);

  --font-title: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Palette DA Encre Atelier (02b) */
  --primary: #A8321E;
  --primary-hover: #8E2918;
  --on-primary: #FFFFFF;
  --secondary: #1C1A17;
  --bg: #F4EFE4;
  --surface: #FBF8F1;
  --callout-bg: #F6E6E1;
  --callout-text: #6E1F12;
  --callout-border: #E2BFB5;
  /* Alias consommés par les blocs du parc (05b, 06a…) */
  --fill: #EAE3D4;
  --text-muted: #5E5850;
  --text-secondary: #3A3631;
  --text-strong: #0F0E0C;
  --border: #D9D0BE;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; }
a { color: var(--blue-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-900); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 {
  font-family: var(--font-title);
  color: var(--ink);
  line-height: 1.18;
  margin: 0 0 var(--sp-4);
  font-weight: 600;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 5vw + .5rem, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.55rem, 2.6vw + .6rem, 2.2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 var(--sp-4); }
ul, ol { padding-left: 1.25rem; margin: 0 0 var(--sp-4); }

.container { width: min(1160px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(760px, 100% - 2rem); margin-inline: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff;
  padding: 8px 14px; border-radius: 6px; z-index: 200;
}
.skip-link:focus { left: 8px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--blue-700); margin-bottom: var(--sp-3);
}
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--blue); }

.icon { flex: none; vertical-align: -4px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: .98rem;
  text-decoration: none; border: 2px solid transparent; cursor: pointer;
  font-family: var(--font-body); line-height: 1.2;
  transition: background .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 4px 14px rgba(168, 50, 30, .28); }
.btn-primary:hover { background: var(--blue-700); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--blue-700); border-color: var(--blue); }
.btn-ghost:hover { background: var(--cyan-100); color: var(--blue-900); }
.btn-light { background: #fff; color: var(--blue-900); }
.btn-light:hover { background: var(--cyan); color: var(--blue-900); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-5); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(244, 239, 228, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px dashed var(--line-strong);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; position: relative; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-text { font-family: var(--font-title); font-weight: 700; font-size: 1.3rem; letter-spacing: -.01em; }
.logo-text em { font-style: italic; font-weight: 500; color: var(--blue); }
.logo-light { color: #fff; }
.logo-light .logo-text em { color: var(--cyan); }

.nav-toggle {
  display: inline-flex; background: none; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 8px; color: var(--ink); cursor: pointer;
}
.main-nav {
  display: none; position: absolute; top: 100%; left: -1rem; right: -1rem;
  background: var(--paper); border-bottom: 1px solid var(--line); padding: var(--sp-3) 1rem var(--sp-5);
  box-shadow: var(--shadow);
}
.main-nav.open { display: block; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav a { display: block; padding: 10px 4px; color: var(--ink); text-decoration: none; font-weight: 500; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--blue); }
.main-nav .sub { padding-left: var(--sp-4); border-left: 2px solid var(--cyan); margin-bottom: var(--sp-2); }
.main-nav .sub a { font-weight: 400; font-size: .95rem; padding: 6px 4px; color: var(--muted); }
.sub-num {
  display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px;
  border-radius: 50%; background: var(--cyan-100); color: var(--blue-700); font-size: .72rem; font-weight: 600;
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .main-nav { display: block; position: static; background: none; border: 0; box-shadow: none; padding: 0; }
  .main-nav > ul { display: flex; gap: var(--sp-5); align-items: center; }
  .main-nav > ul > li > a { padding: 24px 2px; position: relative; }
  .main-nav > ul > li > a[aria-current="page"]::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 14px; height: 2px; background: var(--blue);
  }
  .has-sub { position: relative; }
  .main-nav .sub {
    display: none; position: absolute; top: 100%; left: -12px; min-width: 230px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: var(--sp-2); margin: 0;
  }
  .has-sub:hover .sub, .has-sub:focus-within .sub { display: block; }
  .main-nav .sub a { padding: 9px 12px; border-radius: 6px; color: var(--text); }
  .main-nav .sub a:hover { background: var(--cyan-100); }
}

/* ---------- Hero « cahier » ---------- */
.ruled {
  background-color: var(--paper);
  background-image: linear-gradient(to bottom, transparent 31px, rgba(168, 50, 30, .13) 32px);
  background-size: 100% 32px;
  position: relative;
}
.ruled::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: clamp(12px, 5vw, 64px);
  width: 1px; background: rgba(180, 68, 47, .35); pointer-events: none;
}
.hero { padding: var(--sp-8) 0 var(--sp-7); overflow: hidden; }
.hero-grid { display: grid; gap: var(--sp-6); align-items: center; }
.hero h1 em { font-style: italic; color: var(--blue); font-weight: 600; }
.hero-lead { font-size: 1.15rem; color: var(--text); max-width: 56ch; }
.hero-figure {
  margin: 0; background: #fff; padding: 10px 10px 36px; border: 1px solid var(--line);
  border-radius: 4px; box-shadow: var(--shadow); transform: rotate(1.2deg); position: relative;
}
.hero-figure img { display: block; width: 100%; border-radius: 2px; }
.hero-figure figcaption {
  position: absolute; bottom: 9px; left: 14px; right: 14px; font-family: var(--font-title);
  font-style: italic; font-size: .9rem; color: var(--muted);
}
.hero-stamp {
  position: absolute; top: -18px; right: -10px; background: var(--blue); color: #fff;
  font-family: var(--font-title); font-weight: 600; padding: 8px 14px; border-radius: 6px;
  transform: rotate(-5deg); font-size: .92rem; box-shadow: var(--shadow-sm);
}
@media (min-width: 900px) {
  .hero { padding: var(--sp-9) 0 var(--sp-8); }
  .hero-grid { grid-template-columns: 1.1fr .9fr; gap: var(--sp-8); }
}

/* ---------- Sections ---------- */
.section { padding: var(--sp-8) 0; }
.section-tight { padding: var(--sp-7) 0; }
.section-alt { background: var(--paper-2); border-block: 1px dashed var(--line-strong); }
.section-blue { background: var(--blue-900); color: #F4EFE4; }
.section-blue h2, .section-blue h3 { color: #fff; }
.section-head { max-width: 680px; margin-bottom: var(--sp-6); }
.section-head p { color: var(--muted); font-size: 1.06rem; }
.section-blue .section-head p { color: #D9D0BE; }

/* ---------- Fiches (cartes d’écriture) ---------- */
.fiches { display: grid; gap: var(--sp-5); }
@media (min-width: 640px) { .fiches { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .fiches { grid-template-columns: repeat(3, 1fr); } }

.fiche {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 6px 6px var(--radius-lg) var(--radius-lg);
  padding: var(--sp-6) var(--sp-5) var(--sp-5); display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.fiche:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--blue); }
.fiche-num {
  position: absolute; top: -1px; left: 20px; transform: translateY(-50%);
  background: var(--blue); color: #fff; font-size: .75rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; padding: 5px 12px; border-radius: 4px;
}
.fiche h3 { font-size: 1.45rem; margin-bottom: var(--sp-2); }
.fiche h3 a { color: var(--ink); text-decoration: none; }
.fiche h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.fiche p { color: var(--muted); font-size: .97rem; }
.fiche .mini-specs { margin-top: auto; padding-top: var(--sp-3); }

.mini-specs { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.mini-specs li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dotted var(--line-strong); }
.mini-specs li span:first-child { color: var(--muted); }
.mini-specs li span:last-child { font-weight: 600; color: var(--ink); text-align: right; }

.stars { letter-spacing: 3px; font-size: .7rem; color: var(--line); }
.stars .on { color: var(--blue); }

/* ---------- Étapes « comment lire une fiche » ---------- */
.steps { display: grid; gap: var(--sp-4); counter-reset: step; list-style: none; padding: 0; }
@media (min-width: 700px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li {
  counter-increment: step; position: relative; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--sp-5) var(--sp-5) var(--sp-5) 68px;
}
.steps li::before {
  content: counter(step); position: absolute; left: 18px; top: 18px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--cyan-100); border: 1.5px solid var(--blue); color: var(--blue-700);
  font-family: var(--font-title); font-weight: 700; display: grid; place-items: center;
}
.steps strong { display: block; color: var(--ink); font-family: var(--font-title); font-size: 1.1rem; margin-bottom: 2px; }
.steps span { color: var(--muted); font-size: .95rem; display: block; line-height: 1.55; }

/* ---------- Split / Z-pattern ---------- */
.split { display: grid; gap: var(--sp-6); align-items: center; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: var(--sp-8); }
  .split.reverse > :first-child { order: 2; }
}
.photo { margin: 0; position: relative; }
.photo img { display: block; width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.photo::after {
  content: ""; position: absolute; inset: 14px -14px -14px 14px; border: 2px solid var(--cyan);
  border-radius: var(--radius-lg); z-index: -1;
}

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 640px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px dotted var(--line-strong); vertical-align: top; }
thead th { background: var(--cyan-100); color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--blue); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 600; color: var(--ink); }
td a { font-weight: 600; }

/* ---------- Widgets ---------- */
.widget {
  background: var(--cyan-50); border: 1px solid var(--cyan); border-radius: var(--radius-lg);
  padding: var(--sp-5); position: relative;
}
.widget-title { display: flex; align-items: center; gap: 10px; font-family: var(--font-title); font-size: 1.15rem; font-weight: 600; color: var(--ink); margin-bottom: var(--sp-4); }
.widget-title .icon { color: var(--blue); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-4); }
.field label, .label { font-size: .85rem; font-weight: 600; color: var(--ink); }
.field input[type="number"], .field select {
  font: inherit; padding: 11px 14px; border: 1.5px solid var(--line-strong); border-radius: 8px;
  background: #fff; color: var(--ink); width: 100%; max-width: 220px;
}
.field input[type="number"]:focus, .field select:focus { border-color: var(--blue); outline: 3px solid rgba(168, 50, 30, .18); }
.field input[type="range"] { width: 100%; accent-color: var(--blue); }
.field-row { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: flex-end; }
.hint { font-size: .85rem; color: var(--muted); }

.results { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, 1fr); margin: 0; }
@media (min-width: 640px) { .results { grid-template-columns: repeat(4, 1fr); } }
.result { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.result dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.result dd { margin: 2px 0 0; font-family: var(--font-title); font-size: 1.5rem; font-weight: 700; color: var(--blue-700); line-height: 1.2; }
.result dd small { font-size: .8rem; font-weight: 500; color: var(--muted); font-family: var(--font-body); }

.angle-sim svg { background: #fff; border: 1px solid var(--line); border-radius: 12px; width: 100%; }
.angle-legend { list-style: none; padding: 0; margin: var(--sp-3) 0 0; display: grid; gap: 6px; font-size: .92rem; }
@media (min-width: 640px) { .angle-legend { grid-template-columns: repeat(2, 1fr); } }
.angle-legend li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.angle-legend b { color: var(--blue-700); }

.kit-grid { display: grid; gap: var(--sp-2); margin: 0 0 var(--sp-4); }
@media (min-width: 560px) { .kit-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .kit-grid { grid-template-columns: repeat(3, 1fr); } }
.check {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff;
  border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500;
  transition: border-color .2s, background .2s;
}
.check:has(input:checked) { border-color: var(--blue); background: var(--cyan-100); }
.check input { accent-color: var(--blue); width: 18px; height: 18px; }
.kit-out { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: var(--sp-4) var(--sp-5); }
.kit-out ul { margin: 0; }
.kit-out li { margin-bottom: 6px; }
.kit-count { font-family: var(--font-title); font-weight: 700; color: var(--blue-700); }

/* ---------- Page écriture ---------- */
.breadcrumb { font-size: .86rem; color: var(--muted); margin-bottom: var(--sp-4); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }
.breadcrumb a { color: var(--muted); }

.ec-hero { padding: var(--sp-7) 0 var(--sp-6); }
.ec-hero-grid { display: grid; gap: var(--sp-6); }
@media (min-width: 900px) { .ec-hero-grid { grid-template-columns: 1.2fr .8fr; gap: var(--sp-8); align-items: start; } }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: var(--sp-4) 0 0; padding: 0; list-style: none; }
.badge-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line-strong); font-size: .86rem; font-weight: 500; color: var(--ink);
}
.badge-pill b { color: var(--blue-700); }

.specs-card {
  background: #fff; border: 1px solid var(--line); border-radius: 6px 6px var(--radius-lg) var(--radius-lg);
  padding: var(--sp-5); box-shadow: var(--shadow-sm); position: relative;
}
.specs-card::before {
  content: "Fiche technique"; position: absolute; top: -1px; left: 20px; transform: translateY(-50%);
  background: var(--ink); color: #fff; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 4px; font-weight: 600;
}
.specs { margin: var(--sp-3) 0 0; }
.specs div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dotted var(--line-strong); }
.specs div:last-child { border-bottom: 0; }
.specs dt { color: var(--muted); font-size: .9rem; }
.specs dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; font-size: .95rem; }

.page-grid { display: grid; gap: var(--sp-6); padding-bottom: var(--sp-8); }
@media (min-width: 1000px) { .page-grid { grid-template-columns: 240px 1fr; gap: var(--sp-8); } }
.toc { display: none; }
@media (min-width: 1000px) {
  .toc { display: block; position: sticky; top: 92px; align-self: start; font-size: .92rem; }
  .toc h2 { font-family: var(--font-body); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--sp-3); }
  .toc ol { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
  .toc a { display: block; padding: 7px 0 7px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--text); text-decoration: none; }
  .toc a:hover, .toc a.active { border-left-color: var(--blue); color: var(--blue-700); }
}
.article section { margin-bottom: var(--sp-8); scroll-margin-top: 90px; }
.article section > h2 { display: flex; align-items: baseline; gap: 14px; }
.sec-num { font-family: var(--font-title); font-weight: 700; color: var(--blue); font-size: .8em; flex: none; }
.lead { font-size: 1.13rem; color: var(--text); }

.callout {
  background: var(--cyan-50); border-left: 4px solid var(--blue); border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--sp-4) var(--sp-5); margin: var(--sp-5) 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout-title { font-family: var(--font-title); font-weight: 600; color: var(--ink); margin-bottom: 4px; display: block; }

.exemplaire {
  display: grid; gap: var(--sp-5); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden;
}
@media (min-width: 760px) { .exemplaire { grid-template-columns: 260px 1fr; } }
.exemplaire-img { min-height: 200px; background-size: cover; background-position: center; }
.exemplaire-body { padding: var(--sp-5); }
.exemplaire .specs { margin-bottom: var(--sp-4); }

.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 32px; margin-bottom: 10px; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 5px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--cyan-100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A8321E' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E") center/12px no-repeat;
  border: 1px solid var(--blue);
}

/* Schémas de traits */
.letters { display: grid; gap: var(--sp-5); }
@media (min-width: 700px) { .letters { grid-template-columns: repeat(3, 1fr); } }
.letter-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-4); }
.letter-card h3 { font-size: 1.05rem; margin: var(--sp-3) 0 var(--sp-2); }
.letter-card ol { margin: 0; padding-left: 1.3rem; font-size: .93rem; color: var(--text); }
.letter-card li { margin-bottom: 6px; line-height: 1.5; }
.letter-card li::marker { color: var(--blue); font-weight: 700; }
.trait-svg { display: block; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.trait-svg .g-lines line { stroke: var(--line-strong); stroke-width: .6; }
.trait-svg .g-lines .base { stroke: var(--blue); stroke-width: .9; }
.trait-svg .band { fill: none; stroke: #E2BFB5; stroke-opacity: .7; stroke-width: 6; stroke-linecap: butt; stroke-linejoin: round; }
.trait-svg .duct { fill: none; stroke: #0F0E0C; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.trait-svg .badge circle { fill: #fff; stroke: #A8321E; stroke-width: 1.2; }
.trait-svg .badge text { font: 700 7px 'Source Sans 3', sans-serif; fill: #8E2918; }

/* Réglure CTA */
.cta-sheet {
  display: grid; gap: var(--sp-5); background: var(--ink); color: #EAE3D4; border-radius: var(--radius-lg);
  padding: var(--sp-6); align-items: center;
}
.cta-sheet h2, .cta-sheet h3 { color: #fff; margin-bottom: var(--sp-2); }
.cta-sheet p { margin: 0; }
@media (min-width: 800px) { .cta-sheet { grid-template-columns: 1fr auto; } }
.mini-sheet { width: 110px; background: #fff; border-radius: 3px; padding: 10px 8px; box-shadow: var(--shadow); transform: rotate(3deg); display: none; }
@media (min-width: 800px) { .mini-sheet { display: block; } }
.mini-sheet i { display: block; height: 1px; background: var(--line-strong); margin: 7px 0; }
.mini-sheet i:nth-child(3n) { background: var(--blue); }

/* Erreurs */
.errors { display: grid; gap: var(--sp-4); }
@media (min-width: 900px) { .errors { grid-template-columns: repeat(2, 1fr); } }
.error-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.error-head { display: flex; align-items: center; gap: 12px; padding: 14px var(--sp-5); background: var(--coral-100); color: var(--coral); border-bottom: 1px solid #F0CBC1; }
.error-head h3 { margin: 0; font-size: 1.08rem; color: #7E2A1A; }
.error-body { padding: var(--sp-4) var(--sp-5) var(--sp-5); display: grid; gap: 10px; }
.error-body p { margin: 0; font-size: .95rem; }
.error-body .tag { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 1px; }
.tag-symptome { color: var(--coral); }
.tag-cause { color: var(--muted); }
.tag-fix { color: var(--green); }
.fix { background: #EAF6F0; border-radius: 8px; padding: 10px 12px; }

/* Séance */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px dashed var(--line-strong); margin-left: 14px; }
.timeline li { position: relative; padding: 0 0 var(--sp-4) var(--sp-5); }
.timeline li::before { content: ""; position: absolute; left: -8px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--blue); border: 3px solid var(--paper); }
.timeline .min { display: inline-block; min-width: 58px; font-weight: 700; color: var(--blue-700); }

/* FAQ */
.faq { display: grid; gap: var(--sp-3); }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 var(--sp-5); }
.faq summary { cursor: pointer; padding: 16px 28px 16px 0; font-weight: 600; color: var(--ink); list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--blue); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details > div { padding: 0 0 var(--sp-4); color: var(--text); }
.faq details[open] { border-color: var(--blue); }

/* Prev / Next */
.prevnext { display: grid; gap: var(--sp-4); }
@media (min-width: 640px) { .prevnext { grid-template-columns: 1fr 1fr; } }
.pn { display: block; padding: var(--sp-5); border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; text-decoration: none; transition: border-color .2s, transform .2s; }
.pn:hover { border-color: var(--blue); transform: translateY(-2px); }
.pn small { display: block; color: var(--muted); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.pn strong { font-family: var(--font-title); font-size: 1.25rem; color: var(--ink); }
.pn.next { text-align: right; }

/* Matériel */
.items { display: grid; gap: var(--sp-3); margin-top: var(--sp-4); }
@media (min-width: 760px) { .items { grid-template-columns: repeat(2, 1fr); } }
.item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-4) var(--sp-5); }
.item h4 { margin-bottom: 2px; }
.item .for { font-size: .8rem; font-weight: 600; color: var(--blue-700); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; display: block; }
.item p { font-size: .94rem; margin: 0; color: var(--text); }
.item .buy { display: inline-block; margin-top: 10px; font-weight: 600; font-size: .9rem; }
.rule-box {
  background: var(--ink); color: #EAE3D4; border-radius: var(--radius-lg); padding: var(--sp-6);
  position: relative; overflow: hidden;
}
.rule-box h2, .rule-box h3 { color: #fff; }
.rule-box .checklist li::before { background-color: rgba(226, 191, 181, .15); border-color: var(--cyan); }
.rule-box .checklist li { color: #F4EFE4; }

.cards-3 { display: grid; gap: var(--sp-4); }
@media (min-width: 760px) { .cards-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards-3 { grid-template-columns: repeat(4, 1fr); } }
.mat-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; color: var(--text); transition: transform .25s, box-shadow .25s, border-color .25s; }
.mat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--blue); color: var(--text); }
.mat-card img { display: block; width: 100%; height: 150px; object-fit: cover; }
.mat-card div { padding: var(--sp-4) var(--sp-5) var(--sp-5); }
.mat-card h3 { margin-bottom: 4px; font-size: 1.2rem; }
.mat-card p { font-size: .92rem; color: var(--muted); margin: 0; }

/* Glossaire */
.gloss { display: grid; gap: var(--sp-4); }
.gloss dt { font-family: var(--font-title); font-weight: 600; font-size: 1.2rem; color: var(--ink); scroll-margin-top: 90px; }
.gloss dd { margin: 4px 0 0; padding-bottom: var(--sp-4); border-bottom: 1px dotted var(--line-strong); }
.alpha { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 var(--sp-6); }
.alpha a { display: inline-block; padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line-strong); text-decoration: none; font-size: .9rem; }
.alpha a:hover { background: var(--cyan-100); border-color: var(--blue); }

/* Réglure : page imprimable */
.reglure-layout { display: grid; gap: var(--sp-6); padding: var(--sp-6) 0 var(--sp-8); }
@media (min-width: 1000px) { .reglure-layout { grid-template-columns: 340px 1fr; align-items: start; } .reglure-controls { position: sticky; top: 92px; } }
.sheet-wrap { background: #EAE3D4; padding: var(--sp-4); border-radius: var(--radius-lg); display: flex; justify-content: center; }
.sheet { width: 100%; max-width: 595px; background: #fff; box-shadow: var(--shadow); display: block; }
.sheet svg { display: block; width: 100%; height: auto; }

/* Pied de page */
.site-footer { background: var(--blue-900); color: #D9D0BE; padding: var(--sp-8) 0 var(--sp-5); margin-top: var(--sp-8); }
.footer-grid { display: grid; gap: var(--sp-6); }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.site-footer p { font-size: .94rem; max-width: 44ch; margin-top: var(--sp-3); }
.footer-title { font-family: var(--font-body); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); margin-bottom: var(--sp-3); font-weight: 600; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #F4EFE4; text-decoration: none; }
.site-footer a:hover { color: var(--cyan); text-decoration: underline; }
.footer-bottom { margin-top: var(--sp-7); padding-top: var(--sp-4); border-top: 1px solid rgba(226, 191, 181, .25); }
.footer-bottom p { font-size: .84rem; margin: 0; max-width: none; }

/* 404 */
.nf { text-align: center; padding: var(--sp-9) 0; }
.nf .big { font-family: var(--font-title); font-size: clamp(5rem, 18vw, 10rem); line-height: 1; color: var(--cyan); font-weight: 700; margin: 0; }

/* Révélations au scroll */
.reveal-on-scroll { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.reveal-on-scroll.revealed { opacity: 1; transform: none; }
@media (scripting: none) { .reveal-on-scroll { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal-on-scroll { opacity: 1; transform: none; transition: none; } .fiche, .btn, .pn, .mat-card { transition: none; } }

/* Impression : seule la feuille de réglure sort */
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .no-print, .site-header, .site-footer { display: none !important; }
  .reglure-layout { display: block; padding: 0; }
  .sheet-wrap { background: none; padding: 0; display: block; }
  .sheet { width: 210mm; max-width: none; height: 297mm; box-shadow: none; page-break-after: avoid; }
  .sheet svg { width: 210mm; height: 297mm; }
  main { display: block; }
}

/* ===== BLOC SOUS-MENU OUTILS — sans JavaScript (hover + focus-within) ===== */
.nav-item{position:relative;display:inline-flex;align-items:center}
.has-sub>a::after{content:"";display:inline-block;width:5px;height:5px;margin-left:7px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg) translateY(-2px)}
.has-sub::after{content:"";position:absolute;top:100%;left:0;right:0;height:18px}
.sub-nav{position:absolute;top:calc(100% + 18px);left:-16px;z-index:30;min-width:296px;flex-direction:column;gap:1px;padding:8px;background:var(--surface);border:1px solid var(--line);box-shadow:0 18px 34px rgba(31,58,77,.14);display:none}
.has-sub:hover>.sub-nav,.has-sub:focus-within>.sub-nav{display:flex}
.sub-nav a{display:block;padding:9px 12px;font-size:13px;font-weight:700;line-height:1.25;white-space:nowrap;border-left:2px solid transparent}
.sub-nav a small{display:block;margin-top:2px;font-family:var(--font-body);font-size:11px;font-weight:400;color:var(--text-muted)}
.sub-nav a:hover,.sub-nav a:focus{background:var(--fill);color:var(--primary);border-left-color:var(--primary)}
.sub-nav a:hover small,.sub-nav a:focus small{color:var(--text-secondary)}
.sub-nav-all{margin-top:5px;border-top:1px solid var(--line);padding-top:11px!important;color:var(--primary)}
@media(max-width:850px){
.nav-item{display:block}
.has-sub::after{display:none}
.has-sub>a::after{transform:rotate(45deg) translateY(-2px)}
.sub-nav{position:static;display:flex;min-width:0;margin:9px 0 4px 2px;padding:2px 0 2px 14px;border:0;border-left:2px solid var(--line);box-shadow:none;background:transparent;gap:0}
.sub-nav a{white-space:normal;padding:7px 0;font-size:13px;border-left:0}
.sub-nav a small{display:none}
.sub-nav a:hover,.sub-nav a:focus{background:transparent}
.sub-nav-all{padding-top:8px!important}
}

/* ===== ADAPTATION 05b ENCRE ATELIER — le sous-menu Outils réutilise la liste .sub du front ===== */
.main-nav li.nav-item{display:block}
.main-nav .sub a small{display:block;margin-top:2px;font-size:.78rem;font-weight:400;color:var(--muted)}
.main-nav .sub .sub-nav-all{border-top:1px solid var(--line);margin-top:4px;color:var(--blue)}

/* ===== BLOC LARGEUR UNIFIÉE — toutes les pages à la largeur de la home ===== */
/*
 * Posé par 06a2-largeur-contenu. Les sélecteurs ci-dessous ont été RELEVÉS
 * dans les feuilles réellement chargées par le front, pas devinés : c'est la
 * correction du défaut d'origine, où une liste de classes supposées rendait
 * le bloc inerte sans que rien ne le signale.
 *
 * Largeur de référence relevée sur `.container` : 1160 px.
 *
 * `!important` est délibéré. Une contrainte peut être déclarée dans une
 * feuille chargée APRÈS celle-ci, ou plus bas dans ce même fichier par un
 * bloc appendu ultérieurement : à spécificité égale elle gagnerait, et le
 * bloc serait posé, validé, et sans effet.
 *
 * Les contrôles de formulaire, les images et les cartes sont épargnés.
 *
 * Ce qui suit la borne « relevé automatique : fin » est CONSERVÉ au rejeu :
 * c'est là que vivent les règles tranchées à la main. N'écris rien au-dessus.
 */

/* --- relevé automatique : début --- */
.hero-lead{max-width:none!important}   /* styles.css : 56ch */
.section-head{max-width:none!important}   /* styles.css : 680px */
.sheet{max-width:none!important}   /* styles.css : 595px */
.site-footer p{max-width:none!important}   /* styles.css : 44ch */
.source-list{max-width:none!important}   /* styles.css : 820px */

/* Grilles à deux colonnes relevées, NON collapsées d'office : une grille de
   cartes se collapserait à tort. À trancher au brief 06a2, puis à écrire
   SOUS la borne de fin ci-dessous. */
/*   .hero-grid { grid-template-columns: 1.1fr .9fr }  (styles.css) */
/* --- relevé automatique : fin --- */

/* Règles tranchées à la main, conservées au rejeu de 06a2. */
/* Règles tranchées à la main, conservées au rejeu de 06a2. */
/* 06a2 encreatelier : .hero-grid = hero de la home (texte + figure), grille de blocs conservée telle quelle.
   .sheet = aperçu A4 des réglures (image de page) : borne d'écran rétablie, l'impression garde 210 mm. */
@media screen{.sheet{max-width:595px!important}}
.content-narrow{max-width:none!important}
.content-narrow select,.content-narrow input[type=number],.content-narrow input[type=text]{max-width:520px}
.article-layout{width:min(1140px,calc(100% - 40px));margin-inline:auto}
.article-body{max-width:72ch}
.article-layout{width:min(100% - 28px,1140px)}

/* ===== ENVELOPPE + OUVERTURE NORMÉE (couches 1 et 2 du gabarit) ===== */
.author-card{display:flex;gap:18px;align-items:flex-start;margin:0 0 22px;padding:20px 22px;background:var(--fill);border-left:3px solid var(--primary)}
.author-card .author-avatar{flex:0 0 auto;line-height:0}
.author-card .author-img{object-fit:cover}
.author-footer .author-card .author-img{width:88px;height:88px;object-fit:cover;border-radius:var(--radius-round, 50%)}
.author-footer .author-card .author-monogram{width:88px;height:88px;font-size:30px}
.author-name{margin:0;font-family:var(--font-heading);font-size:16px;font-weight:700;line-height:1.3}
.author-name a{color:var(--text-strong)}
.author-name a:hover{color:var(--primary)}
.author-job{display:block;margin-top:3px;font-size:11px;font-weight:400;text-transform:uppercase;letter-spacing:1.1px;color:var(--text-muted)}
.author-legit{margin:11px 0 0;font-size:14.5px;line-height:1.5;font-weight:600;color:var(--text-strong)}
.author-bio{margin:7px 0 0;font-size:13.5px;line-height:1.55;color:var(--text-secondary)}
.author-links{margin:10px 0 0;font-size:13px}
.author-links a{color:var(--primary);font-weight:700;border-bottom:1px solid currentColor}
.page-dates{display:flex;flex-wrap:wrap;gap:6px 20px;margin:0 0 22px;font-size:12px;color:var(--text-muted)}
.page-dates time{font-family:var(--font-mono);font-variant-numeric:tabular-nums;color:var(--text-secondary)}
.method-note{margin:0 0 26px;padding:17px 19px;background:var(--callout-bg);border:1px solid var(--callout-border);border-left:3px solid var(--primary)}
.method-note-title{margin:0 0 6px;font-family:var(--font-heading);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:1.2px;color:var(--callout-text)}
.method-note p:last-child{margin:0;font-size:14px;line-height:1.6;color:var(--callout-text)}
.opening{margin:0 0 34px}
.opening .answer{margin:0;padding:22px 24px;background:var(--secondary);color:var(--white);font-family:var(--font-heading);font-size:clamp(17px,1.9vw,20px);line-height:1.45;letter-spacing:-.2px}
.essentials{margin:0;padding:20px 24px;background:var(--surface);border:1px solid var(--border);border-top:0}
.essentials-title{margin:0 0 10px;font-family:var(--font-heading);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:1.2px;color:var(--text-muted)}
.essentials ul{margin:0;padding:0;list-style:none}
.essentials li{position:relative;padding:7px 0 7px 22px;font-size:15px;line-height:1.5;color:var(--text)}
.essentials li::before{content:"";position:absolute;left:0;top:15px;width:8px;height:2px;background:var(--primary)}
.scope{margin:0;padding:14px 24px;background:var(--fill);border:1px solid var(--border);border-top:0;font-size:13.5px;line-height:1.55;color:var(--text-secondary)}
.scope span{font-family:var(--font-heading);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:1.1px;color:var(--text-muted);margin-right:6px}
.scope a{color:var(--secondary);font-weight:700;border-bottom:1px solid currentColor}
.scope a:hover{color:var(--primary)}
.update-log{margin:0;padding:20px 22px;border-top:2px solid var(--secondary);background:var(--fill)}
.update-log-title{margin:0 0 9px;font-family:var(--font-heading);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:1.2px;color:var(--text-muted)}
.update-log ul{margin:0;padding:0;list-style:none}
.update-log li{padding:6px 0;font-size:13.5px;line-height:1.5;color:var(--text-secondary);border-bottom:1px solid var(--border)}
.update-log li:last-child{border-bottom:0}
.update-log time{font-family:var(--font-mono);font-variant-numeric:tabular-nums;font-weight:500;color:var(--text-strong)}
@media(max-width:640px){.author-card{padding:16px}.opening .answer{padding:18px}.essentials,.scope{padding:16px 18px}}

/* Signature de tête — identité et dates sur une seule ligne. Le parcours de
   l'auteur n'est pas ici : il se lit en pied, via .author-footer. */
.author-byline{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 18px;margin:0 0 26px;padding-bottom:14px;border-bottom:1px solid var(--border,#D3CEC1);font-size:13px;color:var(--text-secondary,#4A554D)}
.byline-author a{color:var(--secondary,#3A4A3F);font-weight:700;border-bottom:1px solid currentColor}
.byline-author a:hover{color:var(--primary,#A65E2E)}
.author-byline .page-dates{margin:0;gap:6px 18px}

/* Pied d'article — la carte auteur complète, détachée du corps du texte. */
.author-footer{margin:38px 0 22px;border-top:2px solid var(--secondary,#3A4A3F)}
.author-footer .author-card{margin:0}

/* Signature dans le hero d'article (blog) : le hero est un aplat sombre, la
   signature doit y passer en blanc. Sans cette règle, elle hérite des couleurs
   pensées pour un fond clair et devient illisible (contraste ~1,1:1). */
.guide-hero .author-byline,
.guide-hero .author-byline .page-dates,
.guide-hero .byline-author a,
.guide-hero .page-dates time{color:#FFFFFF}
.guide-hero .author-byline{border-bottom-color:rgba(255,255,255,.28)}

/* ===== SOURCES — liens sortants cités près de l'affirmation ===== */
.source-note a[rel~="nofollow"]{color:var(--secondary);font-weight:600;border-bottom:1px solid var(--text-faint)}
.source-note a[rel~="nofollow"]:hover{color:var(--primary);border-bottom-color:var(--primary)}
.tool-table a[rel~="nofollow"]{font-weight:600;text-decoration:none;border-bottom:1px solid var(--text-faint)}
.tool-table a[rel~="nofollow"]:hover{color:var(--primary);border-bottom-color:var(--primary)}
.source-list{list-style:none;margin:0;padding:0;max-width:820px}
.source-list li{padding:10px 0;border-bottom:1px solid var(--line);font-size:14px}
.source-list li:last-child{border-bottom:0}
.source-list span{display:block;margin-top:2px;font-size:11px;color:var(--text-muted)}
