/* ==========================================================================
   CrossPlanner — Guide organisateur
   Style dérivé des templates marketing (marketing/social/feature-updates)
   adapté au format documentation.
   Palette : vert brand #16302b · mint #1ccfac · orange #f2a428 (annotations)
   ========================================================================== */

:root {
  --bg: #0b100e;
  --panel: #101714;
  --panel-2: #131c18;
  --line: #1e2a25;
  --line-soft: #17211d;
  --ink: #e9efec;
  --muted: #8fa39b;
  --faint: #5c6f68;
  --mint: #1ccfac;
  --mint-dim: #14907a;
  --orange: #f2a428;
  --green: #16302b;
  --status-draft: #8fa39b;
  --status-published: #1ccfac;
  --status-cancelled: #e26d5c;
  --content-w: 860px;
  --sidebar-w: 264px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(28, 207, 172, 0.25);
}

a {
  color: var(--mint);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.85em;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--mint);
}

/* --- Top bar ------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar .brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--mint);
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar .brand .divider {
  color: var(--faint);
  margin: 0 6px;
  font-weight: 400;
}
.topbar .brand .section {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 2px;
}

.topbar .pageno {
  margin-left: auto;
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

/* --- Layout ------------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 28px;
  gap: clamp(28px, 5vw, 72px);
}

/* --- Sidebar / sommaire --------------------------------------------------- */

.toc {
  position: sticky;
  top: 76px;
  align-self: start;
  padding: 32px 0 48px;
  font-size: 13px;
  max-height: calc(100vh - 76px);
  overflow-y: auto;
}

.toc .toc-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 14px;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}

.toc li a,
.toc li span {
  display: block;
  padding: 6px 14px;
  color: var(--muted);
  border-left: 2px solid transparent;
  margin-left: -1px;
  line-height: 1.45;
}

.toc li a:hover {
  color: var(--ink);
  text-decoration: none;
}

.toc li.current a {
  color: var(--mint);
  border-left-color: var(--mint);
  font-weight: 600;
}

.toc li.todo span {
  color: var(--faint);
  cursor: default;
}
.toc li.todo span::after {
  content: 'bientôt';
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 8px;
  vertical-align: 1px;
}

.toc .toc-group {
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--faint);
  padding: 18px 14px 6px;
}

/* --- Article ------------------------------------------------------------ */

article {
  max-width: var(--content-w);
  padding: clamp(36px, 6vh, 64px) 0 40px;
}

.kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--mint);
  margin: 0 0 14px;
}

h1 {
  font-size: clamp(30px, 4.5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin: 0 0 18px;
}

.lede {
  font-size: 17px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 620px;
  margin: 0 0 8px;
}

h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--mint);
  margin: 64px 0 8px;
}

h2 + p {
  margin-top: 10px;
}

article > p {
  max-width: 640px;
}
article p {
  color: var(--ink);
}
article p strong {
  color: var(--ink);
}

.hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 56px 0 0;
}

/* --- Étapes numérotées ---------------------------------------------------- */

.steps {
  margin: 32px 0 0;
}

.step {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 0 22px;
  position: relative;
  padding-bottom: 44px;
}

.step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 27px;
  top: 44px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}

.step .num {
  width: 56px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--mint);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  letter-spacing: 1px;
}

.step h3 {
  margin: 6px 0 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.step .body {
  max-width: 640px;
}
.step .body > p {
  margin: 0 0 12px;
}
.step .body > p:last-child {
  margin-bottom: 0;
}

/* Le contenu large (figures) déborde de la colonne texte */
.step .wide {
  max-width: none;
}

/* --- Callouts ------------------------------------------------------------- */

.callout {
  margin: 20px 0;
  padding: 14px 18px 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  max-width: 640px;
}

.callout .tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 6px;
}

.callout p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.callout p strong {
  color: var(--ink);
}

.callout--tip .tag {
  background: rgba(28, 207, 172, 0.12);
  color: var(--mint);
}
.callout--warn {
  border-color: rgba(242, 164, 40, 0.35);
}
.callout--warn .tag {
  background: rgba(242, 164, 40, 0.12);
  color: var(--orange);
}

/* --- Figures & annotations ------------------------------------------------ */

figure.shot {
  margin: 26px 0 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

figure.shot .frame {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: zoom-in;
}

figure.shot img {
  display: block;
  width: 100%;
  height: auto;
}

figure.shot .overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

figure.shot figcaption {
  padding: 12px 6px 2px;
  font-size: 12.5px;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

figure.shot figcaption .hint {
  color: var(--faint);
  white-space: nowrap;
}

/* Légende numérotée sous une figure annotée */
.legend {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px 28px;
}

.legend li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
  align-items: baseline;
}

.legend li strong {
  color: var(--ink);
  font-weight: 600;
}

.legend .n {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--orange);
  color: #16302b;
  font-size: 12px;
  font-weight: 800;
  transform: translateY(4px);
}

/* Zoom : crop agrandi d'une zone de capture */
.zoom {
  display: inline-block;
  max-width: 100%;
  margin: 22px 0 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
}

.zoom .crop {
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--line);
}

.zoom .zoom-caption {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 12px;
  color: var(--faint);
}

.zoom .zoom-caption .badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--orange);
  border: 1px solid rgba(242, 164, 40, 0.4);
  border-radius: 4px;
  padding: 1px 6px;
}

/* Figure à venir (capture pas encore produite) */
.shot-todo {
  margin: 22px 0;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 26px 22px;
  color: var(--faint);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 640px;
}

.shot-todo .cam {
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
}

/* --- Statuts -------------------------------------------------------------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 999px;
  padding: 3px 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  vertical-align: 1px;
}

.status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status--draft {
  color: var(--status-draft);
}
.status--published {
  color: var(--status-published);
}
.status--cancelled {
  color: var(--status-cancelled);
}

/* --- Tableaux ------------------------------------------------------------- */

table.fields {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

table.fields th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 14px 10px;
  border-bottom: 1px solid var(--line);
}

table.fields td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  vertical-align: top;
}

table.fields td:first-child {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

/* --- Parcours (ordre des étapes) ------------------------------------------ */

.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 22px 0;
  padding: 0;
  list-style: none;
}

.flow li {
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

.flow li small {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--faint);
  letter-spacing: 0.3px;
}

.flow li.milestone {
  border-color: rgba(28, 207, 172, 0.45);
  color: var(--mint);
  background: rgba(28, 207, 172, 0.06);
}

.flow .arrow {
  color: var(--faint);
  font-size: 14px;
  padding: 0 2px;
}

/* --- Navigation bas de page ------------------------------------------------ */

.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.pager a,
.pager .pager-box {
  display: block;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 200px;
  color: var(--ink);
}

.pager a:hover {
  text-decoration: none;
  border-color: var(--mint-dim);
}

.pager .dir {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
}

.pager .next {
  text-align: right;
  margin-left: auto;
}
.pager .title {
  font-weight: 600;
  font-size: 14px;
}

.pager .disabled {
  opacity: 0.45;
  pointer-events: none;
}

footer.docfoot {
  max-width: var(--content-w);
  padding: 26px 0 56px;
  font-size: 12px;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

/* --- Lightbox ------------------------------------------------------------- */

dialog.lightbox {
  border: none;
  background: transparent;
  padding: 0;
  max-width: min(96vw, 1400px);
  outline: none;
}

dialog.lightbox::backdrop {
  background: rgba(4, 8, 6, 0.88);
}

dialog.lightbox img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  cursor: zoom-out;
}

/* --- Responsive ------------------------------------------------------------ */

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .toc {
    position: static;
    max-height: none;
    padding: 24px 0 0;
  }
  .toc ol {
    display: none;
  }
  .toc .toc-title {
    display: none;
  }
  .step {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 0 14px;
  }
  .step .num {
    width: 40px;
    height: 32px;
    font-size: 13px;
  }
  .step:not(:last-child)::before {
    left: 19px;
  }
  .pager {
    flex-direction: column;
  }
  .pager .next {
    margin-left: 0;
  }
}

.topbar .app-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--mint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  white-space: nowrap;
}

.topbar .app-link:hover {
  border-color: var(--mint-dim);
  text-decoration: none;
}

@media (max-width: 900px) {
  .topbar { gap: 10px; padding: 12px 16px; }
  .topbar .pageno { display: none; }
  .topbar .app-link { margin-left: auto; }
  .topbar .brand .section,
  .topbar .brand .divider { display: none; }
}
