/* ═══════════════════════════════════════════════════════════
   Chreos Help Centre — Documentation Theme
   ═══════════════════════════════════════════════════════════ */

:root {
    --docs-brand:       #4f6ef7;
    --docs-brand-light: #e8ecfe;
    --docs-bg:          #f8f9fb;
    --docs-surface:     #ffffff;
    --docs-border:      #e5e7eb;
    --docs-text:        #1f2937;
    --docs-text-muted:  #6b7280;
    --docs-sidebar-w:   280px;
    --docs-header-h:    56px;
    --docs-content-max: 780px;
    --docs-font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --docs-mono:        'SF Mono', 'Fira Code', 'JetBrains Mono', Consolas, monospace;
    --docs-radius:      6px;
    --docs-shadow:      0 1px 3px rgba(0,0,0,0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

body {
    font-family: var(--docs-font);
    color: var(--docs-text);
    background: var(--docs-bg);
    line-height: 1.7;
}

a { color: var(--docs-brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ──────────────────────────────────────────────── */

.docs-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--docs-header-h);
    background: var(--docs-surface);
    border-bottom: 1px solid var(--docs-border);
    z-index: 100;
}

.docs-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.docs-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    flex-shrink: 0;
}

.docs-brand-icon {
    width: 32px; height: 32px;
    border-radius: var(--docs-radius);
    object-fit: contain;
}

.docs-brand-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--docs-text);
}

.docs-search {
    flex: 1;
    max-width: 400px;
}

.docs-search input {
    width: 100%;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius);
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--docs-text);
    background: var(--docs-bg);
    transition: border-color 0.2s;
}

.docs-search input:focus {
    outline: none;
    border-color: var(--docs-brand);
    background: var(--docs-surface);
}

.docs-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--docs-text-muted);
}

.docs-menu-toggle svg { width: 24px; height: 24px; }

/* ── Layout ──────────────────────────────────────────────── */

.docs-layout {
    display: flex;
    max-width: 1400px;
    margin: var(--docs-header-h) auto 0;
    min-height: calc(100vh - var(--docs-header-h));
}

/* ── Sidebar ─────────────────────────────────────────────── */

.docs-sidebar {
    width: var(--docs-sidebar-w);
    flex-shrink: 0;
    padding: 1.5rem 1rem;
    border-right: 1px solid var(--docs-border);
    background: var(--docs-surface);
    position: sticky;
    top: var(--docs-header-h);
    height: calc(100vh - var(--docs-header-h));
    overflow-y: auto;
}

.docs-nav-section { margin-bottom: 1.25rem; }

.docs-nav-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--docs-text-muted);
    padding: 0.25rem 0.75rem;
    margin-bottom: 0.25rem;
}

.docs-nav-item {
    display: block;
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    color: var(--docs-text-muted);
    border-radius: var(--docs-radius);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.docs-nav-item:hover {
    background: var(--docs-bg);
    color: var(--docs-text);
    text-decoration: none;
}

.docs-nav-item.active {
    background: var(--docs-brand-light);
    color: var(--docs-brand);
    font-weight: 500;
}

/* ── Content ─────────────────────────────────────────────── */

.docs-content {
    flex: 1;
    min-width: 0;
    padding: 2rem 3rem;
}

.docs-article {
    max-width: var(--docs-content-max);
}

.docs-article h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
    border-bottom: 2px solid var(--docs-border);
    padding-bottom: 0.75rem;
}

.docs-article h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}

.docs-article h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.docs-article h4, .docs-article h5, .docs-article h6 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.docs-article p {
    margin-bottom: 1rem;
}

.docs-article ul, .docs-article ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.docs-article li {
    margin-bottom: 0.35rem;
}

.docs-article code {
    background: var(--docs-bg);
    padding: 0.15em 0.35em;
    border-radius: 3px;
    font-family: var(--docs-mono);
    font-size: 0.85em;
}

.docs-article pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: var(--docs-radius);
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.docs-article pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.docs-article blockquote {
    border-left: 3px solid var(--docs-brand);
    padding: 0.75rem 1rem;
    background: var(--docs-brand-light);
    border-radius: 0 var(--docs-radius) var(--docs-radius) 0;
    margin-bottom: 1rem;
    color: var(--docs-text);
}

.docs-article table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.docs-article th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    border-bottom: 2px solid var(--docs-border);
    font-size: 0.8rem;
}

.docs-article td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--docs-border);
}

.docs-article img {
    max-width: 100%;
    border-radius: var(--docs-radius);
    box-shadow: var(--docs-shadow);
}

.docs-article hr {
    border: none;
    border-top: 1px solid var(--docs-border);
    margin: 2rem 0;
}

/* ── Search results ──────────────────────────────────────── */

.docs-search-results {
    position: fixed;
    top: var(--docs-header-h);
    left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 90;
}

.docs-search-results-inner {
    max-width: 600px;
    margin: 2rem auto;
    background: var(--docs-surface);
    border-radius: var(--docs-radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem;
}

.docs-search-result {
    display: block;
    padding: 0.75rem;
    border-radius: var(--docs-radius);
    text-decoration: none;
    transition: background 0.15s;
}

.docs-search-result:hover {
    background: var(--docs-bg);
    text-decoration: none;
}

.docs-search-result-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--docs-text);
}

.docs-search-result-excerpt {
    font-size: 0.8rem;
    color: var(--docs-text-muted);
    margin-top: 0.125rem;
}

.docs-search-empty {
    padding: 2rem;
    text-align: center;
    color: var(--docs-text-muted);
}

/* ── 404 ─────────────────────────────────────────────────── */

.docs-not-found {
    text-align: center;
    padding: 4rem 2rem;
}

.docs-not-found h1 {
    border: none;
    color: var(--docs-text-muted);
}

/* ── Footer ─────────────────────────────────────────────── */

.docs-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    font-size: 0.75rem;
    color: var(--docs-text-muted);
    border-top: 1px solid var(--docs-border);
    background: var(--docs-surface);
}

.docs-footer a { color: var(--docs-text-muted); text-decoration: none; }
.docs-footer a:hover { color: var(--docs-brand); }

.docs-footer-links {
    display: flex;
    gap: 1rem;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
    .docs-sidebar {
        position: fixed;
        left: 0; top: var(--docs-header-h); bottom: 0;
        z-index: 80;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        border-right: 1px solid var(--docs-border);
    }

    .docs-sidebar.open {
        transform: translateX(0);
    }

    .docs-menu-toggle { display: block; }

    .docs-content {
        padding: 1.5rem 1rem;
    }

    .docs-search {
        max-width: none;
        flex: 1;
    }

    .docs-brand-text { display: none; }

    .docs-footer {
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
        padding: 0.75rem 1rem;
    }
}
