/* ─── Docs/Wiki Layout ─────────────────────────────────────────────────────
   Eigenständiges, klassisches Docs-Layout (Sidebar-Nav | Content | TOC),
   angelehnt an gängige Doku-Seiten. Nutzt die Farb-Variablen aus style.css,
   damit Light/Dark-Mode konsistent bleibt. */

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(24px);
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--navbar-border);
}

.docs-topbar-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: 24px;
}

.docs-logo {
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

.docs-logo span {
  color: var(--accent);
}

.docs-logo small {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 13px;
}

.docs-topbar-nav {
  display: flex;
  gap: 18px;
  flex: 1;
}

.docs-topbar-nav a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
}

.docs-topbar-nav a:hover,
.docs-topbar-nav a.active {
  color: var(--text);
}

.docs-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.docs-search {
  width: 200px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 13px;
}

.docs-search:focus {
  outline: none;
  border-color: var(--accent);
}

.docs-sidebar-toggle {
  display: none;
}

/* ─── Grid ────────────────────────────────────────────────────────────── */

.docs-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: grid;
  grid-template-columns: 240px minmax(0, 760px) 220px;
  gap: 48px;
  align-items: flex-start;
}

.docs-shell--index {
  grid-template-columns: 240px minmax(0, 1fr);
}

/* ─── Linke Sidebar ───────────────────────────────────────────────────── */

.docs-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  max-height: calc(100vh - var(--nav-height) - 48px);
  overflow-y: auto;
}

.docs-nav-group {
  margin-bottom: 22px;
}

.docs-nav-group-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 0 10px;
}

.docs-nav-group ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-nav-link {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
}

.docs-nav-link:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.docs-nav-link.active {
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}

/* ─── Content ─────────────────────────────────────────────────────────── */

.docs-content {
  min-width: 0;
  color: var(--text);
}

.docs-breadcrumb {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 8px;
}

.docs-content h1 {
  font-size: 34px;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.docs-lead {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 640px;
}

.docs-body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
}

.docs-body h2 {
  font-size: 24px;
  letter-spacing: -0.01em;
  margin: 40px 0 14px;
  padding-top: 8px;
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

.docs-body h2:first-child {
  margin-top: 0;
}

.docs-body h3 {
  font-size: 19px;
  margin: 28px 0 10px;
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

.docs-body h4 {
  font-size: 16px;
  margin: 20px 0 8px;
  color: var(--text);
}

.docs-body p {
  margin-bottom: 14px;
  color: var(--text-muted);
}

.docs-body ul,
.docs-body ol {
  margin: 0 0 16px;
  padding-left: 1.4em;
  color: var(--text-muted);
}

.docs-body li {
  margin-bottom: 4px;
}

.docs-body a {
  color: var(--accent);
  text-decoration: none;
}

.docs-body a:hover {
  text-decoration: underline;
}

.docs-body img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  margin: 12px 0 20px;
  display: block;
}

.docs-body code {
  font-family: Consolas, "Courier New", monospace;
}

.docs-body p code {
  background-color: var(--inline-code-bg);
  color: var(--inline-code-text);
  padding: 0 4px;
  border-radius: 3px;
  font-size: 0.9em;
}

.docs-body pre code {
  background-color: var(--code-bg);
}

/* ─── Rechte TOC ──────────────────────────────────────────────────────── */

.docs-toc {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  font-size: 13px;
}

.docs-toc h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.docs-toc ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 1px solid var(--border);
}

.docs-toc li {
  padding-left: 12px;
}

.docs-toc-level-3 {
  padding-left: 24px;
}

.docs-toc a {
  color: var(--text-muted);
  text-decoration: none;
  display: block;
}

.docs-toc a:hover {
  color: var(--text);
}

.docs-toc a.active {
  color: var(--accent);
  font-weight: 500;
}

/* ─── Docs-Index (Übersichtsseite) ───────────────────────────────────── */

.docs-index-group {
  margin-bottom: 36px;
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

.docs-index-group h2 {
  font-size: 20px;
  margin-bottom: 14px;
}

.docs-index-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.docs-index-card {
  display: block;
  padding: 18px;
  border-radius: 16px;
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  text-decoration: none;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.docs-index-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 113, 227, 0.5);
}

.docs-index-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.docs-index-card-text {
  font-size: 14px;
  color: var(--text-muted);
}

.docs-footer {
  border-top: 1px solid var(--border);
}

/* ─── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .docs-shell,
  .docs-shell--index {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .docs-toc {
    display: none;
  }

  .docs-search {
    display: none;
  }
}

@media (max-width: 760px) {
  .docs-shell,
  .docs-shell--index {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .docs-sidebar-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-alt);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
  }

  .docs-sidebar {
    position: static;
    max-height: none;
    display: none;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
  }

  .docs-sidebar.open {
    display: block;
  }

  .docs-index-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .docs-topbar-nav {
    display: none;
  }
}
