/* swark-Dokumentation – Lesemodus auf Basis von site.css */

.wrap--docs { max-width: calc(1360px + 2 * var(--gutter)); }

.docs__grid {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 210px;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
  padding-top: 36px;
  padding-bottom: 96px;
}

/* Seitenleiste */
.side { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; padding-bottom: 24px; font-size: .92rem; }
.side ul { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 1px; }
.side a {
  display: block; padding: 6px 10px; border-radius: 7px; color: var(--ink-2); text-decoration: none; line-height: 1.35;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.side a:hover { background: var(--bg-alt); color: var(--ink); }
.side a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 580; }
.side__home { font-weight: 580; margin-bottom: 14px; }
.side__group { font-size: .78rem; font-weight: 600; color: var(--muted); margin: 0 0 6px; padding: 0 10px; }

/* Inhalt */
.doc { min-width: 0; max-width: 76ch; }
.doc h1 { font-size: clamp(2rem, 3.4vw, 2.75rem); line-height: 1.08; font-weight: 640; letter-spacing: -.035em; }
.doc__summary { margin-top: 14px; font-size: 1.12rem; color: var(--ink-2); line-height: 1.55; padding-bottom: 28px; border-bottom: 1px solid var(--line); }

.prose { font-size: 1.02rem; line-height: 1.7; color: var(--ink-2); }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 1.6rem; line-height: 1.2; font-weight: 630; letter-spacing: -.028em; color: var(--ink); margin-top: 2.4em; scroll-margin-top: 90px; }
.prose h3 { font-size: 1.2rem; line-height: 1.3; font-weight: 620; letter-spacing: -.018em; color: var(--ink); margin-top: 1.9em; scroll-margin-top: 90px; }
.prose h4 { font-size: 1.02rem; font-weight: 620; color: var(--ink); margin-top: 1.6em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .6em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--muted); }
.prose a { font-weight: 500; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose blockquote { margin-left: 0; padding: 14px 18px; background: var(--bg-alt); border-radius: var(--radius); color: var(--ink-2); }
.prose code { white-space: normal; overflow-wrap: anywhere; }
.prose pre {
  background: #0d1729; color: #dde5f2; border-radius: var(--radius); padding: 16px 18px; overflow-x: auto;
  font: 450 .86rem/1.6 var(--mono); tab-size: 4;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; white-space: pre; }
.prose pre::selection, .prose pre *::selection { background: #2f4a8a; color: #fff; }

.doc-table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.doc-table table { border-collapse: collapse; width: 100%; font-size: .9rem; line-height: 1.5; }
.doc-table th, .doc-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-table th { background: #f8f9fb; color: var(--ink); font-weight: 600; font-size: .84rem; white-space: nowrap; }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table td code { font-size: .82em; white-space: nowrap; overflow-wrap: normal; }

/* Inhaltsverzeichnis rechts */
.toc { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; font-size: .84rem; }
.toc__title { font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; color: var(--muted); text-decoration: none; border-left: 1px solid transparent; line-height: 1.4; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--accent-ink); border-left-color: var(--accent); }
.toc__sub a { padding-left: 24px; }

/* Weiterblättern */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); }
.pager a {
  display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); font-weight: 560; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.pager a:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); color: var(--ink); }
.pager span { font-size: .8rem; color: var(--muted); font-weight: 450; }
.pager__next { text-align: right; }

/* Übersicht */
.overview__group { font-size: 1.3rem; font-weight: 630; letter-spacing: -.02em; margin-top: 44px; }
.overview { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--line); }
.overview a { display: grid; gap: 4px; padding: 16px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: background-color .2s var(--ease); }
.overview a:hover { background: var(--bg-alt); }
.overview strong { font-weight: 600; font-size: 1.05rem; }
.overview span { color: var(--muted); font-size: .94rem; line-height: 1.5; }

.docs__foot { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: .86rem; color: var(--muted); }

.side-toggle { display: none; }

@media (max-width: 1180px) {
  .docs__grid { grid-template-columns: 220px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .docs__grid { grid-template-columns: minmax(0, 1fr); padding-top: 24px; }
  .side-toggle { display: inline-flex; }
  .side {
    display: none; position: static; max-height: none; border: 1px solid var(--line);
    border-radius: var(--radius); padding: 14px; background: #fff;
  }
  .side.is-open { display: block; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  /* Tabellen als gestapelte Zeilen: jede Zelle mit ihrer Spaltenbeschriftung */
  .doc-table { overflow: visible; }
  .doc-table table, .doc-table tbody, .doc-table tr, .doc-table td { display: block; width: 100%; }
  .doc-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .doc-table tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .doc-table tr:last-child { border-bottom: 0; }
  .doc-table td { border: 0; padding: 3px 0; }
  .doc-table td[data-label]::before { content: attr(data-label); display: block; font-size: .76rem; font-weight: 600; color: var(--muted); }
  .doc-table td[data-label=""]::before { display: none; }
  .doc-table td code { white-space: normal; overflow-wrap: anywhere; }
  .doc-table th, .doc-table td { overflow-wrap: normal; }
  .pager__next { text-align: left; }
}
