/* ============================================================================
 * Knowledge Base — Print styles
 * ========================================================================== */

@media print {

    /* Hide admin chrome */
    #header,
    #setup-menu-warning,
    .navbar,
    .top-bar,
    .menu,
    .footer,
    #footer,
    .kb-sidebar,
    .kb-toc-col,
    .kb-node-header__actions,
    .kb-editor-topbar,
    .kb-editor-sidebar,
    .kb-lock-banner,
    .kb-search-trigger,
    .kb-portal-feedback,
    .modal,
    .alert,
    .btn,
    #kb-toast-container {
        display: none !important;
    }

    body,
    .kb-app,
    .kb-workspace,
    .kb-workspace__content {
        background: #FFFFFF !important;
        color: #000000 !important;
        font-family: 'Georgia', 'Times New Roman', serif;
        font-size: 11pt;
        line-height: 1.5;
    }

    .kb-workspace { display: block !important; }
    .kb-workspace__content { padding: 0 !important; overflow: visible !important; }
    .kb-workspace__body { max-width: 100% !important; }

    /* Show TOC inline at start */
    .kb-toc-print {
        display: block !important;
        page-break-after: always;
        margin-bottom: 32px;
        padding-bottom: 16px;
        border-bottom: 1px solid #000;
    }

    /* Page break rules */
    .kb-node-header__title,
    h1, h2, h3, h4 {
        page-break-after: avoid;
    }

    h2, h3, table, figure, img,
    .kb-callout {
        page-break-inside: avoid;
    }

    /* Show link target */
    a[href]::after {
        content: ' (' attr(href) ')';
        font-size: 9pt;
        font-style: italic;
        color: #555;
    }

    /* Don't print URL for in-page anchors / mailto */
    a[href^="#"]::after,
    a[href^="mailto:"]::after {
        content: '';
    }

    img, table {
        max-width: 100% !important;
    }

    pre, code {
        font-size: 9pt;
        white-space: pre-wrap;
        word-break: break-word;
    }

    .kb-badge {
        border: 1px solid #000;
        background: #FFF !important;
        color: #000 !important;
    }
}
