/* ===========================
   User Manual — doc.css
   =========================== */

/* ---- Doc layout: TOC sidebar + content ---- */

#doc-layout {
    display: flex;
    align-items: flex-start;
    gap: 2.5rem;
    max-width: 1080px;
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
    background-image: linear-gradient(#e9ecef, #e9ecef);
    background-size: 1px 100%;
    background-position: calc(2rem + 200px) 0;
    background-repeat: no-repeat;
}

content {
    display: block;
    flex: 1;
    min-width: 0;
}

/* ---- Headings ---- */

content h2,
content h3,
content h4 {
    scroll-margin-top: 5rem;
}

content h1 {
    font-size: 2.1rem;
    font-weight: 700;
    color: #0b1220;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
    letter-spacing: -0.01em;
}

content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0b1220;
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

content h3,
content h4 {
    font-size: 0.98rem;
    font-weight: 600;
    color: #212529;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}

/* ---- Body text ---- */

content p {
    line-height: 1.8;
    color: #3a4150;
    margin-bottom: 0.9rem;
}

/* ---- Links ---- */

content a {
    color: #0d6efd;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.2em;
}

content a:hover {
    color: #0a58ca;
}

/* ---- Bold ---- */

content strong {
    font-weight: 600;
    color: #1a202c;
}

/* ---- Lists ---- */

content ul,
content ol {
    padding-left: 1.4rem;
    margin-bottom: 1rem;
}

content li {
    line-height: 1.75;
    color: #3a4150;
    margin-bottom: 0.25rem;
}

content li > ul,
content li > ol {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

/* ---- Inline code ---- */

content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.855em;
    background: #f0f6ff;
    color: #0d6efd;
    padding: 0.15em 0.45em;
    border-radius: 0.3rem;
    border: 1px solid rgba(13, 110, 253, 0.15);
}

/* ---- Images ---- */

content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem 0;
    border-radius: 0.6rem;
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.09);
}

/* ---- Table ---- */

content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

content thead th {
    background: #f0f6ff;
    color: #0b1220;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    padding: 0.65rem 1.1rem;
    border-bottom: 1px solid rgba(13, 110, 253, 0.18);
}

/* Hide the header row when all cells are empty (dialogue table) */
content thead:has(th:empty) {
    display: none;
}

content tbody tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.1s;
}

content tbody tr:last-child {
    border-bottom: none;
}

content tbody td {
    padding: 0.55rem 1.1rem;
    color: #3a4150;
}

/* First column: collapse to content width */
content td:first-child,
content th:first-child {
    width: 1%;
    white-space: nowrap;
}

content tbody tr:nth-child(even) {
    background: #fafbfd;
}

/* Dialogue table: frequency / channel separator rows */
content tbody tr:has(> td:first-child > strong) {
    background: #f0f6ff !important;
}

content tbody tr:has(> td:first-child > strong) td {
    color: #0b1220;
    font-size: 0.85rem;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    border-top: 1px solid rgba(13, 110, 253, 0.18);
}

content tbody tr:has(> td:first-child > strong) td:last-child {
    color: #6c757d;
    font-style: italic;
}

content tbody tr:has(> td:first-child > strong) strong {
    color: #0b1220;
    font-weight: 600;
}

/* ---- Blockquotes ---- */

content blockquote:not([class]) {
    border-left: 3px solid #dee2e6;
    margin: 1.25rem 0;
    padding: 0.6rem 1.1rem;
    background: #f8f9fa;
    border-radius: 0 0.375rem 0.375rem 0;
    color: #6c757d;
}

content blockquote:not([class]) p:last-child {
    margin-bottom: 0;
}

/* ---- GitHub-style alerts ---- */

content blockquote[class^="markdown-alert-"] {
    border-left: 3px solid;
    border-radius: 0 0.375rem 0.375rem 0;
    padding: 0.75rem 1.1rem;
    margin: 1.25rem 0;
}

content blockquote[class^="markdown-alert-"] > p:last-child {
    margin-bottom: 0;
}

content blockquote[class^="markdown-alert-"]::before {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.4rem;
}

content blockquote.markdown-alert-note      { border-left-color: #0969da; background: #f0f7ff; }
content blockquote.markdown-alert-tip        { border-left-color: #1a7f37; background: #f0fff4; }
content blockquote.markdown-alert-important  { border-left-color: #8250df; background: #fbf0ff; }
content blockquote.markdown-alert-warning    { border-left-color: #9a6700; background: #fffbf0; }
content blockquote.markdown-alert-caution    { border-left-color: #cf222e; background: #fff5f5; }

content blockquote.markdown-alert-note::before      { content: "Note";      color: #0969da; }
content blockquote.markdown-alert-tip::before        { content: "Astuce";    color: #1a7f37; }
content blockquote.markdown-alert-important::before  { content: "Important"; color: #8250df; }
content blockquote.markdown-alert-warning::before    { content: "Attention"; color: #9a6700; }
content blockquote.markdown-alert-caution::before    { content: "Alerte";   color: #cf222e; }

/* ---- Table of contents ---- */

#toc {
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: 4.5rem;
    padding-right: 2rem;
}

#toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

#toc li {
    margin-bottom: 0.15rem;
    font-size: 0.875rem;
    line-height: 1.45;
}

#toc a {
    display: block;
    padding: 0.25rem 0;
    color: #6c757d;
    text-decoration: none;
    border-right: 2px solid transparent;
    margin-right: -2rem;
    padding-right: 2rem;
    transition: color 0.15s, border-color 0.15s;
}

#toc a:hover {
    color: #0b1220;
    border-right-color: #0b1220;
}

/* ---- Responsive ---- */

@media (max-width: 800px) {
    #doc-layout {
        flex-direction: column;
        padding: 2rem 1rem 4rem;
    }

    #toc {
        display: none;
    }

    content h1 {
        font-size: 1.6rem;
    }

    content h2 {
        font-size: 1.1rem;
    }
}
