/* DeepWall — pages détail (document scrollable). S'appuie sur styles.css. */

html { scroll-behavior: smooth; }

/* override du deck : on rend le body scrollable */
body.detail { overflow-y: auto; overflow-x: hidden; height: auto; min-height: 100%; }

/* ---------- header sticky ---------- */
.dtl-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px var(--pad);
  background: rgba(14, 14, 16, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.dtl-header .logo { position: static; }
.dtl-back {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em;
  color: var(--ink-2); text-decoration: none;
  border: 1px solid var(--line); border-radius: 6px; padding: 9px 16px;
  transition: color .2s, border-color .2s, background .2s;
}
.dtl-back:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }

/* ---------- layout sommaire + contenu ---------- */
.dtl-wrap {
  display: grid; grid-template-columns: 260px 1fr;
  gap: clamp(24px, 4vw, 72px);
  max-width: var(--maxw); margin: 0 auto;
  padding: 0 var(--pad) 140px;
}
.dtl-toc {
  position: sticky; top: 92px; align-self: start;
  display: grid; gap: 2px; padding-top: clamp(28px, 4vh, 48px);
}
.dtl-toc .toc-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; padding-left: 13px;
}
.dtl-toc a {
  font-family: var(--mono); font-size: 13px; color: var(--ink-3);
  text-decoration: none; padding: 8px 13px;
  border-left: 2px solid transparent; border-radius: 0 6px 6px 0;
  transition: color .18s, background .18s, border-color .18s;
}
.dtl-toc a:hover { color: var(--ink); background: var(--bg-2); }
.dtl-toc a.active { color: var(--accent); border-left-color: var(--accent); background: var(--bg-2); }

.dtl-main { padding-top: clamp(28px, 4vh, 48px); min-width: 0; }

/* ---------- sections ---------- */
.dtl-section {
  padding: clamp(36px, 5vh, 72px) 0;
  border-bottom: 1px solid var(--line-soft);
  scroll-margin-top: 88px;
}
.dtl-section:first-child { padding-top: 8px; }
.dtl-section:last-child { border-bottom: 0; }
.dtl-section h2 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(26px, 3vw, 40px); letter-spacing: -0.02em; line-height: 1.08;
  margin: 12px 0 0;
}
.dtl-section .lede {
  margin-top: 14px; font-size: clamp(15px, 1.3vw, 19px);
  color: var(--ink-2); line-height: 1.5; max-width: 70ch;
}
.dtl-section h3 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(16px, 1.4vw, 21px); margin: clamp(28px, 3vw, 44px) 0 14px;
}
.dtl-section p { color: var(--ink-2); font-size: clamp(13px, 1.05vw, 16px); line-height: 1.55; margin-top: 10px; max-width: 72ch; }
.dtl-section p b { color: var(--ink); font-weight: 600; }
.dtl-note { font-family: var(--mono); font-size: clamp(11px, 0.9vw, 13px); color: var(--ink-3); margin-top: 14px; }
.dtl-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.dlink-inline { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(255, 196, 0, 0.35); }
.dlink-inline:hover { border-bottom-color: var(--accent); }

/* léger ajustement des composants réutilisés en contexte document */
.dtl-section .cols { margin-top: clamp(16px, 2vw, 28px); }
.dtl-section .org, .dtl-section .wbs, .dtl-section .tree, .dtl-section .arch { margin-top: clamp(20px, 2.4vw, 36px); }

/* ---------- onboarding : étapes & checklist ---------- */
.dtl-days { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(12px, 1.4vw, 20px); margin-top: clamp(18px, 2vw, 28px); }
.dtl-day { border-left: 2px solid var(--accent); padding-left: 14px; }
.dtl-day .when { font-family: var(--mono); color: var(--accent); font-size: 12px; }
.dtl-day h4 { font-family: var(--display); font-weight: 600; font-size: clamp(13px, 1.05vw, 16px); margin: 7px 0 6px; }
.dtl-day p { color: var(--ink-3); font-size: clamp(11px, 0.9vw, 13px); line-height: 1.4; margin: 0; }
.checklist { list-style: none; display: grid; gap: 10px; margin-top: 14px; }
.checklist li { position: relative; padding-left: 28px; color: var(--ink-2); font-size: clamp(13px, 1.05vw, 16px); line-height: 1.4; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 1px;
  width: 16px; height: 16px; border: 1.5px solid var(--accent); border-radius: 4px;
}

/* ---------- tables génériques (AMDEC, critères) ---------- */
.dtbl { width: 100%; border-collapse: collapse; margin-top: clamp(16px, 2vw, 24px); font-size: clamp(12px, 1vw, 15px); }
.dtbl th, .dtbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.dtbl th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.dtbl td { color: var(--ink-2); }
.dtbl td b { color: var(--ink); font-weight: 600; }
.dtbl tbody tr:nth-child(odd) { background: rgba(255, 255, 255, 0.018); }
.dtbl .num { text-align: center; font-family: var(--mono); }
.dtbl .ipr { text-align: center; font-family: var(--mono); font-weight: 700; }
.dtbl .ipr.hi { color: var(--risk-high); }
.dtbl .ipr.mid { color: var(--risk-mid); }
.dtbl .ipr.lo { color: var(--risk-low); }

/* ---------- zones de criticité (risk map) ---------- */
.zones { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 1.6vw, 24px); margin-top: clamp(18px, 2vw, 28px); }
.zone { border: 1px solid var(--line); border-radius: 12px; padding: clamp(16px, 1.6vw, 24px); background: var(--bg-2); }
.zone.r { border-top: 3px solid var(--risk-high); }
.zone.o { border-top: 3px solid var(--risk-mid); }
.zone.g { border-top: 3px solid var(--risk-low); }
.zone .zh { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .dtl-wrap { grid-template-columns: 1fr; }
  .dtl-toc { position: static; padding-top: 12px; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .dtl-toc .toc-label { display: none; }
  .dtl-days, .zones { grid-template-columns: 1fr; }
}
