/* ============================================================================
 *  docu.css — Light-Theme, abgeglichen mit lp-2.php (Säule 2)
 *
 *  Übernimmt die Design-Tokens von lp-2 1:1, damit Doku und Landing visuell
 *  als ein Produkt wirken. Token-Namen identisch — sollte das Marketing
 *  später eine globale CSS-Var-Datei extrahieren, kann sie hier eingebunden
 *  werden, ohne dass die Doku angefasst werden muss.
 *
 *  Geändert ggü. Vorgänger-Version:
 *   - Schwarze Sidebar -> weiße Sidebar mit Border + leichter Shadow
 *   - Rote Buttons (--bg) -> Outline-Buttons mit Primary-Hover (lp-2-Stil)
 *   - Mobile-Header schwarz/rot -> weiß mit Border-Bottom + Logo
 *   - Generische sans-serif -> Inter (mit Fallback-Kette wie lp-2)
 *   - Tabellen-Header Rot/Weiß -> dezente bg-soft + dunkler Text
 * ========================================================================== */

:root {
    --primary:        #D52B1E;
    --primary-soft:   rgba(213, 43, 30, 0.08);
    --primary-line:   rgba(213, 43, 30, 0.25);
    --text:           #1a1a1a;
    --text-soft:      #4a4a4a;
    --text-muted:     #8a8a8a;
    --bg:             #ffffff;
    --bg-subtle:      #fafafa;
    --bg-soft:        #f3f4f6;
    --border:         #e5e7eb;
    --border-soft:    #f0f1f3;
    --radius:         12px;
    --radius-lg:      18px;
    --shadow-sm:      0 1px 2px rgba(0,0,0,0.04);
    --shadow:         0 8px 24px rgba(0,0,0,0.06);
    --shadow-lg:      0 16px 40px rgba(0,0,0,0.08);
    --font:           "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    --sidebar-width:  300px;
    --mobile-hdr-h:   56px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

/* SHELL-INTEGRATION:
 * body bekommt NICHT mehr "display: flex" — sonst landen Shell-Header,
 * Sidebar, Main-Content und Shell-Footer alle in einer Flex-Reihe.
 * Die Sidebar ist eh "position: fixed", braucht keinen Flex-Parent.
 * Für die Layout-Verschiebung sorgt .main-content { margin-left: ... }.
 */
body {
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg-subtle);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: #fff;
    /* Auf Höhe abzüglich Shell-Header (siehe shell.css --shell-header-h) */
    height: calc(100vh - var(--shell-header-h, 72px));
    position: fixed;
    top: var(--shell-header-h, 72px);
    left: 0;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    z-index: 50;
    padding: 18px 12px 24px;
    transition: left 0.25s ease, box-shadow 0.25s ease;
}

/* Sprach-Flaggen oben */
.lang-switch {
    padding: 6px 8px 14px;
    display: flex;
    justify-content: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 14px;
}

.flag-icon {
    cursor: pointer;
    font-size: 22px;
    opacity: 0.65;
    border-radius: 4px;
    transition: opacity 0.15s, transform 0.15s;
}

.flag-icon:hover,
.flag-icon.active {
    opacity: 1;
    transform: translateY(-1px);
}

/* Menü-Container */
#menu-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Menü-Button — Outline-Stil aus lp-2 übernommen */
.btn-primary {
    color: var(--text-soft);
    border: 1px solid transparent;
    background: transparent;
    width: 100%;
    padding: 9px 12px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.btn-primary:hover {
    background: var(--bg-soft);
    color: var(--text);
}

.btn-primary.active,
.btn-primary:focus {
    background: var(--primary-soft);
    color: var(--primary);
    outline: none;
}

.btn-primary i {
    font-size: 1rem;
    width: 22px;
    text-align: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.btn-primary.active i,
.btn-primary:hover i {
    color: var(--primary);
}

.btn-text {
    font-size: 0.92rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: 4px;
}

/* ============================================================
   Main Content
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 32px clamp(16px, 4vw, 48px);
}

.content.card {
    background: #fff;
    padding: clamp(20px, 4vw, 44px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    min-height: 80vh;
    max-width: 920px;
    margin: 0 auto;
}

/* Live-Tour nutzt die volle verfügbare Breite statt der 920px-Lesebreite des
   Handbuchs: so rendert die eingebettete App ihr Desktop-Menü (Burger erst
   unter 900px) und der vorhandene Bildschirmplatz wird ausgenutzt. */
#docu-live.content.card {
    max-width: none;
    padding: clamp(12px, 1.5vw, 20px);
}

/* ============================================================
   Typografie (Doku-Inhalt)
   ============================================================ */
.content h1 {
    font-size: clamp(1.8rem, 3vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0 0 18px;
    color: var(--text);
}

.content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 36px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text);
}

.content h3 {
    font-size: 1.18rem;
    font-weight: 700;
    margin: 28px 0 10px;
    color: var(--text);
}

.content h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 22px 0 8px;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content p,
.content li {
    font-size: 1rem;
    color: var(--text-soft);
    line-height: 1.65;
}

.content p.lead {
    font-size: 1.1rem;
    color: var(--text);
    line-height: 1.6;
}

.content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-line);
    transition: border-color 0.12s, color 0.12s;
}

.content a:hover {
    color: #b8241a;
    border-bottom-color: var(--primary);
}

.content strong { color: var(--text); font-weight: 600; }
.content em     { color: var(--text-soft); }

.content code {
    font-family: "SF Mono", "Consolas", "Monaco", monospace;
    background: var(--bg-soft);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
    color: var(--primary);
}

.content blockquote {
    border-left: 3px solid var(--primary);
    background: var(--primary-soft);
    margin: 18px 0;
    padding: 14px 18px;
    border-radius: 0 8px 8px 0;
    color: var(--text);
}

.content ul, .content ol {
    padding-left: 24px;
    margin: 12px 0 18px;
}

.content li { margin-bottom: 6px; }

/* Text-muted Klasse (Bootstrap-kompatibel) */
.text-muted { color: var(--text-muted) !important; }

/* ============================================================
   Mobile Header
   ============================================================ */
.mobile-header {
    display: none;
    background: #fff;
    padding: 0 14px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--mobile-hdr-h);
    z-index: 1100;
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.mobile-header .logo {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.5px;
    color: var(--text);
}
.mobile-header .logo span { color: var(--primary); }

.mobile-header .btn {
    background: var(--bg-soft);
    color: var(--text);
    border: none;
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}
.mobile-header .btn:hover {
    background: var(--border);
}

/* Doku-Burger (im Shell-Header) + Backdrop: auf Desktop ausgeblendet,
   erst < 900px (Media-Query unten) sichtbar — passend zur Off-Canvas-Sidebar. */
.shell-docu-toggle,
.docu-sidebar-backdrop { display: none; }

@media (max-width: 900px) {
    .mobile-header { display: flex; }

    .sidebar {
        left: -100%;
        width: 280px;
        /* Statt --mobile-hdr-h: an Shell-Header-Höhe ausrichten */
        top: var(--shell-header-h, 72px);
        height: calc(100vh - var(--shell-header-h, 72px));
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.08);
    }

    .sidebar.open { left: 0; }
    .sidebar { z-index: 1055; }   /* über dem Backdrop, wenn offen */

    /* Doku-Burger im Header sichtbar machen + Backdrop für die Sidebar. */
    .shell-docu-toggle { display: inline-flex; }
    .docu-sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1040;
    }
    .docu-sidebar-backdrop.open { display: block; }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 16px 14px 24px;
    }

    .content.card {
        padding: 18px;
        border-radius: 12px;
    }
}

/* ============================================================
   Abbildungen / Bilder
   ============================================================ */
.docu-figure {
    margin: 18px 0 22px;
    text-align: center;
}

.docu-img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    background: #fff;
    padding: 4px;
}

.docu-figure figcaption {
    margin-top: 8px;
    font-size: 0.88rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================================
   Tabellen
   ============================================================ */
.docu-table {
    width: 100%;
    margin: 18px 0 22px;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.95rem;
}

.docu-table th,
.docu-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    vertical-align: top;
}

.docu-table tbody tr:last-child td {
    border-bottom: none;
}

.docu-table thead th {
    background: var(--bg-soft);
    color: var(--text);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.docu-table tbody tr:hover {
    background: var(--bg-subtle);
}

/* ============================================================
   Print-Optimierung (für PDF-Export der Doku)
   ============================================================ */
@media print {
    .sidebar, .mobile-header { display: none !important; }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 0;
    }
    .content.card {
        border: none;
        box-shadow: none;
        padding: 0;
        max-width: 100%;
    }
    .content a { color: var(--text); border: none; }
}
