/* =================================================================
   knowledgespaces — documentation theme
   Monochrome palette to match the landing page.
   Built on Furo.
   ================================================================= */

/* --- Typography --- */

body {
    --font-stack: ui-sans-serif, system-ui, -apple-system, sans-serif;
    --font-stack--monospace: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* --- Color palette (light) --- */

body {
    --color-brand-primary: #555;
    --color-brand-content: #444;
    --color-background-primary: #fafafa;
    --color-background-secondary: #f2f2f2;
    --color-background-border: #e0e0e0;
}

/* --- Color palette (dark) --- */

body[data-theme="dark"] {
    --color-brand-primary: #a0a0a0;
    --color-brand-content: #a0a0a0;
    --color-background-primary: #0c0c0c;
    --color-background-secondary: #141414;
    --color-background-border: #222;
}

@media (prefers-color-scheme: dark) {
    body:not([data-theme="light"]) {
        --color-brand-primary: #a0a0a0;
        --color-brand-content: #a0a0a0;
        --color-background-primary: #0c0c0c;
        --color-background-secondary: #141414;
        --color-background-border: #222;
    }
}

/* --- Content width --- */

.page-content {
    max-width: 52rem;
}

/* --- Headings --- */

h1 {
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
}

h2 {
    font-weight: 600;
    letter-spacing: -0.015em;
    margin-top: 2.5rem;
    padding-bottom: 0.4em;
    border-bottom: 1px solid var(--color-background-border);
}

h3 {
    font-weight: 600;
}

/* --- Code blocks --- */

.highlight pre,
pre.literal-block {
    border-radius: 8px;
    border: 1px solid var(--color-background-border);
    font-size: 0.875em;
    line-height: 1.6;
}

/* --- Inline code --- */

code.literal {
    border-radius: 4px;
    font-size: 0.875em;
    padding: 2px 6px;
    background: var(--color-background-secondary);
    border: 1px solid var(--color-background-border);
}

/* --- Admonitions --- */

.admonition {
    border-radius: 8px;
    border: 1px solid var(--color-background-border);
    border-left: 3px solid var(--color-brand-primary);
    box-shadow: none;
}

.admonition > .admonition-title {
    font-weight: 600;
}

/* --- Tables --- */

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.9em;
}

table th {
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid var(--color-background-border);
    padding: 0.6em 1em;
}

table td {
    border-bottom: 1px solid var(--color-background-border);
    padding: 0.6em 1em;
}

/* --- Grid cards (sphinx-design) --- */

.sd-card {
    border-radius: 8px;
    border: 1px solid var(--color-background-border);
    box-shadow: none;
    transition: border-color 0.2s ease;
}

.sd-card:hover {
    border-color: var(--color-brand-primary);
}

.sd-card .sd-card-header {
    font-weight: 600;
}

/* --- Math blocks --- */

div.math {
    padding: 1em 1.5em;
    background: var(--color-background-secondary);
    border-radius: 8px;
    border: 1px solid var(--color-background-border);
    margin: 1.5em 0;
    overflow-x: auto;
}

/* --- Sidebar / TOC --- */

.sidebar-tree .current > .reference {
    font-weight: 600;
}

/* --- Footer --- */

.bottom-of-page {
    font-size: 0.85em;
    opacity: 0.7;
}

/* --- Links --- */

a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- API reference classes --- */

dl.py.class > dt,
dl.py.function > dt,
dl.py.method > dt {
    background: var(--color-background-secondary);
    border: 1px solid var(--color-background-border);
    border-radius: 6px;
    padding: 0.5em 0.8em;
    font-size: 0.9em;
}
