/*
 * Landingpage und Tool-Referenz des docurex MCP-Servers.
 *
 * Design-Tokens stammen 1:1 aus docuplus_challenge (tailwind.config.js, src/index.css); es sind
 * keine eigenen Farben erfunden:
 *   --primary-500 #00314a   DocuPlus Basis-Blau (Kopfzeile, Codeblöcke)
 *   --primary-600 #00273b   dunkler Blauton (Codeblöcke)
 *   --primary-50  #e6f0f4   hellster Blauton (Tabellenkopf, Inline-Code)
 *   --accent      #fdb813   CI-Gelb (nur als Zierlinie, nie als Textfarbe auf Hell)
 *   --foreground  hsl(200 100% 15%) = #00334d   Textfarbe (13,29:1 auf Weiß)
 *   --muted       hsl(200 30% 40%)  = #477085   Nebentext (5,35:1 auf Weiß)
 *   --border      hsl(200 11% 88%)  = #dde2e4   Rahmen
 *   --mandant-hintergrund #f6f5f7   Seitenhintergrund
 *   --radius 0.625rem, Fokusring #00334d, Schrift Montserrat (lokal), danach "Segoe UI", Helvetica, Arial.
 * Kein JavaScript, keine externen Ressourcen (CSP: default-src 'self'; style-src 'self').
 */

@font-face {
  font-family: Montserrat;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/montserrat-400.woff2') format('woff2');
}

@font-face {
  font-family: Montserrat;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/montserrat-600.woff2') format('woff2');
}

@font-face {
  font-family: Montserrat;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/montserrat-700.woff2') format('woff2');
}

:root {
  color-scheme: light;
  --primary-50: #e6f0f4;
  --primary-500: #00314a;
  --primary-600: #00273b;
  --accent: #fdb813;
  --foreground: #00334d;
  --muted: #477085;
  --border: #dde2e4;
  --page: #f6f5f7;
  --surface: #fff;
  --focus-ring: #00334d;
  --radius: 0.625rem;
  --font-sans: Montserrat, 'Segoe UI', Helvetica, Arial, Verdana, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', Consolas, 'Liberation Mono', monospace;
}

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

html {
  font-size: 100%;
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

/* Lesbare Zeilenlänge, auf Handys randlos bis auf den Innenabstand. */
.wrap {
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  color: var(--primary-500);
  font-weight: 600;
  border-radius: 0 0 var(--radius) var(--radius);
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

.site-header :focus-visible {
  outline-color: var(--accent);
}

/* Der Rahmen liegt innen auf dem dunklen Block: Gelb (7,83:1 auf Blau) statt Gelb auf der hellen Seite (1,74:1). */
.code-block:focus-visible {
  outline-color: var(--accent);
  outline-offset: -4px;
}

/* Kopfzeile in der Marken-Primärfarbe, darunter die CI-Zierlinie. */
.site-header {
  background: var(--primary-500);
  color: #fff;
  border-bottom: 4px solid var(--accent);
}

.site-header .wrap {
  padding-top: 1.25rem;
  padding-bottom: 1rem;
}

.brand {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: 0.375rem 0;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.site-nav a:hover {
  text-decoration-thickness: 2px;
}

main {
  display: block;
  padding-bottom: 2rem;
}

h1,
h2,
h3 {
  line-height: 1.25;
  color: var(--primary-500);
}

h1 {
  margin: 2rem 0 0.75rem;
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem);
  font-weight: 700;
}

h2 {
  margin: 2.5rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 1.5rem;
  font-weight: 700;
}

h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

li + li {
  margin-top: 0.25rem;
}

.lead {
  max-width: 44rem;
  font-size: 1.125rem;
}

.muted {
  color: var(--muted);
}

a {
  color: var(--primary-500);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

:not(pre) > code {
  padding: 0.1em 0.35em;
  background: var(--primary-50);
  color: var(--primary-500);
  border-radius: 4px;
  overflow-wrap: anywhere;
}

.code-block {
  margin: 0 0 1rem;
  padding: 1rem;
  background: var(--primary-600);
  color: #fff;
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.55;
}

.code-block code {
  font-size: inherit;
}

.notice {
  margin: 1rem 0;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary-500);
  border-radius: var(--radius);
}

.notice > :last-child {
  margin-bottom: 0;
}

.notice-warning {
  border-left-color: var(--accent);
}

table {
  width: 100%;
  margin: 0 0 1rem;
  background: var(--surface);
  border-collapse: collapse;
  border: 1px solid var(--border);
  font-size: 0.9375rem;
}

caption {
  padding: 0 0 0.5rem;
  color: var(--muted);
  text-align: left;
  font-size: 0.875rem;
}

th,
td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

thead th,
tbody th[scope='row'] {
  background: var(--primary-50);
  color: var(--primary-500);
  font-weight: 600;
}

td.count {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Breite Tabellen scrollen in ihrem eigenen Rahmen, nie die ganze Seite. */
.table-scroll {
  margin: 0 0 1rem;
  overflow-x: auto;
}

.table-scroll table {
  min-width: 36rem;
  margin: 0;
}

.site-footer {
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

/* Tool-Referenz (/docs/tools, generiert): gleiche Optik, Tabellen umbrechen auf kleinen Schirmen. */
body > main:not(.wrap) {
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

body > main:not(.wrap) nav ul {
  columns: 16rem;
  padding-left: 1.25rem;
}

body > main:not(.wrap) section {
  margin: 0 0 2rem;
}

body > main:not(.wrap) section h2 {
  margin-top: 1.5rem;
  overflow-wrap: anywhere;
}

table.tool th[scope='row'] {
  width: 8rem;
}

@media (max-width: 40rem) {
  body > main:not(.wrap) table.tool,
  body > main:not(.wrap) table.tool tbody,
  body > main:not(.wrap) table.tool tr,
  body > main:not(.wrap) table.tool th,
  body > main:not(.wrap) table.tool td {
    display: block;
    width: 100%;
  }

  body > main:not(.wrap) table.tool th[scope='row'] {
    border-bottom: 0;
  }

  body > main:not(.wrap) table.parameters {
    display: block;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  .site-nav,
  .skip-link {
    display: none;
  }

  .code-block {
    background: none;
    color: #000;
    border: 1px solid #000;
  }
}

/* Pfad bleibt in einer Zeile; die Tabelle scrollt auf schmalen Bildschirmen im Wrapper. */
tbody th[scope='row'] code {
  white-space: nowrap;
}
