/* ===================================
   Manual Page Styles
   =================================== */

.manual {
    padding-top: 80px;
    min-height: 100vh;
}

.manual .container {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 4rem;
    max-width: 1100px;
    padding-top: 2rem;
    padding-bottom: 4rem;
}

/* Sidebar */
.manual-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.manual-toc h4 {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.manual-toc ul {
    list-style: none;
}

.manual-toc > ul > li {
    margin-bottom: 0.5rem;
}

.manual-toc a {
    display: block;
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-left: 2px solid transparent;
    padding-left: 1rem;
    margin-left: -1rem;
    transition: all 0.2s ease;
}

.manual-toc a:hover {
    color: var(--text-primary);
}

.manual-toc a.active {
    color: var(--accent);
    border-left-color: var(--accent);
}

.manual-toc ul ul {
    margin-top: 0.25rem;
    margin-left: 1rem;
}

.manual-toc ul ul a {
    font-size: 0.85rem;
    padding: 0.375rem 0;
}

/* Content */
.manual-content {
    max-width: 720px;
}

.manual-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.manual-header h1 {
    margin-bottom: 0.5rem;
}

.manual-intro {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Sections */
.manual-content section {
    padding: 0;
    margin-bottom: 4rem;
}

.manual-content h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.manual-content section:first-of-type h2 {
    border-top: none;
    padding-top: 0;
}

.manual-content h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.manual-content h4 {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.manual-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.manual-content ul,
.manual-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.manual-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.manual-content li ul,
.manual-content li ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.manual-content code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg-tertiary);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    color: var(--accent);
}

.manual-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.manual-content a:hover {
    color: var(--accent-hover);
}

/* Figures */
.manual-figure {
    margin: 1.5rem 0 2rem;
    text-align: center;
}

.manual-figure img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
}

.manual-figure figcaption {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.manual-figure-row .figure-row {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.manual-figure-row .figure-item {
    flex: 1;
    min-width: 200px;
    max-width: 380px;
}

.manual-figure-row .figure-item img {
    width: 100%;
}

.manual-figure-row .figure-item figcaption {
    margin-top: 0.5rem;
}

/* Callouts */
.callout {
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.callout p {
    margin: 0;
}

.callout-info {
    border-left-color: #3B82F6;
}

.callout-security {
    border-left-color: var(--success);
}

.callout strong {
    color: var(--text-primary);
}

/* Troubleshooting items */
.trouble-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.trouble-item h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.trouble-item p {
    margin-bottom: 0;
}

.trouble-item p + p {
    margin-top: 0.75rem;
}

.trouble-item ul {
    margin-bottom: 0;
}

/* Footer */
.manual-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.manual-footer a {
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 900px) {
    .manual .container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .manual-sidebar {
        position: static;
        max-height: none;
        padding: 1rem;
        background: var(--bg-secondary);
        border-radius: 8px;
    }

    .manual-toc ul ul {
        display: none;
    }

    .manual-toc > ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .manual-toc > ul > li {
        margin: 0;
    }

    .manual-toc a {
        border-left: none;
        padding: 0.5rem 1rem;
        margin: 0;
        background: var(--bg-tertiary);
        border-radius: 6px;
    }

    .manual-toc a.active {
        background: var(--accent);
        color: var(--text-primary);
    }
}

@media (max-width: 480px) {
    .manual-header h1 {
        font-size: 2rem;
    }

    .manual-content h2 {
        font-size: 1.5rem;
    }

    .trouble-item {
        padding: 1rem;
    }
}
