/* Docs Layout - Sidebar + Content */

.docs-layout {
    display: flex;
    gap: 2rem;
    padding: 1.5rem 0;
    min-height: calc(100vh - 200px);
}

/* Sidebar Navigation */
.docs-sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 70px; /* navbar height + gap */
    align-self: flex-start;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    padding-right: 1rem;
    border-right: 1px solid var(--border);

    /* Thin scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.docs-sidebar::-webkit-scrollbar {
    width: 4px;
}

.docs-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* Sidebar header */
.docs-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.docs-sidebar-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.docs-sidebar-title:hover {
    color: var(--primary);
    text-decoration: none;
}

/* Section headings in sidebar */
.docs-nav-section {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.docs-nav-section:first-child {
    margin-top: 0;
}

/* Navigation links */
.docs-nav-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem;
}

.docs-nav-list li {
    margin: 0;
}

.docs-nav-link {
    display: block;
    padding: 0.3rem 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    line-height: 1.4;
}

.docs-nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.docs-nav-link.active {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    font-weight: 500;
}

/* Content Area */
.docs-content {
    flex: 1;
    min-width: 0; /* prevent flex overflow */
    max-width: 800px;
}

/* Adjust first heading — no double border with sidebar */
.docs-content .markdown-content h1:first-child {
    margin-top: 0;
    padding-top: 0;
}

/* Mobile sidebar toggle */
.docs-sidebar-toggle {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.6rem 1rem;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
    margin-bottom: 1rem;
}

.docs-sidebar-toggle::after {
    content: '';
    float: right;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-muted);
    margin-top: 0.4rem;
}

.docs-sidebar-toggle.open::after {
    border-top: none;
    border-bottom: 5px solid var(--text-muted);
}

/* ========================================
   Responsive - Docs
   ======================================== */

@media (max-width: 900px) {
    .docs-layout {
        flex-direction: column;
        gap: 0;
    }

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

    .docs-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        overflow: visible;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-right: 0;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
        display: none;
    }

    .docs-sidebar.open {
        display: block;
    }

    .docs-content {
        max-width: 100%;
    }
}

/* ========================================
   Blog - List & Article
   ======================================== */

.blog-list {
    max-width: 800px;
    padding: 1.5rem 0;
}

.blog-list h1 {
    margin-bottom: 2rem;
}

.blog-list-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.blog-list-item:last-child {
    border-bottom: none;
}

.blog-list-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    display: block;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.blog-list-title:hover {
    color: var(--primary);
    text-decoration: none;
}

.blog-list-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.5rem;
}

.blog-list-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.blog-article {
    max-width: 100%;
    padding: 1.5rem 0;
}

.blog-article .markdown-content {
    max-width: 100%;
}

.markdown-content video {
    width: 70%;
    max-width: 70%;
    height: auto !important;
    border-radius: 8px;
    margin: 1.5rem auto;
    display: block;
}

.blog-article .markdown-content h1:first-child {
    margin-top: 0;
    padding-top: 0;
}
