/* ============================================================
   ImmoMVP — Dokumentation (/docs)
   Baut auf /legal.css auf (Tokens, Nav, Footer). Landing-Look: Bühne #000,
   Karten #1C1C1E, Hairlines, systemBlue nur als Akzent.
   ============================================================ */

:root {
  --green: #30D158;
  --dc-sidebar: 288px;
  --dc-toc: 210px;
  --dc-nav-h: 56px;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--dc-nav-h) + 24px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ── Layout ── */
.dc-shell {
  max-width: 1320px; margin: 0 auto; padding: calc(var(--dc-nav-h) + 28px) 24px 0;
  display: grid; grid-template-columns: var(--dc-sidebar) minmax(0, 1fr) var(--dc-toc); gap: 40px;
  align-items: start;
}
.dc-shell.dc-no-toc { grid-template-columns: var(--dc-sidebar) minmax(0, 1fr); }

/* ── Sidebar ── */
.dc-sidebar {
  position: sticky; top: calc(var(--dc-nav-h) + 20px);
  max-height: calc(100vh - var(--dc-nav-h) - 40px); overflow-y: auto;
  padding: 0 4px 24px 0; scrollbar-width: thin; scrollbar-color: var(--surface-2) transparent;
}
.dc-search { position: relative; margin-bottom: 18px; }
.dc-search input {
  width: 100%; height: 40px; padding: 0 12px 0 38px; border-radius: 12px;
  background: var(--surface-1); border: 1px solid var(--surface-hair); color: var(--label);
  font: 400 14px var(--font-sans); letter-spacing: -.005em; outline: none;
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.dc-search input::placeholder { color: var(--label-3); }
.dc-search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.dc-search svg { position: absolute; left: 12px; top: 11px; width: 18px; height: 18px; stroke: var(--label-3); fill: none; stroke-width: 2; stroke-linecap: round; }
.dc-results { display: none; position: absolute; left: 0; right: 0; top: 46px; z-index: 20; background: var(--surface-1); border: 1px solid var(--surface-hair-2); border-radius: 12px; overflow: hidden; box-shadow: 0 12px 32px rgba(0,0,0,.55); }
.dc-results.open { display: block; }
.dc-results a { display: block; padding: 10px 14px; border-top: 1px solid var(--surface-hair); }
.dc-results a:first-child { border-top: none; }
.dc-results a:hover, .dc-results a:focus { background: var(--surface-2); outline: none; }
.dc-results b { display: block; font: 600 14px var(--font-sans); color: var(--label); letter-spacing: -.005em; }
.dc-results small { font: 400 12px var(--font-sans); color: var(--label-3); }
.dc-results .dc-empty { padding: 12px 14px; font: 400 13px var(--font-sans); color: var(--label-3); }

.dc-navlabel { font: 600 11px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--label-3); margin: 18px 0 8px 10px; }
.dc-chapter { margin: 2px 0; }
.dc-chapter > a, .dc-chapter > span {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px;
  font: 500 14px var(--font-sans); letter-spacing: -.005em; color: var(--label-2);
  transition: background .2s var(--ease-out), color .2s var(--ease-out);
}
.dc-chapter > a:hover { background: var(--surface-1); color: var(--label); }
.dc-chapter.current > a { color: var(--label); background: var(--surface-1); font-weight: 600; }
.dc-chapter > span { color: var(--label-3); cursor: default; }
.dc-chapter .dc-num { font: 500 12px var(--font-sans); color: var(--label-3); width: 20px; flex-shrink: 0; }
.dc-chapter .dc-tag { margin-left: auto; font: 600 10px var(--font-sans); letter-spacing: .04em; text-transform: uppercase; color: var(--label-3); border: 1px solid var(--surface-hair-2); border-radius: 6px; padding: 1px 6px; }
.dc-sub { margin: 2px 0 8px 30px; border-left: 1px solid var(--surface-hair); }
.dc-sub a { display: block; padding: 5px 12px; font: 400 13px var(--font-sans); color: var(--label-3); transition: color .2s; }
.dc-sub a:hover { color: var(--label); }
.dc-sub a.active { color: var(--blue); }

/* ── Inhalt ── */
.dc-main { min-width: 0; padding-bottom: 24px; }
.dc-crumbs { font: 400 13px var(--font-sans); color: var(--label-3); margin-bottom: 14px; }
.dc-crumbs a { color: var(--label-2); }
.dc-crumbs a:hover { color: var(--label); }
.dc-crumbs i { font-style: normal; margin: 0 6px; }
.dc-title { font: 700 clamp(32px, 4vw, 46px)/1.08 var(--font-sans); letter-spacing: -.025em; margin-bottom: 14px; }
.dc-lead { font: 400 18px/1.6 var(--font-sans); letter-spacing: -.01em; color: var(--label-2); max-width: 680px; margin-bottom: 8px; }

.dc-article { max-width: 720px; }
.dc-article section { padding: 36px 0 8px; border-top: 1px solid var(--surface-hair); margin-top: 36px; }
.dc-article section:first-of-type { margin-top: 28px; }
.dc-article h2 { font: 600 26px/1.25 var(--font-sans); letter-spacing: -.02em; margin-bottom: 14px; }
.dc-article h3 { font: 600 18px/1.4 var(--font-sans); letter-spacing: -.012em; margin: 26px 0 8px; }
.dc-article p { font: 400 16px/1.7 var(--font-sans); letter-spacing: -.005em; color: var(--label-2); margin-bottom: 14px; }
.dc-article ul, .dc-article ol.dc-plain { margin: 0 0 14px 22px; }
.dc-article li { font: 400 16px/1.7 var(--font-sans); color: var(--label-2); margin-bottom: 6px; }
.dc-article li::marker { color: var(--label-3); }
.dc-article strong { color: var(--label); font-weight: 600; }
.dc-article a { color: var(--blue); transition: opacity .2s; }
.dc-article a:hover { opacity: .8; }
.dc-article code, .dc-article kbd {
  font: 500 13.5px 'SF Mono', ui-monospace, Menlo, Consolas, monospace; color: var(--label);
  background: var(--surface-2); border: 1px solid var(--surface-hair-2); border-radius: 6px; padding: 1px 6px;
}
.dc-article kbd { box-shadow: 0 1px 0 var(--surface-hair-2); }

/* Schritt-Liste */
.dc-steps { list-style: none; counter-reset: step; margin: 6px 0 18px; padding: 0; }
.dc-steps > li {
  counter-increment: step; position: relative; padding: 0 0 18px 46px; margin: 0;
  font: 400 16px/1.7 var(--font-sans); color: var(--label-2);
}
.dc-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 1px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--blue-tint); color: var(--blue); font: 600 14px/30px var(--font-sans); text-align: center;
}
.dc-steps > li:not(:last-child)::after { content: ''; position: absolute; left: 14.5px; top: 36px; bottom: 6px; width: 1px; background: var(--surface-hair-2); }
.dc-steps ul { margin-top: 8px; }

/* Menüpfad */
.dc-path {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; vertical-align: baseline;
  font: 500 14px var(--font-sans); color: var(--label);
  background: var(--surface-1); border: 1px solid var(--surface-hair-2); border-radius: 8px; padding: 2px 10px;
}
.dc-path i { font-style: normal; color: var(--label-3); }

/* Hinweisboxen */
.dc-note {
  margin: 18px 0; padding: 16px 18px 16px 18px; border-radius: 14px;
  background: var(--surface-1); border: 1px solid var(--surface-hair); border-left: 3px solid var(--blue);
}
.dc-note.warn { border-left-color: var(--orange); }
.dc-note.ok { border-left-color: var(--green); }
.dc-note .dc-note-title { font: 600 13px var(--font-sans); letter-spacing: -.005em; color: var(--label); margin-bottom: 6px; }
.dc-note p { margin-bottom: 8px; font-size: 15px; line-height: 1.65; }
.dc-note p:last-child, .dc-note ul:last-child { margin-bottom: 0; }

/* Badges */
.dc-badge {
  display: inline-block; vertical-align: middle; margin-left: 6px; padding: 1px 8px; border-radius: 980px;
  font: 600 11px/18px var(--font-sans); letter-spacing: .01em; white-space: nowrap;
  color: var(--blue); background: var(--blue-tint); border: 1px solid rgba(10,132,255,.25);
}
.dc-badge.soon { color: var(--label-2); background: rgba(235,235,245,.08); border-color: var(--surface-hair-2); }
.dc-badge.plan { color: var(--orange); background: rgba(255,159,10,.12); border-color: rgba(255,159,10,.3); }

/* Kartenraster (Übersicht) */
.dc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 28px 0 8px; }
.dc-card {
  display: block; background: var(--surface-1); border: 1px solid var(--surface-hair); border-radius: 20px; padding: 22px;
  transition: transform .4s var(--spring-smooth), border-color .25s var(--ease-out), background .25s var(--ease-out);
}
a.dc-card:hover { transform: translateY(-2px); border-color: var(--surface-hair-2); background: #202022; }
.dc-card .dc-card-num { font: 600 12px var(--font-sans); color: var(--blue); letter-spacing: .02em; margin-bottom: 10px; }
.dc-card h3 { font: 600 18px/1.3 var(--font-sans); letter-spacing: -.012em; margin-bottom: 8px; color: var(--label); }
.dc-card p { font: 400 14px/1.6 var(--font-sans); color: var(--label-2); margin: 0; }
.dc-card.soon { opacity: .55; }
.dc-card.soon .dc-card-num { color: var(--label-3); }

/* Tabellen nutzen .lg-table aus legal.css */
.dc-article .lg-table-wrap { margin: 18px 0; }
.dc-article .lg-table td, .dc-article .lg-table th { font-size: 14px; }
.dc-article .lg-table td:first-child { white-space: nowrap; }

/* Vor/Zurück */
.dc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 720px; margin: 56px 0 0; }
.dc-pager a {
  display: block; padding: 16px 18px; border-radius: 16px; background: var(--surface-1); border: 1px solid var(--surface-hair);
  transition: border-color .25s var(--ease-out);
}
.dc-pager a:hover { border-color: var(--blue); }
.dc-pager small { display: block; font: 500 12px var(--font-sans); color: var(--label-3); margin-bottom: 4px; }
.dc-pager b { font: 600 15px var(--font-sans); color: var(--label); letter-spacing: -.01em; }
.dc-pager .next { text-align: right; grid-column: 2; }

.dc-help { max-width: 720px; margin-top: 40px; padding: 20px 22px; border-radius: 16px; background: var(--surface-1); border: 1px solid var(--surface-hair); }
.dc-help p { font: 400 14px/1.6 var(--font-sans); color: var(--label-2); margin: 0; }
.dc-help a { color: var(--blue); }

/* ── TOC rechts ── */
.dc-toc { position: sticky; top: calc(var(--dc-nav-h) + 28px); padding-top: 4px; }
.dc-toc .dc-navlabel { margin-left: 0; margin-top: 0; }
.dc-toc a { display: block; padding: 5px 0 5px 12px; border-left: 1px solid var(--surface-hair); font: 400 13px/1.45 var(--font-sans); color: var(--label-3); transition: color .2s, border-color .2s; }
.dc-toc a:hover { color: var(--label); }
.dc-toc a.active { color: var(--blue); border-left-color: var(--blue); }

/* ── Mobile-Steuerung ── */
.dc-menu-btn {
  display: none; align-items: center; gap: 8px; margin: 0 0 18px; padding: 9px 14px; border-radius: 12px; cursor: pointer;
  background: var(--surface-1); border: 1px solid var(--surface-hair); color: var(--label);
  font: 500 14px var(--font-sans);
}
.dc-menu-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

@media (max-width: 1180px) {
  .dc-shell { grid-template-columns: var(--dc-sidebar) minmax(0, 1fr); }
  .dc-toc { display: none; }
}
@media (max-width: 860px) {
  .dc-shell, .dc-shell.dc-no-toc { grid-template-columns: minmax(0, 1fr); gap: 0; padding: calc(var(--dc-nav-h) + 20px) 20px 0; }
  .dc-menu-btn { display: inline-flex; }
  .dc-sidebar {
    display: none; position: static; max-height: none; overflow: visible; margin-bottom: 22px; padding: 16px;
    background: var(--surface-1); border: 1px solid var(--surface-hair); border-radius: 16px;
  }
  .dc-sidebar.open { display: block; }
  .dc-lead { font-size: 17px; }
  .dc-article h2 { font-size: 23px; }
  .dc-pager { grid-template-columns: 1fr; }
  .dc-pager .next { grid-column: 1; }
}
@media (max-width: 560px) {
  .dc-steps > li { padding-left: 42px; }
  .dc-grid { grid-template-columns: 1fr; }
}
