/* ============================================
   LOGBOOK HERO
   ============================================ */

.docs-hero {
    padding: 140px 2rem 3rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.docs-eyebrow {
    color: var(--accent-light);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.docs-title {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.docs-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 640px;
    margin: 0 auto;
}

/* ============================================
   DOCS LAYOUT
   ============================================ */

.docs-layout {
    padding: 3rem 0 5rem;
}

.docs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    align-items: start;
}

/* ============================================
   NAVIGATION TREE
   ============================================ */

.docs-sidebar {
    position: sticky;
    top: 100px;
}

.docs-tree {
    background: rgba(37, 37, 37, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem;
}

.docs-tree-stage {
    margin-bottom: 0.25rem;
}

.docs-tree-stage:last-child {
    margin-bottom: 0;
}

.docs-tree-stage-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.6rem 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s ease;
    text-align: left;
}

.docs-tree-stage-toggle:hover {
    background: rgba(99, 102, 241, 0.12);
}

.docs-tree-caret {
    color: var(--accent);
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    display: inline-block;
}

.docs-tree-stage-toggle[aria-expanded="false"] .docs-tree-caret {
    transform: rotate(-90deg);
}

.docs-tree-entries {
    list-style: none;
    margin: 0.1rem 0 0.5rem 1.6rem;
    border-left: 1px solid var(--border-color);
    padding-left: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.25s ease;
}

.docs-tree-entries.collapsed {
    max-height: 0;
}

.docs-tree-entry {
    display: block;
    padding: 0.4rem 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.docs-tree-entry:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

.docs-tree-entry.active {
    color: var(--accent-light);
    background: rgba(99, 102, 241, 0.18);
    font-weight: 600;
}

/* ============================================
   ENTRY CONTENT
   ============================================ */

.docs-stage {
    margin-bottom: 3.5rem;
    scroll-margin-top: 100px;
}

.docs-stage:last-child {
    margin-bottom: 0;
}

.docs-stage-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

.docs-entry {
    background: rgba(37, 37, 37, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
    scroll-margin-top: 100px;
    transition: border-color 0.3s ease;
}

.docs-entry:last-child {
    margin-bottom: 0;
}

.docs-entry:target {
    border-color: var(--accent);
}

.docs-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}

.docs-entry-title {
    font-size: 1.15rem;
    color: var(--text-primary);
}

.docs-entry-date {
    font-size: 0.8rem;
    color: var(--accent-light);
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.docs-entry-body p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.98rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 900px) {
    .docs-container {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        position: static;
    }
}

@media (max-width: 480px) {
    .docs-hero {
        padding: 120px 1.5rem 2.5rem;
    }

    .docs-title {
        font-size: 2rem;
    }

    .docs-entry {
        padding: 1.25rem;
    }
}
