/* The docs: a side menu of sections and pages, and a page of prose beside it. */

.docs-shell {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    width: min(1200px, calc(100% - 2rem));
    margin: 1.5rem auto 3rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-dark);
}

.docs-nav {
    position: sticky;
    top: 1rem;
    flex: 0 0 230px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--white);
}

.docs-nav a {
    display: block;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.92rem;
}

.docs-nav a:hover {
    background: #f3f4ff;
}

.docs-nav a.current {
    background: #eef0ff;
    color: #3a3a88;
    font-weight: 600;
}

.docs-nav .docs-back {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    color: var(--text-light);
    font-size: 0.88rem;
}

.docs-home {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.docs-nav-section h2 {
    margin: 1rem 0 0.3rem 0.6rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
}

.docs-nav-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.docs-page {
    flex: 1;
    min-width: 0;
    padding: 2rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--white);
    line-height: 1.65;
}

.docs-crumb {
    margin: 0 0 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--blue-dark);
}

.docs-toc {
    margin: 0 0 1.5rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--blue-light);
    background: var(--bg-light);
    border-radius: 0 8px 8px 0;
}

.docs-toc h2 {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
}

.docs-toc ul {
    margin: 0;
    padding-left: 1.1rem;
    columns: 2 220px;
    font-size: 0.92rem;
}

.docs-toc a,
.docs-body a {
    color: #4b4bc4;
}

.docs-body h1 {
    margin: 0 0 1rem;
    font-size: 2rem;
    line-height: 1.2;
}

.docs-body h2 {
    margin: 2.25rem 0 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 1.35rem;
}

.docs-body h3 {
    margin: 1.75rem 0 0.5rem;
    font-size: 1.08rem;
}

.docs-body code {
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: #f3f4f6;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em;
    overflow-wrap: anywhere;
}

.docs-body h2 code,
.docs-body h3 code {
    font-size: 0.92em;
}

.docs-body pre {
    padding: 0.9rem 1rem;
    overflow-x: auto;
    border-radius: 8px;
    background: #1f2937;
    color: #f3f4f6;
    line-height: 1.5;
}

.docs-body pre code {
    padding: 0;
    background: none;
    color: inherit;
    overflow-wrap: normal;
}

.docs-body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    margin: 1rem 0;
    border-collapse: collapse;
    font-size: 0.92rem;
}

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

.docs-body th {
    background: var(--bg-light);
}

.docs-body blockquote {
    margin: 1rem 0;
    padding: 0.6rem 1rem;
    border-left: 3px solid var(--primary-blue);
    background: #f5f5ff;
    border-radius: 0 8px 8px 0;
}

.docs-body blockquote p {
    margin: 0.3rem 0;
}

/* The docs home: one card per section. */
.docs-body .docs-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.docs-body .docs-cards a {
    display: block;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--blue-light);
    border-radius: 10px;
    color: var(--text-dark);
    text-decoration: none;
}

.docs-body .docs-cards a:hover {
    border-color: var(--primary-blue);
}

.docs-body .docs-cards strong {
    display: block;
    margin-bottom: 0.25rem;
}

.docs-body .docs-cards span {
    color: var(--text-light);
    font-size: 0.92rem;
}

.docs-generated {
    margin-top: 2.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.docs-pager {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.docs-pager a {
    color: #4b4bc4;
    font-weight: 600;
    text-decoration: none;
}

@media (max-width: 800px) {
    .docs-shell {
        flex-direction: column;
        align-items: stretch;
        width: calc(100% - 2rem);
    }

    .docs-nav {
        position: static;
        flex: none;
        max-height: none;
    }

    .docs-page {
        padding: 1.25rem 1rem;
    }
}

/* Names in tables stay whole; a wide table scrolls instead. */
.docs-body td code {
    overflow-wrap: normal;
    white-space: nowrap;
}
