/* Docs layout — sidebar + content */
.site-layout {
    display: flex;
    min-height: calc(100vh - var(--navbar-h) - 64px);
    margin-top: var(--navbar-h);
}

/* Sidebar */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    background: var(--bg-secondary);
    position: sticky;
    top: var(--navbar-h);
    height: calc(100vh - var(--navbar-h));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.sidebar-inner { padding: 1.5rem 1rem; }
.sidebar-section { margin-bottom: 1.5rem; }
.sidebar-group-title {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--primary);
    margin-bottom: .5rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid var(--primary);
}
.sidebar-list { list-style: none; }
.sidebar-list li { margin: 0; }
.sidebar-list a {
    display: block;
    padding: .35rem .6rem;
    font-size: .875rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.sidebar-list a:hover, .sidebar-list a.active {
    color: var(--primary);
    background: rgba(37,99,235,.07);
}

/* Main content area */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 2.5rem 3rem;
    max-width: 900px;
}

/* Doc article */
.doc-article { max-width: 800px; }
.doc-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.doc-title {
    font-size: var(--font-size-3xl);
    color: var(--text);
    margin-bottom: .5rem;
    font-family: var(--font-family-display);
    font-weight: var(--font-weight-regular);
    letter-spacing: var(--letter-spacing-tight);
}
.doc-date { font-size: .85rem; color: var(--text-muted); }

/* Rendered markdown content */
.doc-body h1 { font-size: 1.875rem; margin: 2.5rem 0 1rem; padding-top: .5rem; }
.doc-body h2 { font-size: 1.5rem; margin: 2rem 0 .75rem; border-bottom: 1px solid var(--border); padding-bottom: .5rem; }
.doc-body h3 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
.doc-body h4 { font-size: 1.05rem; margin: 1.25rem 0 .5rem; }
.doc-body p { color: var(--text-secondary); line-height: 1.75; margin-bottom: 1rem; }
.doc-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.doc-body a:hover { color: var(--primary-dark); }
.doc-body ul, .doc-body ol { margin: 0 0 1rem 1.5rem; color: var(--text-secondary); }
.doc-body li { margin-bottom: .35rem; line-height: 1.65; }
.doc-body blockquote {
    border-left: 4px solid var(--primary);
    padding: .75rem 1.25rem;
    background: rgba(37,99,235,.05);
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1.25rem 0;
    color: var(--text-secondary);
}
.doc-body code {
    font-family: var(--font-family-mono);
    font-size: .85em;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    padding: .15em .4em;
    border-radius: var(--radius-sm);
    color: var(--text);
}
.doc-body pre {
    background: var(--code-bg);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 1.25rem 0;
    box-shadow: var(--shadow-md);
    position: relative;
}
.doc-body pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: .875rem;
    color: var(--code-text);
    line-height: 1.6;
}
.doc-body table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: .9rem; }
.doc-body th {
    background: var(--bg-tertiary);
    font-weight: 600;
    text-align: left;
    padding: .6rem .9rem;
    border: 1px solid var(--border);
}
.doc-body td { padding: .6rem .9rem; border: 1px solid var(--border); color: var(--text-secondary); }
.doc-body tr:nth-child(even) td { background: var(--bg-secondary); }
.doc-body hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.doc-body img { max-width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow-md); margin: 1rem 0; }

/* Copy button on code blocks */
.copy-btn {
    position: absolute;
    top: .6rem;
    right: .75rem;
    padding: .25rem .6rem;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: var(--radius-sm);
    color: var(--code-text);
    font-size: .75rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.copy-btn:hover { background: rgba(255,255,255,.2); }

/* Doc footer */
.doc-footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* Doc index (homepage) */
.doc-index { max-width: 860px; }
.doc-index-hero {
    padding: 2.5rem 0 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2.5rem;
}
.doc-index-hero h1 { font-size: 2.5rem; margin-bottom: .75rem; }
.doc-index-lead { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 1.5rem; max-width: 640px; }
.doc-index-badges { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.doc-index-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.doc-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 3rem;
}
.doc-card {
    display: block;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    color: inherit;
    text-decoration: none;
}
.doc-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: inherit;
}
.doc-card-icon { font-size: 1.75rem; margin-bottom: .5rem; }
.doc-card h3 { font-size: 1rem; margin-bottom: .35rem; color: var(--text); }
.doc-card p { font-size: .85rem; color: var(--text-secondary); margin: 0; line-height: 1.5; }

.doc-all-pages h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.doc-page-list { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; }
.doc-page-list li a {
    display: block;
    padding: .5rem .75rem;
    font-size: .9rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.doc-page-list li a:hover { color: var(--primary); border-color: var(--primary); }
.doc-page-excerpt { display: block; font-size: .8rem; color: var(--text-muted); margin-top: .15rem; }

/* Responsive */
@media (max-width: 1024px) {
    .doc-cards-grid { grid-template-columns: repeat(2, 1fr); }
    .main-content { padding: 2rem 1.5rem; }
}
@media (max-width: 768px) {
    .site-layout { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .main-content { padding: 1.5rem 1rem; }
    .doc-title { font-size: 1.75rem; }
    .doc-cards-grid { grid-template-columns: 1fr; }
    .doc-page-list { grid-template-columns: 1fr; }
    .doc-index-actions { flex-direction: column; }
    .btn { width: 100%; text-align: center; }
}

/* Blog listing — Tradik Design System cards (tokens from tradik-tokens.css) */
.post-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-4); }
.post-card {
    display: block;
    padding: var(--space-6);
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    color: inherit;
    text-decoration: none;
    transition: border-color var(--motion-duration-base) var(--motion-easing-standard),
                transform var(--motion-duration-base) var(--motion-easing-standard),
                box-shadow var(--motion-duration-base) var(--motion-easing-standard);
}
.post-card:hover {
    border-color: var(--color-border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: inherit;
}
.post-card:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--color-border-focus); }
.post-card-date {
    display: block;
    font-family: var(--font-family-mono);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-caps);
    color: var(--color-fg-muted);
    margin-bottom: var(--space-2);
}
.post-card-title {
    font-family: var(--font-family-display);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-2xl);
    line-height: var(--line-height-snug);
    color: var(--color-fg-primary);
    margin: 0 0 var(--space-2);
}
.post-card:hover .post-card-title { color: var(--color-fg-accent); }
.post-card-excerpt {
    color: var(--color-fg-secondary);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
    margin: 0 0 var(--space-3);
}
.post-card-more {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-fg-link);
}
