/* doc.css - Minimalist & Adapted Theme for B-System Specification */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --doc-bg: #f8fafc;
    --doc-text: #0f172a;
    --doc-muted: #475569;
    --doc-accent: #1e3a8a;
    --doc-link: #2563eb;
    --doc-header-bg: linear-gradient(90deg, #1e3a8a, #3b82f6);
    --doc-header-text: #ffffff;
    --doc-border: rgba(30, 58, 138, 0.15);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--doc-bg);
    color: var(--doc-text);
    line-height: 1.65;
    font-size: 1.02rem;
    margin: 0 auto;
    padding: 1.2rem clamp(1rem, 4vw, 2.5rem);
    max-width: 980px;
    word-wrap: break-word;
    overflow-x: hidden;
}

/* FULL-WIDTH BREAKOUT FOR DOCUMENTATION HEADER & FOOTER */
div[style*="background:#0057b7"],
div[style*="background: #0057b7"],
.doc-header-banner,
footer,
footer.doc-footer {
    width: 100vw !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
}

/* DOCUMENTATION HEADER BANNER */
div[style*="background:#0057b7"],
div[style*="background: #0057b7"],
.doc-header-banner {
    background: var(--doc-header-bg) !important;
    color: var(--doc-header-text) !important;
    padding: 14px clamp(1.2rem, 3vw, 3rem) !important;
    font-weight: 600 !important;
    border-radius: 0 !important;
    margin-top: -1.2rem !important;
    margin-bottom: 1.8rem !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05) !important;
    font-size: 1.05rem;
    line-height: 1.5;
}

/* DOCUMENTATION CONTENT STYLING */
h1 {
    font-size: clamp(1.8rem, 5vw, 2.4rem);
    font-weight: 700;
    color: var(--doc-accent);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.25;
}

h2 {
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    font-weight: 700;
    color: var(--doc-accent);
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
    border-bottom: 2px solid var(--doc-border);
    padding-bottom: 0.4rem;
}

h3 {
    font-size: clamp(1.15rem, 3.5vw, 1.35rem);
    font-weight: 600;
    color: var(--doc-accent);
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--doc-accent);
    margin-top: 1rem;
}

a {
    color: var(--doc-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: underline;
    opacity: 0.85;
}

hr {
    border: none;
    border-top: 1px solid var(--doc-border);
    margin: 1.8rem 0;
}

pre, code {
    font-family: ui-monospace, 'Cascadia Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.92rem;
}

pre {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--doc-border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    max-width: 100%;
}

code {
    background: rgba(0, 0, 0, 0.03);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--doc-accent);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    display: block;
    overflow-x: auto;
}

th, td {
    border: 1px solid var(--doc-border);
    padding: 0.6rem 0.9rem;
    text-align: left;
}

th {
    background: rgba(0, 0, 0, 0.04);
    color: var(--doc-accent);
    font-weight: 600;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* TOC LISTS STYLING */
.toc-container, dl {
    margin: 1.5rem 0;
}

.toc-container dt, dt {
    font-weight: 600;
    margin-top: 1.2rem;
    margin-bottom: 0.4rem;
}

.toc-container dt h3 {
    margin-top: 0.8rem;
    margin-bottom: 0.3rem;
}

.toc-sublist, dd ul {
    list-style: none;
    padding-left: 1.2rem;
    margin: 0.4rem 0 1.2rem 0;
}

.toc-sublist li, dd li {
    margin: 0.45rem 0;
    line-height: 1.5;
}

.toc-sublist li a, dd li a {
    color: var(--doc-text);
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
    display: inline-block;
}

.toc-sublist li a:hover, dd li a:hover {
    color: var(--doc-accent);
    padding-left: 0.25rem;
}

dd {
    margin-left: 0;
    margin-bottom: 1rem;
}

/* FOOTER */
footer,
footer.doc-footer {
    background: rgba(0, 0, 0, 0.01);
    border-top: 1px solid var(--doc-border);
    padding: 1.8rem clamp(1.2rem, 3vw, 3rem);
    margin-top: 4rem;
    margin-bottom: -1.2rem;
}

.doc-footer-container {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.95rem;
    color: var(--doc-muted);
}

.doc-footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.doc-footer-links a {
    color: var(--doc-muted);
    font-weight: 500;
}

.doc-footer-links a:hover {
    color: var(--doc-accent);
}

@media (max-width: 768px) {
    body {
        padding: 0.8rem;
        font-size: 0.98rem;
    }
    div[style*="background:#0057b7"],
    div[style*="background: #0057b7"],
    .doc-header-banner {
        padding: 12px 1.2rem !important;
        font-size: 0.95rem;
        margin-top: -0.8rem !important;
    }
    footer, footer.doc-footer {
        margin-bottom: -0.8rem;
    }
    .doc-footer-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    dd {
        margin-left: 0;
    }
}
