/* WyldFire Help / Documentation pages — reuses CSS variables from
   customTheme.css and class vocabulary from Developer.css. Every Help view
   sets <body class="help-page"> so layout rules here cannot leak into the
   viewer or other app pages. */

.help-page { font-family: 'Poppins', sans-serif; background: #ffffff; color: var(--bs-dark); margin: 0; }

/* Sticky navbar on docs pages — matches Developer.css convention so the
   reader can navigate while scrolling. */
.help-page > nav.custom-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* ---------- Two-column shell ---------- */
.help-shell {
    display: flex;
    align-items: flex-start;
    gap: 2.5rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* ---------- Sidebar TOC ---------- */
.help-sidebar {
    flex: 0 0 240px;
    position: sticky;
    /* Navbar height (~62px on desktop) + breathing room. */
    top: 5rem;
    align-self: flex-start;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    padding-right: 0.5rem;
    border-right: 1px solid #e2e8f0;
}

.help-sidebar h2 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin: 1.25rem 0 0.4rem;
}

.help-sidebar h2:first-child { margin-top: 0; }

.help-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem;
}

.help-sidebar li { margin: 0; }

.help-sidebar a {
    display: block;
    padding: 0.35rem 0.75rem;
    border-radius: 0.3rem;
    color: #334155;
    text-decoration: none;
    font-size: 0.92rem;
    line-height: 1.35;
    border-left: 2px solid transparent;
}

.help-sidebar a:hover {
    background: #f1f5f9;
    color: var(--theme-primary);
}

.help-sidebar a.active {
    background: rgba(13, 92, 107, 0.08);
    color: var(--theme-primary);
    font-weight: 600;
    border-left-color: var(--theme-accent);
}

.help-sidebar .help-sub a {
    padding-left: 1.5rem;
    font-size: 0.85rem;
    color: #64748b;
}

.help-sidebar .help-sub a:hover { color: var(--theme-primary); }

/* ---------- Content column ---------- */
.help-content {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 820px;
}

.help-content h1 {
    font-weight: 700;
    font-size: 2.1rem;
    color: var(--theme-primary);
    margin: 0 0 0.5rem;
}

.help-content .help-lead {
    font-size: 1.1rem;
    color: #475569;
    line-height: 1.55;
    margin-bottom: 2rem;
}

.help-content h2 {
    font-weight: 600;
    font-size: 1.45rem;
    color: var(--theme-primary);
    margin: 2.5rem 0 0.75rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #e2e8f0;
    /* Offset deep-link scroll past the sticky navbar. */
    scroll-margin-top: 5rem;
}

.help-content h3 {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--theme-primary);
    margin: 1.5rem 0 0.4rem;
    scroll-margin-top: 5rem;
}

.help-content h4 {
    font-weight: 600;
    font-size: 0.95rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1.1rem 0 0.3rem;
}

.help-content p, .help-content li {
    color: #334155;
    line-height: 1.65;
    font-size: 0.98rem;
}

.help-content a:not(.btn) {
    color: var(--theme-accent);
    text-decoration: none;
    font-weight: 500;
}
.help-content a:not(.btn):hover {
    color: var(--theme-secondary);
    text-decoration: underline;
}

.help-content code {
    color: var(--theme-accent);
    background: rgba(217, 119, 6, 0.08);
    padding: 0.1em 0.35em;
    border-radius: 0.25em;
    font-size: 0.88em;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.help-content blockquote {
    border-left: 3px solid var(--theme-secondary);
    background: #f8fafc;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    color: #475569;
    font-style: italic;
    font-size: 0.95rem;
    border-radius: 0 0.3rem 0.3rem 0;
}

/* ---------- Tables (reuses dev-table styling) ---------- */
.help-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.5rem;
    font-size: 0.92rem;
    background: #ffffff;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.help-table th, .help-table td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
    text-align: left;
}
.help-table tbody tr:last-child td { border-bottom: none; }
.help-table th {
    font-weight: 600;
    background: var(--theme-gradient-header);
    color: #ffffff;
    border-bottom: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.help-table tbody tr:hover { background: rgba(13, 92, 107, 0.03); }
.help-table code {
    color: var(--theme-accent);
    background: rgba(217, 119, 6, 0.08);
}

/* ---------- Tile cards on the Help landing page ---------- */
.help-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.help-tile {
    display: block;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    padding: 1.25rem;
    text-decoration: none !important;
    color: inherit !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.help-tile:hover {
    transform: translateY(-2px);
    border-color: var(--theme-secondary);
    box-shadow: 0 6px 18px rgba(13, 92, 107, 0.08);
}
.help-tile h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--theme-primary) !important;
    margin: 0 0 0.4rem;
}
.help-tile p {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
}

/* ---------- Layer subsection card ---------- */
.help-layer {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    margin: 1rem 0 1.5rem;
}
.help-layer h3 {
    margin-top: 0;
}
.help-layer .help-layer-code {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: var(--theme-accent);
    background: rgba(217, 119, 6, 0.08);
    padding: 0.1em 0.4em;
    border-radius: 0.25em;
    font-size: 0.78em;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ---------- Coming-soon scaffold callout ---------- */
.help-stub {
    background: rgba(13, 92, 107, 0.04);
    border: 1px dashed var(--theme-secondary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    color: #475569;
    margin: 1.5rem 0;
}
.help-stub strong { color: var(--theme-primary); }
.help-stub ul { margin: 0.5rem 0 0 1.25rem; }

/* ---------- Footer / page meta ---------- */
.help-meta {
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    color: #94a3b8;
    font-size: 0.82rem;
}
.help-meta p { margin: 0.25rem 0; color: #94a3b8; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
    .help-shell {
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem 1rem 3rem;
    }
    .help-sidebar {
        position: static;
        flex: 1 1 auto;
        width: 100%;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 0 0 1rem;
    }
    .help-sidebar a { padding: 0.5rem 0.75rem; }
    .help-content { max-width: 100%; }
    .help-content h1 { font-size: 1.75rem; }
}
