/* ============================================================
   Hemostat Docs – Design System
   Single-stylesheet, mobile-first, no JS dependencies.
   Abgeleitet vom hemostat.de-Design (Navy/Indigo, dunkel).
   ============================================================ */

:root {
  /* Farben (Marke: Navy #0a0e27 / Indigo #6366f1) */
  --bg: #0a0e27;
  --bg-elevated: #141a3a;
  --bg-elevated-2: #1a2249;
  --border: #2d3358;
  --border-strong: #3b4170;
  --accent: #6366f1;
  --accent-hover: #7c7ff2;
  --highlight: #a5b4fc;
  --text: #f5f7fa;
  --text-muted: #9ca3af;
  --text-faint: #6b7280;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Typografie */
  --font-sans: "Inter", "Inter Var", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.125rem;

  --lh-tight: 1.25;
  --lh-base: 1.65;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  /* Layout */
  --container: 1180px;
  --measure: 76ch;
  --radius: 8px;
  --radius-lg: 12px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ol, ul, dl, dt, dd, figure, blockquote, pre { margin: 0; padding: 0; }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--highlight); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Skip-Link */
.skip-link {
  position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden;
  padding: 0.5rem 1rem; background: var(--accent); color: #fff; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; width: auto; height: auto; }

/* Container */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 39, 0.85);
  backdrop-filter: saturate(140%) blur(8px);
  position: sticky; top: 0; z-index: 50;
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--space-3); padding-bottom: var(--space-3); gap: var(--space-5);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-weight: 700; letter-spacing: 0.02em;
  color: var(--text); text-decoration: none;
}
.brand-mark { width: 26px; height: 26px; }
.brand-suffix { color: var(--text-muted); font-weight: 500; }
.header-links { display: inline-flex; align-items: center; gap: var(--space-5); }
.header-links a {
  color: var(--text-muted); text-decoration: none;
  font-size: var(--fs-sm); font-weight: 500;
}
.header-links a:hover { color: var(--text); }
.header-links .btn-ref {
  color: #fff; background: var(--accent);
  padding: 0.35rem 0.85rem; border-radius: var(--radius);
}
.header-links .btn-ref:hover { background: var(--accent-hover); }

/* Layout: Sidebar + Content */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  padding-top: var(--space-6);
  padding-bottom: var(--space-7);
}
@media (min-width: 900px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr); }
}

/* Docs-Navigation */
.docs-nav ul { list-style: none; }
.docs-nav li + li { margin-top: 2px; }
.docs-nav a {
  display: block; padding: 0.35rem 0.7rem;
  color: var(--text-muted); text-decoration: none;
  font-size: var(--fs-sm); border-radius: var(--radius);
}
.docs-nav a:hover { color: var(--text); background: var(--bg-elevated); }
.docs-nav a[aria-current="page"] { color: var(--text); background: var(--bg-elevated-2); font-weight: 600; }
@media (min-width: 900px) {
  .docs-nav { position: sticky; top: 5rem; align-self: start; }
}

/* Content-Typografie */
.content { max-width: var(--measure); }
.content h1 { font-size: var(--fs-2xl); line-height: var(--lh-tight); letter-spacing: -0.015em; margin-bottom: var(--space-4); }
.content .lead { font-size: var(--fs-md); color: var(--text-muted); margin-bottom: var(--space-5); }
.content h2 { font-size: var(--fs-lg); line-height: var(--lh-tight); margin-top: var(--space-7); margin-bottom: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.content h3 { font-size: var(--fs-md); margin-top: var(--space-6); margin-bottom: var(--space-2); }
.content p, .content ul, .content ol, .content dl { margin-bottom: var(--space-4); }
.content ul, .content ol { padding-left: 1.4rem; }
.content li + li { margin-top: var(--space-1); }
.content strong { color: var(--text); }

/* Code */
.content code {
  font-family: var(--font-mono); font-size: 0.875em;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 4px; padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}
.content pre {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--space-4);
  overflow-x: auto; margin-bottom: var(--space-4);
  font-size: var(--fs-sm); line-height: 1.55;
}
.content pre code { background: none; border: none; padding: 0; font-size: inherit; overflow-wrap: normal; }

/* Tabellen */
.content table {
  width: 100%; border-collapse: collapse;
  font-size: var(--fs-sm); margin-bottom: var(--space-5);
  display: block; overflow-x: auto;
}
.content th, .content td {
  text-align: left; padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border); vertical-align: top;
}
.content th { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.content td code { white-space: nowrap; }

/* Hinweis-Boxen */
.content blockquote {
  border-left: 3px solid var(--accent);
  background: var(--bg-elevated);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  color: var(--text-muted);
}
.content blockquote p:last-child { margin-bottom: 0; }

/* Karten (Quicklinks auf der Startseite) */
.card-grid {
  display: grid; grid-template-columns: 1fr; gap: var(--space-4);
  margin-bottom: var(--space-5); padding-left: 0 !important; list-style: none;
}
@media (min-width: 640px) { .card-grid { grid-template-columns: 1fr 1fr; } }
.card-grid li { margin: 0; }
.card-grid a {
  display: block; height: 100%;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-4);
  text-decoration: none; color: var(--text);
}
.card-grid a:hover { border-color: var(--border-strong); background: var(--bg-elevated-2); }
.card-grid strong { display: block; margin-bottom: var(--space-1); color: var(--highlight); }
.card-grid span { font-size: var(--fs-sm); color: var(--text-muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); }
.footer-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3);
  padding-top: var(--space-5); padding-bottom: var(--space-5);
  font-size: var(--fs-xs); color: var(--text-faint);
}
.footer-row a { color: var(--text-muted); }
