/* Lumina docs site — layout and theme for pages rendered by docs/web/tools/md2html. */

:root {
    --bg: #ffffff;
    --fg: #1f2328;
    --muted: #59636e;
    --border: #d1d9e0;
    --sidebar-bg: #f6f8fa;
    --accent: #0969da;
    --current-bg: #ddf4ff;
    --code-bg: #eff2f5;
    --sidebar-width: 15rem;
    --status-implemented-fg: #1a7f37;
    --status-implemented-bg: #dafbe1;
    --status-implemented-border: #4ac26b;
    --status-mostly-done-fg: #0f6b60;
    --status-mostly-done-bg: #d8f3ee;
    --status-mostly-done-border: #3fb5a0;
    --status-partial-fg: #8a5a00;
    --status-partial-bg: #fff8c5;
    --status-partial-border: #d4a72c;
    --status-designed-fg: #4b6584;
    --status-designed-bg: #eef3f8;
    --status-designed-border: #8ca3ba;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d1117;
        --fg: #e6edf3;
        --muted: #9198a1;
        --border: #3d444d;
        --sidebar-bg: #151b23;
        --accent: #4493f8;
        --current-bg: #1f3a5f;
        --code-bg: #1e252e;
        --status-implemented-fg: #56d364;
        --status-implemented-bg: #12261e;
        --status-implemented-border: #2ea043;
        --status-mostly-done-fg: #4fd1b8;
        --status-mostly-done-bg: #10282a;
        --status-mostly-done-border: #1f8a78;
        --status-partial-fg: #e3b341;
        --status-partial-bg: #2b2111;
        --status-partial-border: #9e6a03;
        --status-designed-fg: #a5b8cc;
        --status-designed-bg: #1a222c;
        --status-designed-border: #5f7a94;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    display: flex;
    min-height: 100vh;
    background: var(--bg);
    color: var(--fg);
    font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

/* --- sidebar --------------------------------------------------------------- */

.sidebar {
    position: sticky;
    top: 0;
    flex: 0 0 var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
    padding: 1.5rem 1rem;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
}

.sidebar .brand {
    display: block;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--fg);
    text-decoration: none;
}

.sidebar ul { list-style: none; margin: 0; padding: 0; }

.sidebar li a {
    display: block;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
}

.sidebar li a:hover { color: var(--fg); background: var(--current-bg); }

.sidebar li a.current {
    color: var(--accent);
    background: var(--current-bg);
    font-weight: 600;
}

/* --- content --------------------------------------------------------------- */

.content {
    flex: 1;
    min-width: 0;
    max-width: 52rem;
    padding: 2rem 2.5rem 4rem;
}

.content a { color: var(--accent); }

.content h1, .content h2, .content h3, .content h4 { line-height: 1.25; margin: 1.6em 0 0.6em; }
.content h1 { margin-top: 0; font-size: 2rem; }
.content h1, .content h2 { padding-bottom: 0.3em; border-bottom: 1px solid var(--border); }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.875em; }

code { padding: 0.15em 0.35em; border-radius: 4px; background: var(--code-bg); }

pre {
    overflow-x: auto;
    padding: 1rem;
    border-radius: 6px;
    background: var(--code-bg);
    line-height: 1.45;
}

pre code { padding: 0; background: none; font-size: 1em; }

blockquote {
    margin: 1em 0;
    padding: 0 1em;
    color: var(--muted);
    border-left: 0.25em solid var(--border);
}

table { display: block; overflow-x: auto; border-collapse: collapse; margin: 1em 0; }
th, td { padding: 0.4em 0.8em; border: 1px solid var(--border); text-align: left; }
th { background: var(--sidebar-bg); }

hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

/* --- status badges: [IMPLEMENTED], [MOSTLY-DONE], [PARTIAL], [DESIGNED-NOT-IMPLEMENTED] ----- */

.content a.status {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.05em 0.55em;
    border: 1px solid;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    vertical-align: middle;
    text-decoration: none;
}

.content a.status:hover { text-decoration: underline; }

.status-icon { flex: none; width: 1.1em; height: 1.1em; }

.content a.status-implemented {
    color: var(--status-implemented-fg);
    background: var(--status-implemented-bg);
    border-color: var(--status-implemented-border);
}

.content a.status-mostly-done {
    color: var(--status-mostly-done-fg);
    background: var(--status-mostly-done-bg);
    border-color: var(--status-mostly-done-border);
}

.content a.status-partial {
    color: var(--status-partial-fg);
    background: var(--status-partial-bg);
    border-color: var(--status-partial-border);
}

.content a.status-designed {
    color: var(--status-designed-fg);
    background: var(--status-designed-bg);
    border-color: var(--status-designed-border);
    border-style: dashed;
}

/* --- narrow screens: menu stacks above the content --------------------------- */

@media (max-width: 48rem) {
    body { flex-direction: column; }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .sidebar ul { display: flex; flex-wrap: wrap; gap: 0.25rem; }

    .content { padding: 1.25rem 1rem 3rem; }
}
