/* Print Report — off-screen render host + print styles.
   The host is rendered off-screen (so Kendo charts get real dimensions) and is
   made visible only inside the @media print block, so clicking "Print Report"
   goes straight to the browser print/PDF dialog with a clean, full-size report. */

/* Off-screen while on screen: positioned so Kendo can size the charts, but not visible */
#printReportHost {
    position: absolute;
    left: -10000px;
    top: 0;
    width: 680px; /* portrait-safe render width so charts are not clipped when printed */
}

#printReportHost .print-report-header {
    margin-bottom: 10px;
}

#printReportHost h4 {
    margin: 12px 0 6px;
}

@media print {
    /* Show only the report; hide the rest of the app */
    body > *:not(#printReportHost) {
        display: none !important;
    }

    /* Any Bootstrap modal backdrop that might be lingering */
    .modal-backdrop {
        display: none !important;
    }

    /* Bring the host into the normal flow at full page width */
    #printReportHost {
        position: static !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
    }

    /* Charts: never split across a page, never clip */
    #printReportHost .print-preview-chart {
        overflow: visible !important;
        page-break-inside: avoid;
    }

    /* Keep headings with their content */
    #printReportHost h4 {
        page-break-after: avoid;
    }

    /* SRS subscores gets its own page (break before and after) per clinical review */
    #printReportHost .print-srs-subscores {
        page-break-before: always;
        page-break-after: always;
    }

    /* Sessions table — allow it to break across pages so long lists (e.g. 25+
       sessions) paginate instead of being clipped at the first page boundary
       (WebKit/Safari clips oversized page-break-inside:avoid blocks). Repeat the
       header on each page and keep individual rows intact. */
    #printReportHost table {
        width: 100%;
    }

    #printReportHost table thead {
        display: table-header-group;
    }

    #printReportHost table tr {
        page-break-inside: avoid;
    }
}
