/* Dub Together: legal.dub-together.com
   Gemeinsames Stylesheet fuer alle Seiten. Nur Systemschriften, keine externen Ressourcen. */

:root {
  --gutter: 24px;
  --measure: 760px;

  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-hover: #f1f1ee;
  --text: #1c1c1f;
  --muted: #5d5e65;
  --line: #e3e3df;
  --line-strong: #c9c9c4;
  --link: #1b57b5;
  --link-hover: #0e3a80;
  --accent: #1b57b5;
  --code-bg: #ececea;
  --th-bg: #f2f2ef;
  --shadow: rgba(20, 20, 30, 0.16);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131315;
    --surface: #1b1b1e;
    --surface-hover: #232327;
    --text: #e8e8ea;
    --muted: #a2a3aa;
    --line: #2c2c31;
    --line-strong: #44444b;
    --link: #8db4ff;
    --link-hover: #bcd2ff;
    --accent: #8db4ff;
    --code-bg: #26262b;
    --th-bg: #212125;
    /* heller Schimmer statt Schatten: auf dunklem Grund sonst kaum sichtbar */
    --shadow: rgba(255, 255, 255, 0.16);

    color-scheme: dark;
  }
}

@media (max-width: 480px) {
  :root { --gutter: 16px; }
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

main { flex: 1 0 auto; }

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Sprunglink fuer Tastatur und Screenreader */
.skip {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 10;
  padding: 0.5rem 0.875rem;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--accent);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}
.skip:focus { top: 8px; }

/* Kopfzeile */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
}
.brand {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand:hover { color: var(--link); }
.lang-switch {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}
.lang-switch:hover {
  border-color: var(--accent);
  color: var(--link);
}

/* Text */
main.wrap {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

h1, h2, h3 {
  color: var(--text);
  line-height: 1.25;
  text-wrap: balance;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 1.35rem + 1.7vw, 2.375rem);
  font-weight: 750;
  letter-spacing: -0.02em;
}

h2 {
  margin: 3rem 0 0.875rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  scroll-margin-top: 1rem;
}

h2 .num {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

h2 + h3 { margin-top: 1.25rem; }

p { margin: 0 0 1rem; }

ul, ol { margin: 0 0 1.125rem; padding-left: 1.375rem; }
li { margin: 0.375rem 0; }
li::marker { color: var(--muted); }

strong { font-weight: 650; }

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--link-hover);
  text-decoration-thickness: 2px;
}
a:focus-visible,
.table-wrap:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

code {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "SF Mono", Menlo, "Liberation Mono", monospace;
  font-size: 0.875em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--code-bg);
  overflow-wrap: anywhere;
}

address { font-style: normal; }

/* Dokumentkopf */
.doc-header { margin-bottom: 1.75rem; }

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.lead { font-size: 1.125rem; }

.note {
  margin: 1.25rem 0 1.5rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: var(--surface);
  font-size: 0.9375rem;
}

/* Inhaltsverzeichnis */
.toc {
  margin: 2rem 0 0.5rem;
  padding: 1.25rem 1.25rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.toc .toc-title {
  margin: 0 0 0.625rem;
  padding: 0;
  border: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2 17rem;
  column-gap: 2rem;
}
.toc li {
  margin: 0;
  padding: 0.2rem 0;
  break-inside: avoid;
}
.toc a {
  display: grid;
  grid-template-columns: 1.875rem 1fr;
  text-decoration: none;
  line-height: 1.45;
}
.toc a:hover span:last-child {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.toc .num {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Tabellen: auf schmalen Bildschirmen horizontal scrollbar, mit Schattenkanten als Hinweis */
.table-wrap {
  margin: 1.25rem 0 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(to right, var(--surface) 30%, rgba(255, 255, 255, 0)) left center / 40px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, rgba(255, 255, 255, 0)) right center / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--shadow), rgba(0, 0, 0, 0)) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--shadow), rgba(0, 0, 0, 0)) right center / 12px 100% no-repeat scroll;
  background-color: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}
table.cols-3 { min-width: 38rem; }
table.cols-5 { min-width: 46rem; }

th,
td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
thead th {
  background: var(--th-bg);
  font-weight: 700;
}
tbody th { font-weight: 650; }
tbody tr:last-child > * { border-bottom: 0; }

table.cols-3 tbody th { width: 11rem; }
table.cols-3 td:last-child { width: 11rem; }
table.cols-5 tbody th {
  width: 14rem;
  font-weight: 400;
}

/* Schmale Bildschirme: jede Tabellenzeile als Karte, der Spaltenname (data-label) steht
   ueber jedem Wert. Der Tabellenkopf bleibt fuer Screenreader erhalten, ist aber unsichtbar. */
@media (max-width: 600px) {
  .table-wrap {
    position: relative;
    overflow: visible;
    background: var(--surface);
  }
  table.cols-3,
  table.cols-5 { min-width: 0; }
  table,
  tbody,
  tr,
  th,
  td { display: block; }
  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  tbody tr {
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--line);
  }
  tbody tr:last-child { border-bottom: 0; }
  tbody th,
  td {
    padding: 0.25rem 0.875rem;
    border-bottom: 0;
  }
  table.cols-3 tbody th,
  table.cols-3 td:last-child,
  table.cols-5 tbody th { width: auto; }
  td::before,
  table.cols-5 tbody th::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.4;
  }
}

/* Impressum */
.imprint-block {
  margin: 1.5rem 0 0;
  padding: 1.25rem 1.375rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.imprint-block address { margin: 0 0 1rem; }
.imprint-block p:last-child { margin-bottom: 0; }

/* Startseite */
.home h1 { margin-bottom: 0.75rem; }
.home .lead { margin-bottom: 2.25rem; color: var(--muted); }
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.5rem;
}
.label {
  margin: 0 0 0.625rem;
  padding: 0;
  border: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.home .support { margin-top: 2.25rem; }
.link-list {
  display: grid;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.link-list li { margin: 0; }
.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}
.link-list a::after {
  content: "\203A";
  color: var(--muted);
  font-size: 1.375rem;
  line-height: 1;
}
.link-list a:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--link);
}

/* Fusszeile */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9375rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1.375rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links li { margin: 0; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--link-hover); }
.footer-links a[aria-current="page"] {
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}
.copyright { margin: 0; }

/* Schmale Bildschirme: Silbentrennung fuer lange deutsche Woerter */
@media (max-width: 600px) {
  body { font-size: 1rem; }
  main.wrap { padding-top: 1.75rem; }
  h1, h2, p, li, td, th { -webkit-hyphens: auto; hyphens: auto; }
  h2 { margin-top: 2.5rem; font-size: 1.25rem; }
  .toc { padding: 1rem; }
  .imprint-block { padding: 1rem 1.125rem; }
}

/* Druck */
@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #000000;
    --muted: #333333;
    --line: #bbbbbb;
    --link: #000000;
    --th-bg: #eeeeee;
    --code-bg: #eeeeee;
  }
  body { font-size: 11pt; }
  .skip,
  .lang-switch,
  .toc,
  .site-footer { display: none; }
  .site-header,
  .site-footer { background: none; }
  .table-wrap {
    overflow: visible;
    background: none;
  }
  table.cols-3,
  table.cols-5 { min-width: 0; }
  h2, h3 { break-after: avoid; }
  tr { break-inside: avoid; }
}
