/* Custom styles for LoadSensing G7 message API documentation */

/* Widen the content area so tables are not truncated */
.md-grid {
    max-width: 95%;
}

/* Shrink table font and tighten spacing for on-screen readability */
.md-typeset table:not([class]) {
    font-size: 0.75rem;
    line-height: 1.3;
}

/* Improve table readability */
.md-typeset table:not([class]) th {
    background-color: var(--md-default-fg-color--lightest);
    font-weight: 700;
    min-width: 3rem;
    padding: 4px 6px;
}

.md-typeset table:not([class]) td {
    vertical-align: top;
    padding: 3px 6px;
}

/* Tree-drawing characters in field tables — keep monospace */
.md-typeset table:not([class]) td:first-child {
    font-family: "Roboto Mono", monospace;
    white-space: nowrap;
    font-size: 0.7rem;
}

/* Message items are hidden from the sidebar by js/hide-msg-nav.js.
   They remain in nav: so print-site-plugin still collects them. */

/* ── Print / PDF styles ──────────────────────────────────────────────── */
@media print {
    /* Landscape for wide field tables */
    @page {
        size: A4 landscape;
        margin: 10mm;
    }

    /* Hide sidebar, header, footer, search */
    .md-sidebar,
    .md-header,
    .md-footer,
    .md-search {
        display: none !important;
    }

    /* Shrink body text to fit A4 */
    body,
    .md-content {
        font-size: 8pt !important;
    }

    /* Shrink headings */
    h1 { font-size: 14pt !important; }
    h2 { font-size: 11pt !important; }
    h3 { font-size: 9pt !important; }
    h4, h5, h6 { font-size: 8pt !important; }

    /* Tighten paragraph and list spacing */
    .md-typeset p,
    .md-typeset li,
    .md-typeset pre,
    .md-typeset code {
        font-size: 7pt !important;
        line-height: 1.3 !important;
        margin-top: 0.2em !important;
        margin-bottom: 0.2em !important;
    }

    /* Shrink JSON / code blocks further */
    .md-typeset pre > code,
    .md-typeset .highlight code,
    .md-typeset .highlight pre {
        font-size: 6pt !important;
        line-height: 1.2 !important;
        padding: 4px 6px !important;
    }

    /* Let tables use the full page width */
    .md-grid {
        max-width: 100%;
    }

    /* Force tables to fill available width and wrap long words */
    table {
        display: table !important;
        width: 100% !important;
        table-layout: auto !important;
        word-wrap: break-word !important;
    }

    th,
    td {
        padding: 2px 3px !important;
        font-size: 7pt !important;
        line-height: 1.2 !important;
    }

    /* Reduce minimum column width */
    .md-typeset table:not([class]) th {
        min-width: unset;
    }

    /* Allow table to overflow page break */
    .md-typeset table:not([class]) {
        page-break-inside: auto;
    }

    .md-typeset table:not([class]) tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    /* Each message starts on a new page */
    h1 {
        break-before: page;
    }

    /* Don't break before first h1 */
    .print-page h1:first-of-type {
        break-before: avoid;
    }
}
