/* doc-layout.css — Shared two-column layout for architecture + spec pages */

.doc-layout {
    max-width: 72rem;
    margin: 0 auto;
    padding: 3rem 1rem;
    display: flex;
    gap: 3rem;
}

.doc-sidebar {
    display: none;
    position: sticky;
    top: 5rem;
    width: 14rem;
    flex-shrink: 0;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    padding-right: 1rem;
}

@media (min-width: 1024px) {
    .doc-sidebar { display: block; }
}

.doc-toc-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.doc-toc {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 1px solid var(--border);
}

.toc-item,
.toc-item-l2 {
    display: block;
    padding: 0.25rem 0;
    margin-left: -1px;
    border-left: 1px solid transparent;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s, border-color 0.15s;
}

.toc-item { padding-left: 0.75rem; }
.toc-item-l2 { padding-left: 1.5rem; font-size: 0.8125rem; }

.toc-item:hover,
.toc-item-l2:hover {
    color: var(--text);
    border-left-color: var(--border);
}

.toc-item.active,
.toc-item-l2.active {
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 500;
}

.doc-content {
    min-width: 0;
    flex: 1;
    max-width: 48rem;
    overflow-x: hidden;
    overflow-wrap: break-word;
}

.spec-header { margin-bottom: 3rem; }

.doc-content h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    line-height: 1.2;
}

@media (min-width: 640px) {
    .doc-content h1 { font-size: 2.5rem; }
}

.spec-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
}

.doc-section {
    margin-bottom: 4rem;
    scroll-margin-top: 5rem;
}

.doc-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.doc-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    scroll-margin-top: 5rem;
}

.doc-section p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.doc-section code {
    font-family: "SF Mono", "Fira Code", Menlo, monospace;
    font-size: 0.875em;
    color: var(--accent);
    background: rgba(37, 99, 235, 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.code-block {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    margin: 1rem 0;
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.code-block-copy {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: color 0.15s;
}

.code-block-copy:hover { color: var(--text); }

.code-block pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
    background: var(--bg);
}

.code-block pre code {
    background: none;
    padding: 0;
    color: var(--text);
    font-size: inherit;
}

.diagram-container {
    margin: 1.5rem 0;
    overflow-x: auto;
}

.diagram-container svg {
    width: 100%;
    height: auto;
}

@media (max-width: 1023px) {
    .doc-layout { padding: 2rem 1rem; }
}
