/* railcast.de/technik — Ergänzung zu /style.css.
   Hier stehen nur die Bausteine, die es sonst nirgends auf der Site gibt:
   Faktenkacheln, Callouts, ASCII-Diagramme, Glossar. Farben, Fonts, Dark/Light
   und der Skip-Link kommen aus /style.css; deshalb wird die zuerst geladen.
   Klassennamen bewusst mit doc-/fact- präfigiert, damit sie nicht mit den
   Landing-Klassen (.kpi, .footer, .note) kollidieren. */

.doc h1 {
    font-family: var(--serif); font-weight: 700;
    font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.02em;
    margin: 0 0 6px; text-wrap: balance;
}
.doc .subtitle {
    font-family: var(--mono); font-size: 13px; color: var(--ink-soft);
    margin: 0 0 36px;
}
.doc h2 {
    font-family: var(--serif); font-weight: 600;
    font-size: clamp(21px, 2vw, 28px); letter-spacing: -0.01em;
    margin: 52px 0 14px; padding-bottom: 8px;
    border-bottom: 2px solid var(--rule-strong);
    text-wrap: balance;
}
.doc h3 {
    font-family: var(--serif); font-weight: 600; font-size: 18px;
    margin: 26px 0 8px;
}
.doc p { max-width: 72ch; text-wrap: pretty; margin: 0 0 14px; }
.doc ul, .doc ol { max-width: 72ch; margin: 8px 0 18px; padding-left: 22px; }
.doc li { margin-bottom: 8px; text-wrap: pretty; }
.doc li::marker { color: var(--accent); }

/* ---- Erklärender Ablauf ---- */
.tech-process {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    max-width: none;
    margin: 24px 0 12px;
    padding: 0;
    list-style: none;
}
.tech-process li {
    min-width: 0;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--rule);
    background: var(--surface);
}
.tech-process h3 { margin: 0 0 6px; font-size: 18px; }
.tech-process p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.process-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--green-soft);
    color: var(--accent);
}
.process-icon svg {
    width: 31px;
    height: 31px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.limit-list { max-width: 74ch; color: var(--ink-soft); }
.limit-list strong { color: var(--ink); }
.technical-details { margin-top: 12px; }

/* ---- Faktenkacheln ---- */
.fact-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px; margin: 20px 0 30px;
}
.fact {
    background: var(--surface); border: 1px solid var(--rule);
    padding: 13px 15px;
}
.fact b {
    display: block;
    font-family: var(--serif); font-weight: 700; font-size: clamp(19px, 2vw, 26px);
    letter-spacing: -0.02em; line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.fact span {
    display: block; margin-top: 5px;
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.03em;
    text-transform: uppercase; color: var(--ink-soft);
}

/* ---- Callouts ---- */
.callout {
    background: var(--surface); border-left: 3px solid var(--accent-dim);
    padding: 14px 18px; margin: 20px 0; max-width: 74ch;
    font-size: 14.5px; color: var(--ink-soft); text-wrap: pretty;
}
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout strong { color: var(--ink); font-weight: 600; }
.callout.warn { border-left-color: var(--sig-late); }
.callout.warn strong { color: var(--ink); }
.callout ul { margin: 8px 0 0; }

/* ---- Tabellen ---- */
.doc table {
    width: 100%; border-collapse: collapse; margin: 14px 0 22px; font-size: 14.5px;
}
.doc th, .doc td {
    text-align: left; padding: 9px 14px 9px 0;
    border-bottom: 1px solid var(--rule); vertical-align: top;
}
.doc th { font-family: var(--sans); font-weight: 600; color: var(--ink); }
.doc td strong { color: var(--accent); font-weight: 600; }
.doc tbody tr:last-child td { border-bottom: 0; }

/* ---- ASCII-Diagramme: Monospace, waagerecht scrollbar ---- */
.diagram {
    background: var(--code-bg); border: 1px solid var(--rule);
    padding: 18px 20px; margin: 20px 0;
    font-family: var(--mono); font-size: 12px; line-height: 1.5;
    white-space: pre; overflow-x: auto; color: var(--ink-soft);
}

/* ---- Glossar ---- */
.glossary { margin: 14px 0 0; max-width: 74ch; }
.glossary dt {
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--accent);
    font-weight: 600; margin-top: 18px;
}
.glossary dd {
    margin: 4px 0 0; color: var(--ink-soft); font-size: 14.5px;
    text-wrap: pretty;
}

/* ---- Abschluss-Notiz ---- */
.doc-footer {
    margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--rule);
    color: var(--ink-soft); font-family: var(--mono); font-size: 12px;
}
.doc-footer p { margin: 0 0 6px; max-width: none; }

@media (max-width: 640px) {
    .doc h2 { margin-top: 38px; }
    .diagram { font-size: 10.5px; padding: 14px; }
    .doc table { font-size: 13.5px; }
    .doc th, .doc td { padding: 8px 8px 8px 0; }
    .tech-process { grid-template-columns: 1fr; gap: 10px; }
    .tech-process li { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start; }
    .process-icon { margin: 0; }
}

@media print {
    .diagram, .callout, .fact, table { break-inside: avoid; }
}
