/* The docs site's stylesheet: light and dark from the reader's preference, readable at phone width.
   Decision: docs/adr/0072-the-docs-site-builds-from-docs-and-serves-the-released-schemas.md.
   Plan: docs/plans/pending/0004-wave-4-reach.md, Step 3. */

:root {
    --bg: #ffffff;
    --fg: #1f2328;
    --muted: #59636e;
    --line: #d1d9e0;
    --panel: #f6f8fa;
    --link: #0757c2;
    --accent: #1a7f37;
    --danger: #cf222e;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d1117;
        --fg: #e6edf3;
        --muted: #9198a1;
        --line: #3d444d;
        --panel: #151b23;
        --link: #4493f8;
        --accent: #3fb950;
        --danger: #f85149;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font:
        16px/1.6 system-ui,
        -apple-system,
        'Segoe UI',
        sans-serif;
}

a {
    color: var(--link);
}

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

pre {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
    margin: 1em 0;
}

th,
td {
    border: 1px solid var(--line);
    padding: 6px 10px;
    vertical-align: top;
}

.masthead {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: baseline;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}

.masthead .brand {
    font-weight: 700;
    font-size: 1.15em;
    color: var(--fg);
    text-decoration: none;
    margin-right: auto;
}

.frame {
    display: flex;
    gap: 32px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

.sidebar {
    flex: 0 0 260px;
    padding-top: 16px;
    font-size: 0.9em;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    position: sticky;
    top: 0;
}

.sidebar summary {
    font-weight: 600;
    cursor: pointer;
    margin: 8px 0 4px;
}

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

.sidebar a[aria-current='page'] {
    font-weight: 700;
    color: var(--fg);
}

main {
    flex: 1 1 auto;
    min-width: 0;
    padding-bottom: 48px;
}

.local-only {
    border-bottom: 1px dotted var(--muted);
}

.diagram figcaption,
.footer {
    color: var(--muted);
    font-size: 0.9em;
}

/* The cookbook's question pages (plan 0004, Step 5): the fixture's files under their names, and
   the violations the fixture's repository produces. */
.cookbook-file {
    margin: 1em 0;
}

.cookbook-file figcaption {
    color: var(--muted);
    font-size: 0.9em;
    margin-bottom: 4px;
}

.cookbook-file pre {
    margin: 0;
    max-height: 32em;
}

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

.footer {
    border-top: 1px solid var(--line);
    padding: 16px;
    text-align: center;
}

.playground {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    margin: 1.5em 0;
}

.playground-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.playground label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-weight: 600;
}

.playground textarea {
    width: 100%;
    background: var(--panel);
    color: var(--fg);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px;
    font-weight: 400;
}

.playground-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin: 12px 0;
}

.playground-controls label {
    flex-direction: row;
    align-items: center;
}

.playground button {
    background: var(--accent);
    color: #ffffff;
    border: 0;
    border-radius: 6px;
    padding: 6px 16px;
    font-weight: 600;
    cursor: pointer;
}

.playground button:disabled {
    opacity: 0.5;
    cursor: default;
}

.playground[data-state='error'] [data-status] {
    color: var(--danger);
}

.playground-output {
    min-height: 4em;
    max-height: 32em;
}

.playground [hidden] {
    display: none;
}

.playground input[type='text'],
.playground select {
    background: var(--panel);
    color: var(--fg);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 4px 8px;
    font-weight: 400;
}

.playground-files {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.playground-files input[type='file'] {
    font-weight: 400;
}

.playground-drop {
    border: 2px dashed var(--line);
    border-radius: 8px;
    padding: 24px 16px;
    text-align: center;
    color: var(--muted);
}

.playground-drop.playground-drop-over {
    border-color: var(--accent);
    color: var(--fg);
}

.playground [data-files-note] {
    margin: 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.playground-examples button {
    margin: 4px 8px 4px 0;
}

@media (max-width: 800px) {
    .frame {
        flex-direction: column;
        gap: 0;
    }

    .sidebar {
        position: static;
        max-height: none;
        flex-basis: auto;
    }

    .playground-inputs {
        grid-template-columns: 1fr;
    }
}

/* The live coverage tables (plan 0004, Step 4; ADR-0075). */
.unproven {
    color: var(--danger);
}

.proven {
    color: var(--accent);
}

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

.evidence {
    margin: 0;
    padding-left: 1.1em;
    font-size: 0.9em;
}

.evidence-rulebearing {
    list-style-type: circle;
}

.coverage-counts {
    font-weight: 600;
}
