/* ============================================
 * werkstattlinie.css v0.1
 * Schichtwerk Design System
 * Drei Ebenen: paper · werkzeug · homepage
 * WCAG 2.1 AA compliant
 * ============================================ */

:root {
  /* Werkstattlinie Tokens */
  --wl-ink: #1a1a1a;
  --wl-paper: #fafaf7;
  --wl-rule: #c0c0b8;
  --wl-soft: #6a6a62;
  --wl-accent: #00875a;
  --wl-accent-bg: rgba(0, 135, 90, 0.06);
  --wl-warn: #c75c2e;
  --wl-link: #00875a;

  /* Dark-Mode-Tokens (für ebene-werkzeug/homepage) */
  --wl-dark-bg: #080a0f;
  --wl-dark-fg: #cdd4e4;
  --wl-dark-soft: #6d7590;
  --wl-dark-rule: #1c2030;
  --wl-dark-accent: #00e0a8;

  /* Typografie */
  --wl-serif: 'Crimson Pro', 'Iowan Old Style', Georgia, 'DejaVu Serif', serif;
  --wl-mono: 'JetBrains Mono', 'SF Mono', 'DejaVu Sans Mono', Consolas, monospace;
  --wl-sans: 'Bricolage Grotesque', 'Inter', system-ui, 'DejaVu Sans', sans-serif;

  /* Spacing */
  --wl-gap-xs: 0.4rem;
  --wl-gap-s: 0.8rem;
  --wl-gap-m: 1.4rem;
  --wl-gap-l: 2.4rem;
  --wl-gap-xl: 4rem;
}

/* === RESET === */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* === BARRIEREFREIHEIT === */
.wl-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--wl-accent);
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 1000;
}
.wl-skip:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--wl-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === EBENE PAPER === */
body.ebene-paper {
  font-family: var(--wl-serif);
  font-size: 11pt;
  line-height: 1.55;
  color: var(--wl-ink);
  background: var(--wl-paper);
  max-width: 170mm;
  margin: 24mm auto;
  padding: 0 6mm;
  font-feature-settings: "kern", "liga", "onum";
  hyphens: auto;
  -webkit-hyphens: auto;
}

body.ebene-paper[lang="en"] { hyphens: manual; }

@media print {
  body.ebene-paper {
    margin: 0;
    max-width: none;
    padding: 0;
  }
}

.ebene-paper .wl-title-block {
  border-top: 3px double var(--wl-ink);
  border-bottom: 1px solid var(--wl-ink);
  padding: 8mm 0 6mm;
  margin-bottom: 8mm;
}

.ebene-paper .wl-kicker {
  font-family: var(--wl-mono);
  font-size: 9pt;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--wl-soft);
  margin-bottom: 6mm;
}

.ebene-paper h1 {
  font-family: var(--wl-serif);
  font-weight: 600;
  font-size: 26pt;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 4mm;
  font-style: italic;
}

.ebene-paper .wl-subtitle {
  font-size: 13pt;
  color: var(--wl-ink);
  font-weight: 400;
  margin-bottom: 6mm;
  font-style: italic;
  border-left: 3px solid var(--wl-accent);
  padding-left: 4mm;
}

.ebene-paper .wl-meta {
  font-family: var(--wl-mono);
  font-size: 9pt;
  color: var(--wl-soft);
  line-height: 1.7;
}

.ebene-paper .wl-meta strong { color: var(--wl-ink); font-weight: 500; }

.ebene-paper .wl-abstract {
  background: var(--wl-accent-bg);
  border-left: 3px solid var(--wl-accent);
  padding: 5mm 6mm;
  margin: 8mm 0;
  font-size: 10.5pt;
}

.ebene-paper h2 {
  font-family: var(--wl-serif);
  font-size: 16pt;
  font-weight: 600;
  margin-top: 10mm;
  margin-bottom: 4mm;
  color: var(--wl-ink);
  letter-spacing: -0.01em;
}

.ebene-paper h2::before {
  content: '§ ';
  color: var(--wl-accent);
  font-weight: 400;
}

.ebene-paper h3 {
  font-family: var(--wl-serif);
  font-size: 12pt;
  font-weight: 600;
  font-style: italic;
  margin-top: 6mm;
  margin-bottom: 2mm;
}

.ebene-paper p {
  margin-bottom: 3mm;
  text-align: justify;
}

.ebene-paper p + p {
  text-indent: 1.5em;
  margin-bottom: 3mm;
}

.ebene-paper h2 + p,
.ebene-paper h3 + p,
.ebene-paper .wl-abstract p { text-indent: 0; }

.ebene-paper ul, .ebene-paper ol {
  margin: 3mm 0 4mm 6mm;
  padding-left: 4mm;
}

.ebene-paper li {
  margin-bottom: 1mm;
  line-height: 1.5;
}

.ebene-paper code {
  font-family: var(--wl-mono);
  font-size: 9pt;
  background: rgba(26, 26, 26, 0.06);
  padding: 1px 4px;
  border-radius: 2px;
}

.ebene-paper pre {
  font-family: var(--wl-mono);
  font-size: 8.5pt;
  background: rgba(26, 26, 26, 0.04);
  border-left: 2px solid var(--wl-accent);
  padding: 3mm 4mm;
  margin: 4mm 0;
  overflow-x: auto;
  line-height: 1.5;
}

.ebene-paper .wl-formula {
  text-align: center;
  margin: 5mm 0;
  font-family: var(--wl-mono);
  font-size: 11pt;
  padding: 3mm;
  border-top: 1px solid var(--wl-rule);
  border-bottom: 1px solid var(--wl-rule);
}

.ebene-paper .wl-references {
  font-size: 10pt;
  line-height: 1.5;
  border-top: 1px solid var(--wl-rule);
  margin-top: 10mm;
  padding-top: 6mm;
}

.ebene-paper .wl-references ol {
  margin-left: 0;
  padding-left: 5mm;
}

.ebene-paper .wl-references li {
  margin-bottom: 2mm;
  text-align: left;
  font-feature-settings: "onum";
}

.ebene-paper .wl-footer {
  border-top: 3px double var(--wl-ink);
  margin-top: 12mm;
  padding-top: 5mm;
  font-family: var(--wl-mono);
  font-size: 8.5pt;
  color: var(--wl-soft);
  text-align: center;
  line-height: 1.7;
  letter-spacing: 0.05em;
}

.ebene-paper .wl-footer strong { color: var(--wl-ink); }

.ebene-paper a {
  color: var(--wl-link);
  text-decoration: none;
  border-bottom: 1px dotted var(--wl-link);
}

.ebene-paper blockquote {
  margin: 4mm 6mm;
  padding-left: 4mm;
  border-left: 2px solid var(--wl-rule);
  font-style: italic;
  color: var(--wl-soft);
}

.ebene-paper hr {
  border: none;
  border-top: 1px solid var(--wl-rule);
  margin: 5mm 0;
}

/* === EBENE HOMEPAGE === */
body.ebene-homepage {
  font-family: var(--wl-sans);
  font-weight: 400;
  background: var(--wl-dark-bg);
  color: var(--wl-dark-fg);
  line-height: 1.5;
}

.ebene-homepage .wl-card {
  background: #0e1118;
  border: 1px solid var(--wl-dark-rule);
  padding: 1.5rem;
}

.ebene-homepage .wl-btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--wl-dark-accent);
  color: var(--wl-dark-bg);
  font-family: var(--wl-mono);
  font-size: 0.85rem;
  text-decoration: none;
  letter-spacing: 0.05em;
  border: none;
  cursor: pointer;
}

.ebene-homepage .wl-btn:hover { opacity: 0.85; }

/* === EBENE WERKZEUG === */
body.ebene-werkzeug {
  font-family: var(--wl-sans);
  background: var(--wl-dark-bg);
  color: var(--wl-dark-fg);
  line-height: 1.5;
}

/* === SHARED COMPONENTS === */
.wl-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--wl-dark-rule); }
.wl-tag { display: inline-block; padding: 0.2rem 0.6rem; font-family: var(--wl-mono); font-size: 0.7rem; letter-spacing: 0.1em; }
.wl-table { width: 100%; border-collapse: collapse; }
.wl-table th, .wl-table td { padding: 0.5rem; border-bottom: 1px solid var(--wl-rule); text-align: left; }
.wl-stop { color: var(--wl-warn); }
