/* =============================================================================
 * BookSkill MkDocs Material template - extra.css
 * Print-friendly tweaks and overflow handling for math.
 * ============================================================================= */

/* Comfortable line-height for body text. */
.md-typeset {
    line-height: 1.7;
}

/* Slightly tighter code blocks; the default is too airy for long listings. */
.md-typeset pre > code,
.md-typeset .highlight pre {
    line-height: 1.45;
    font-size: 0.78rem;
}

/* Ensure display equations do not overflow horizontally on narrow viewports. */
.md-typeset .arithmatex,
.md-typeset mjx-container,
.md-typeset .katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
}

/* KaTeX inline equations should not break layout in narrow columns. */
.md-typeset .katex {
    font-size: 1.05em;
}

/* Print rules: hide chrome, give content the full page. */
@media print {
    .md-header,
    .md-tabs,
    .md-sidebar,
    .md-footer,
    .md-search,
    .md-nav {
        display: none !important;
    }

    .md-main__inner,
    .md-content {
        margin: 0 !important;
        max-width: 100% !important;
    }

    .md-typeset {
        font-size: 11pt;
        line-height: 1.5;
    }

    .md-typeset a {
        color: #000;
        text-decoration: underline;
    }

    .md-typeset pre,
    .md-typeset code {
        page-break-inside: avoid;
    }

    .md-typeset h1,
    .md-typeset h2,
    .md-typeset h3 {
        page-break-after: avoid;
    }
}
