/* ============================================================
   manual.css — Writer's Canvas: User Manual Styles
   ============================================================ */

/* ---- Layout ---- */
/* Content area takes full width; TOC is overlaid */
.help-container {
    display: block;
}

/* ---- Floating TOC Toggle Button ---- */
.toc-toggle-btn {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--brand);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    color: #fff;
}
.toc-toggle-btn:hover {
    background: var(--brand-dark, #0a6659);
    box-shadow: 0 6px 20px rgba(0,0,0,0.28);
    transform: translateY(-50%) scale(1.08);
}
.toc-toggle-btn svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 0.2s;
}
.toc-toggle-btn .icon-close { display: none; }
.toc-toggle-btn.open .icon-list  { display: none; }
.toc-toggle-btn.open .icon-close { display: block; }

/* ---- Floating Sidebar Navigation ---- */
.help-sidebar {
    position: fixed;
    left: 70px;
    top: 80px;
    bottom: 20px;
    z-index: 999;
    width: 260px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: var(--bg-alt, #f7f7f7);
    padding: 20px 20px 20px 16px;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.14),
                0 2px 8px rgba(0,0,0,0.08);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-16px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.help-sidebar.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}
/* Scrollbar styling inside sidebar */
.help-sidebar::-webkit-scrollbar { width: 4px; }
.help-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.help-nav-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.help-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.help-nav-item {
    margin-bottom: 8px;
}
.help-nav-link {
    display: block;
    font-size: 0.88rem;
    color: var(--text-muted);
    padding: 6px 8px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
.help-nav-link:hover {
    color: var(--brand);
    background: rgba(0,0,0,0.04);
}
.help-nav-link.active {
    color: var(--brand);
    background: rgba(14,124,110,0.08);
    font-weight: 600;
}

/* ---- Sections ---- */
.help-section {
    margin-bottom: 60px;
    scroll-margin-top: 100px;
}
.help-section h2 {
    font-size: 1.8rem;
    color: var(--text);
    margin-bottom: 24px;
    border-bottom: 2px solid var(--brand-pale);
    padding-bottom: 8px;
    font-family: var(--font-serif);
}
.help-section h3 {
    font-size: 1.3rem;
    color: var(--brand);
    margin: 32px 0 16px;
    font-family: var(--font-serif);
}
.help-section p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 16px;
}

/* ---- Cards ---- */
.help-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.help-card h4 {
    font-size: 1.05rem;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.help-card h4 i {
    color: var(--brand);
}

/* ---- Warning card (encryption section) ---- */
.help-card-warning {
    border-color: #fca5a5;
    background: #fff5f5;
}
.help-card-warning h4 .icon-warning {
    color: #dc2626;
}

/* ---- Content Blocks (menu screenshots, feature subsections) ---- */
.content-block {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
}
.content-block-title {
    margin-bottom: 15px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.content-block-title h5,
.content-block-title h6 {
    margin: 0;
    font-size: inherit;
    color: inherit;
}

/* ---- Two-column grid inside content blocks ---- */
.content-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    align-items: start;
}
.content-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---- Flex column stacks ---- */
.content-stack {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.content-center {
    display: flex;
    justify-content: center;
}

/* ---- Divider row inside content blocks ---- */
.content-block-divider {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ---- Text within content blocks ---- */
.content-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.content-text p {
    margin-bottom: 12px;
}

/* ---- Lists inside content blocks ---- */
.content-list {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.content-list-plain {
    list-style: none;
    padding: 0;
}
.content-list-plain li,
.content-list-indent li {
    margin-bottom: 8px;
}
.content-list-indent {
    padding-left: 20px;
}

/* ---- Images inside content blocks ---- */
.content-img {
    border-radius: 4px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.content-img-sm   { width: 50px; }
.content-img-md   { width: 150px; }
.content-img-nav  { width: 200px; }
.content-img-side { width: 220px; }
.content-img-editor { width: 300px; }
.content-img-wide { width: 100%; max-width: 400px; }
.content-img-full { width: 100%; max-width: 500px; }
.content-img-xl   { width: 100%; max-width: 600px; }
.content-img-preview { width: 100%; max-width: 300px; }

/* ---- Toolbar-area icon (nav download button) ---- */
.icon-sm {
    width: 16px;
    height: 16px;
}

/* ---- Image Block (large feature screenshots) ---- */
.image-block {
    margin-bottom: 40px;
    width: 100%;
    display: flex;
    justify-content: center;
    background: #fff;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.image-block img {
    max-width: 100%;
    height: auto;
    display: block;
    border: none;
    border-radius: 0;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15);
}

/* ---- Mermaid code block ---- */
.mermaid-pre {
    background: var(--bg-alt);
    padding: 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    overflow-x: auto;
}

/* ---- Shortcut Table ---- */
.shortcut-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.shortcut-table th,
.shortcut-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.shortcut-table th {
    background: var(--bg-alt);
    color: var(--text);
    font-weight: 600;
}
.shortcut-table .table-separator td {
    background: rgba(0, 0, 0, 0.03);
    font-weight: bold;
    text-align: center;
}

/* ---- kbd ---- */
kbd {
    background: var(--bg-alt);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.85rem;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .toc-toggle-btn {
        left: 12px;
        width: 38px;
        height: 38px;
    }
    .help-sidebar {
        left: 56px;
        width: calc(100vw - 76px);
        max-width: 280px;
    }
}
