/* Shared styles for the Blender HAL DAT Model Addon docs site */
:root {
    /* Dark theme (default) */
    --bg: #0d1117;
    --fg: #e6edf3;
    --muted: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --border: #30363d;
    --code-bg: #161b22;
    --surface: #161b22;
    --max-width: 860px;
}

:root[data-theme="light"] {
    --bg: #fafafa;
    --fg: #1f2328;
    --muted: #57606a;
    --accent: #0969da;
    --accent-hover: #0550ae;
    --border: #d0d7de;
    --code-bg: #f6f8fa;
    --surface: #ffffff;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--fg);
    background: var(--bg);
    margin: 0;
    padding: 0;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

header.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg);
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    margin-left: 1.25rem;
    transition: border-color 0.15s, color 0.15s;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.theme-toggle .icon-light { display: none; }
.theme-toggle .icon-dark { display: inline; }
:root[data-theme="light"] .theme-toggle .icon-light { display: inline; }
:root[data-theme="light"] .theme-toggle .icon-dark { display: none; }

header.site-header .container {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-title {
    font-size: 1.15rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--fg);
}

nav.site-nav a {
    margin-left: 1.25rem;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.95rem;
}

nav.site-nav a:hover { color: var(--accent); }

h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 2rem; margin-top: 1rem; }
h2 { font-size: 1.4rem; margin-top: 2.25rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
h3 { font-size: 1.1rem; margin-top: 1.75rem; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

code {
    background: var(--code-bg);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

pre {
    background: var(--code-bg);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.9em;
}

pre code { background: transparent; padding: 0; }

table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
    font-size: 0.95rem;
}

th, td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

th { background: var(--code-bg); font-weight: 600; }

.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, transform 0.15s;
}

.card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.card h3 { margin-top: 0; color: var(--accent); }
.card p { margin-bottom: 0; color: var(--muted); }

.toc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0 2rem;
}

.toc h2 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    border: none;
    padding: 0;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toc ol {
    margin: 0;
    padding-left: 1.25rem;
}

.toc li { margin: 0.2rem 0; }

figure.screenshot {
    margin: 1.25rem 0;
    text-align: center;
}

figure.screenshot img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
}

figure.screenshot figcaption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--muted);
    font-style: italic;
}

.callout {
    border-left: 3px solid var(--accent);
    background: var(--surface);
    padding: 0.75rem 1rem;
    border-radius: 0 6px 6px 0;
    margin: 1rem 0;
}

.callout strong { color: var(--accent); }

kbd {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85em;
    color: var(--fg);
    white-space: nowrap;
}

.support-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8em;
    font-weight: 600;
}
.support-badge.yes { background: rgba(63, 185, 80, 0.15); color: #56d364; }
.support-badge.partial { background: rgba(210, 153, 34, 0.15); color: #e3b341; }
.support-badge.no { background: rgba(248, 81, 73, 0.15); color: #f85149; }
:root[data-theme="light"] .support-badge.yes { background: #dcfce7; color: #166534; }
:root[data-theme="light"] .support-badge.partial { background: #fef3c7; color: #854d0e; }
:root[data-theme="light"] .support-badge.no { background: #fee2e2; color: #991b1b; }

.stub-note {
    color: var(--muted);
    font-style: italic;
    border-left: 3px solid var(--border);
    padding: 0.25rem 0 0.25rem 0.75rem;
    margin: 0.75rem 0;
}

footer.site-footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 1.5rem 1rem;
}

@media (max-width: 600px) {
    .card-grid { grid-template-columns: 1fr; }
    header.site-header .container { flex-direction: column; align-items: flex-start; }
    nav.site-nav a { margin-left: 0; margin-right: 1rem; }
}
