/* ============================================================
   GUIDE D'UTILISATION — habillage éditorial (joy palette).
   Scopé sous .guide-page. Règle d'or : zéro hex — tout via var(--*).
   Chaque section porte une teinte joy stable (--gh-ink / --gh-tint,
   injectées inline par guide.js) ; repli sur --accent.
   ============================================================ */

.guide-page { position: relative; }
.guide-page .section-header { margin-bottom: var(--space-5); }
.guide-page .section-header .ed-eyebrow { margin-bottom: 6px; }

.guide-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: var(--space-6);
  align-items: start;
}

/* ---- Sommaire (sticky) ---- */
.guide-toc {
  position: sticky;
  top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-4) var(--space-3);
  background: var(--card-bg, var(--surface));
  border: var(--card-border, 1px solid var(--line));
  box-shadow: var(--card-shadow, none);
  border-radius: 10px;
}
.guide-toc-title {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 10px;
  padding: 0 var(--space-2);
}
.guide-toc-link {
  --gh-ink: var(--accent);
  --gh-tint: var(--accent-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px var(--space-2);
  border-radius: 8px;
  color: var(--ink-soft);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.3;
  position: relative;
  transition: background .15s ease, color .15s ease, transform .12s ease;
}
.guide-toc-link::before {
  content: "";
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 2px; height: 0; border-radius: 2px;
  background: var(--gh-ink);
  transition: height .15s ease;
}
.guide-toc-link:hover {
  background: color-mix(in srgb, var(--gh-tint) 50%, transparent);
  color: var(--ink);
  transform: translateX(2px);
}
.guide-toc-link:hover::before { height: 18px; }
.guide-toc-icon { flex-shrink: 0; font-size: 15px; }

/* ---- Actions (tout déplier / replier) ---- */
.guide-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

/* ---- Sections (accordéon éditorial) ---- */
.guide-section {
  --gh-ink: var(--accent);
  --gh-tint: var(--accent-soft);
  background: var(--card-bg, var(--surface));
  border: var(--card-border, 1px solid var(--line));
  box-shadow: var(--card-shadow, none);
  border-radius: 10px;
  padding: 0;
  margin-bottom: var(--space-3);
  overflow: hidden;
  transition: border-color .18s ease;
}
.guide-section[open] {
  border-color: color-mix(in srgb, var(--gh-ink) 38%, var(--line));
}
.guide-summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 18px var(--space-5);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.guide-summary::-webkit-details-marker { display: none; }
.guide-summary-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--gh-tint);
  border: 1px solid color-mix(in srgb, var(--gh-ink) 30%, transparent);
  border-radius: 50%;
}
.guide-summary-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.guide-summary-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.guide-summary-lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13.5px;
  color: var(--muted);
}
.guide-summary-chevron {
  flex-shrink: 0;
  font-size: 20px;
  color: var(--muted);
  transition: transform .2s ease;
}
.guide-section[open] .guide-summary-chevron { transform: rotate(180deg); color: var(--gh-ink); }
/* Filet or sous l'en-tête quand la section est ouverte. */
.guide-section[open] .guide-summary {
  position: relative;
  border-bottom: 1px solid var(--line-soft);
}
.guide-section[open] .guide-summary::after {
  content: "";
  position: absolute;
  left: var(--space-5); bottom: -1px;
  width: 44px; height: 1px;
  background: var(--accent);
}

/* ---- Corps de section ---- */
.guide-section-body {
  padding: var(--space-5);
  color: var(--ink-soft);
  font-family: var(--sans);
  line-height: 1.65;
  font-size: 14px;
}
.guide-section-body p { margin: 0 0 var(--space-3); }
.guide-section-body strong { color: var(--ink); font-weight: 600; }
.guide-section-body em { color: var(--muted); }
.guide-section-body ul,
.guide-section-body ol { margin: 0 0 var(--space-3) var(--space-4); padding: 0; }
.guide-section-body li { margin-bottom: 7px; }
.guide-section-body code {
  font-family: var(--mono);
  background: color-mix(in srgb, var(--gh-tint) 55%, var(--surface));
  color: var(--ink);
  padding: 1px 7px;
  border-radius: 6px;
  font-size: .88em;
}

/* Étapes numérotées — pastille teinte de la section. */
.guide-steps { counter-reset: gstep; list-style: none; margin-left: 0 !important; }
.guide-steps > li {
  position: relative;
  padding-left: 40px;
  margin-bottom: var(--space-3);
}
.guide-steps > li::before {
  counter-increment: gstep;
  content: counter(gstep);
  position: absolute;
  left: 0; top: -2px;
  width: 27px; height: 27px;
  display: grid; place-items: center;
  background: var(--gh-ink);
  color: #fff;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 14px; font-weight: 500;
}

/* Encart « ordre recommandé » — sauge. */
.guide-callout {
  background: color-mix(in srgb, var(--joy-sage-tint) 60%, var(--surface));
  border-left: 3px solid var(--joy-sage-ink);
  border-radius: 8px;
  padding: var(--space-3) var(--space-4);
  margin: 0 0 var(--space-3);
}
.guide-callout strong { color: var(--joy-sage-ink); }
.guide-callout ol { margin-bottom: 0; }

/* Astuces — apricot/or. */
.guide-tip {
  background: color-mix(in srgb, var(--joy-apricot-tint) 55%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--joy-apricot-ink) 33%, transparent);
  border-radius: 8px;
  padding: 11px var(--space-3);
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---- Flash quand on saute depuis le sommaire ---- */
.guide-flash { animation: guideFlash 1.1s ease; }
@keyframes guideFlash {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  30% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gh-ink) 38%, transparent); }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .guide-layout { grid-template-columns: 1fr; }
  .guide-toc { position: static; order: -1; }
}

/* ---- Impression ---- */
@media print {
  .guide-toc, .guide-actions, .sidebar, #mobile-header,
  .section-header .btn, .guide-summary-chevron { display: none !important; }
  .guide-layout { grid-template-columns: 1fr; }
  .guide-section, .guide-section[open] { break-inside: avoid; box-shadow: none; }
  .guide-section .guide-section-body { display: block !important; }
  .guide-section:not([open]) .guide-section-body { display: block !important; }
}
