/*
 * ShadowTag Help — sidebar layout
 *
 * Layered on top of web.css. Defines the two-column help layout
 * (sidebar nav left, content right) that mirrors the in-app HelpWindow.
 */

:root {
    --accent-surface: rgba(0, 113, 227, 0.08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --accent-surface: rgba(41, 151, 255, 0.12);
    }
}

/* ─── Help page wrapper ──────────────────────────────────── */

.help-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.help-wrap {
    display: flex;
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    gap: 0;
}

/* ─── Sidebar ────────────────────────────────────────────── */

.help-sidebar {
    width: 196px;
    flex-shrink: 0;
    padding: 28px 16px 28px 0;
    border-right: 1px solid var(--border);
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sidebar-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--secondary);
    padding: 0 10px;
    margin-bottom: 10px;
    display: block;
}

.help-sidebar a {
    display: block;
    padding: 6px 10px;
    margin-bottom: 2px;
    border-radius: 7px;
    font-size: 14px;
    color: var(--secondary);
    transition: background 0.1s, color 0.1s;
}

.help-sidebar a:hover {
    color: var(--text);
    background: var(--surface);
    text-decoration: none;
}

.help-sidebar a.active {
    color: var(--accent);
    background: var(--accent-surface);
    font-weight: 500;
}

/* ─── Content area ───────────────────────────────────────── */

.help-content-area {
    flex: 1;
    min-width: 0;
    padding: 28px 0 72px 44px;
    max-width: 680px;
}

/* Strip .content's own max-width/padding when nested inside our layout */
.help-content-area .content {
    max-width: none;
    margin: 0;
    padding: 0;
}

/* h2 inside help content: use help-scale sizing */
.help-content-area h2 {
    font-size: 17px;
    margin-top: 32px;
}

.help-content-area h1 {
    font-size: 22px;
}

.help-content-area p,
.help-content-area li {
    font-size: 14px;
}

.help-content-area table {
    font-size: 13px;
}

/* Loading state */
#help-content-area:empty::after {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 48px auto;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Mobile: stacked layout ─────────────────────────────── */

@media (max-width: 700px) {
    .help-wrap {
        flex-direction: column;
        padding: 0 20px;
    }

    .help-sidebar {
        width: 100%;
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 14px 0;
        display: flex;
        align-items: center;
        gap: 4px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .help-sidebar::-webkit-scrollbar {
        display: none;
    }

    .sidebar-label {
        display: none;
    }

    .help-sidebar a {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .help-content-area {
        padding: 24px 0 56px;
        max-width: none;
    }
}
