
/*

    NOTES:   
    
    To hide an element when printing:  Add class  d-print-none


    Also TODO - Include a file liek this glboally, then maybe separate overrid eones for ISO vcs AWS welding forms, etc.




*/

@media print {

    /* Avoid unexpected padding that eats into the page */
    html, body {
        padding: 0 !important;
    }

    :root {
        --print-margin-top: 0.25in;
        --print-margin-bottom: 0.25in;
        /* Optional explicit page height (e.g., '11in' for Letter, '297mm' for A4) */
        --print-page-height: 11in;
    }

    @page {
        size: auto;
        margin: 12mm 10mm 12mm 10mm;
    }

    header:not(.print-allow):not(.tp-print-header),
    footer:not(.print-allow):not(.tp-print-footer),
    aside,
    nav {
        display: none !important;
        visibility: hidden !important;
    }

    background-graphics {
        display: none;
    }


    /*    @page {
        size: 8.5in 9in;
        
    }*/


    body {
        /* Optional: apply scale only when explicitly enabled */
    }

        body.print-scale-95 {
            transform: scale(.95);
            transform-origin: top left;
        }



    .printtablehidescroll {
        overflow: hidden;
    }

    /* Hides Column */
    .print-hide-col {
        display: none !important;
    }

    /* Hide scrollbars */
    .table-responsive {
        overflow: visible !important;
        max-height: none !important;
    }

    /* Repeat Header/Footer on each page */
    thead {
        display: table-header-group !important;
    }

    tfoot {
        display: table-footer-group !important;
    }

    .card {
        display: block !important; /* always printable by default */
    }

    /* Page-break helpers */
    .print-keep {
        break-inside: avoid; /* modern */
        page-break-inside: avoid; /* fallback */
    }

    /* Apply a page break when this class is present */
    .print-break {
        break-before: page; /* modern */
        page-break-before: always; /* legacy */
    }

    /* Hide Bootstrap card borders when printing */
    .no-print-border {
        border: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

        .card > .card-header[data-toggle="collapse"],
        .card > .card-header[data-bs-toggle="collapse"],
        .no-print-border > .card-header {
            border: 0 !important;
            box-shadow: none !important;
            background: transparent !important;
        }

    /* Make sure the card doesn't clip wrapped content */
    .card,
    .card-body,
    .card-header {
        overflow: visible !important;
    }

    /* Images shouldn't force the card wider */
    img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Let text wrap anywhere instead of spilling out */
    .print-word-wrap,
    .control-label,
    .card-header,
    label {
        white-space: normal !important;
        overflow-wrap: anywhere; /* modern, breaks even without spaces */
        word-break: break-word; /* fallback for older engines */
        hyphens: auto; /* optional soft hyphenation */
    }

    textarea {
        resize: none !important;
        overflow: visible !important; /* makes sure text shows fully */
    }

    a {
        text-decoration: none !important;
    }

    .printtablecolhide {
        display: none;
    }

    table.no-table-break {
        page-break-inside: avoid;
    }

    .sumtable.no-table-break {
        page-break-inside: avoid;
    }


    .print-line-break {
        word-break: break-all !important;
    }



    /*    .print-word-wrap {
        display: inline-block;
        font-style: italic;
        font-weight: 900;
        width: 50px;
        height: auto;
        padding: 5px;
        border: 1px solid blue;
        background-color: yellow;
        word-wrap: break-word;
    }*/

    .print_wrap {
        /*display: inline-block;*/
        word-wrap: break-word;
        white-space: pre-wrap;
    }

    .print_border {
        border: hidden;
    }

    .print-line-size {
        inline-size: 25px !important;
    }

    .print_fat {
        font-weight: 900;
    }

    pre {
        white-space: pre-wrap;
    }

    .print_text {
        font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
        font-size: 12px !important;
        font-weight: 400 !important;
        color: black;
    }


    .body-inner {
        /*display: flex !important;*/
        /*white-space: nowrap !important;*/
        /*background-color: white;*/
    }

    .col-print-md-12 {
        width: 100%;
    }

    .col-print-md-11 {
        width: 91.66666667%;
    }

    .col-print-md-10 {
        width: 83.33333333%;
    }

    .col-print-md-9 {
        width: 75%;
    }

    .col-print-md-8 {
        width: 66.66666667%;
    }

    .col-print-md-7 {
        width: 58.33333333%;
    }

    .col-print-md-6 {
        width: 50%;
    }

    .col-print-md-5 {
        width: 41.66666667%;
    }

    .col-print-md-4 {
        width: 33.33333333%;
    }

    .col-print-md-3 {
        width: 25%;
    }

    .col-print-md-2 {
        width: 16.66666667%;
    }

    .col-print-md-1 {
        width: 8.33333333%;
    }

    .col-print-4 {
        width: 100%;
    }

    .col-print-8 {
        width: 100%;
    }

    .row-print-100 {
        width: 100%;
    }


    /* Card Styles*/


    .card-print-WF1 {
        max-height: 250px;
        background-color: transparent;
    }

    .card-body .table {
        font-size: 11px;
        margin-bottom: 0;
    }

        .card-body .table th,
        .card-body .table td {
            padding: 4px 8px;
            line-height: 1.2;
            white-space: nowrap;
        }

        .card-body .table th {
            font-weight: 600;
        }

    /*image-print is working*/

    .image-print {
        max-height: 250px;
    }

    /*print-line-break is working*/

    /* .print-line-break {
        <br />
    } */


    .print-pagebreak-after {
        clear: both;
        page-break-after: always;
        margin-block-start: 20px;
        padding-block-start: 20px;
    }

    .print-pagebreak-before {
        clear: both;
        page-break-before: always;
        margin-top: 35px;
        /*margin-block-start: 20px;
        padding-block-start: 20px;*/
    }

    .print-wps-pagebreak-after {
        clear: both;
        page-break-after: always;
        margin-block-start: 20px;
        padding-block-start: 20px;
    }

    .print-wps-pagebreak-before {
        clear: both;
        page-break-before: always;
        margin-top: 35px;
        /*margin-block-start: 20px;
        padding-block-start: 20px;*/
    }


    div.nobreak {
        white-space: nowrap;
    }

    .printhide {
        display: none;
    }

    div.printheader {
        display: initial;
        position: fixed;
    }

    .printspace {
        margin-top: inherit;
    }

    .printformat {
        white-space: nowrap;
    }


    /*    button {
        display: none !important;
    }*/

    span.btn {
        display: none !important;
    }

    i.fas.float-right {
        display: none !important;
    }

    .img-print-weld {
        max-width: 100%;
        max-height: 1.0in !important;
        width: auto !important;
        object-fit: contain;
    }
}





/*
::::::::::::::::::::::::::::::::::::::::::::::::::::
Print
::::::::::::::::::::::::::::::::::::::::::::::::::::
*/


/*    html, body {
        font-size: 10px !important;
        white-space:nowrap !important;
    }*/


/*    body {
        display: flex !important;
        white-space: nowrap !important;
    }

    @page {

        width: 1280px !important;
        size: landscape auto;
    }*/

/*    @page {
        size: letter portrait;
        margin-top: 0px !important; 
        white-space: nowrap;
        background-color: aqua;
    }*/

/*.card-deck*/


/*.printrowfixed {
        display: inline-flex ;
    }*/

/*div[class*="col-"] {
        display: block
    }*/

/*div.cell {
        display: block
    }*/

/*div.output_wrapper {
        display: inline-block;
    }*/

/*div.output {
        display: block
    }*/

/*    div.print-WFheader {
        display: inline-block;
        white-space: nowrap;
        width: auto;
        height: auto;
        padding: 5px;
        border: 1px solid blue;
        background-color: yellow;
    }*/

/*    div.print-card {
        display: inline-block;
        white-space: nowrap;
        width: auto;
        height: auto;
        padding: 5px;
        border: 1px solid blue;
        background-color: yellow;
    }*/

/*    .print-WFrow {
        display: inline-block;
        white-space: nowrap;
    }*/

/*    .print-column1-WF {
        display: inline-block;
        white-space: nowrap;
        column-width: 300px;
    }*/

/*    .print-WFcolumn2 {
        display: inline-block;
        width: 300px;
        white-space: nowrap;

    }*/



/* =====================================================================
   pWPS / Welding Form print fixes
   Purpose:
   1) Print only accordion sections that are open at print time.
   2) Support a repeating Administration print header on every page.

   Required markup/JS contract for the repeating Administration header:
   - The printable form is #GWMDocumentForm.
   - A print-only header container exists as #printRepeatHeader.
   - At print time, #printRepeatHeader contains the Administration section markup
     wrapped with .print-repeat-header-row and .print-repeat-header-cell.

   This stylesheet intentionally does NOT force all collapsed accordions open.
   ===================================================================== */

@media print {

    /* ------------------------------------------------------------
       Accordion print state
       ------------------------------------------------------------
       print_all_forms contains a global .collapse:not(.show) rule in some
       versions. Since this welding-form stylesheet is loaded later, these
       rules restore the desired behavior for pWPS/WPS/WPQR forms:
       - open accordion bodies print
       - closed accordion bodies do not print
       ------------------------------------------------------------ */

    body.is-printing .card-body.tab.print-open,
    body.is-printing .collapse.print-open,
    body.is-printing .collapse.show {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    body.is-printing .card-body.tab.print-closed,
    body.is-printing .collapse.print-closed,
    body.is-printing .collapse:not(.show):not(.print-open) {
        display: none !important;
        height: 0 !important;
        overflow: hidden !important;
        visibility: hidden !important;
    }

    /* ------------------------------------------------------------
       Repeating Administration header
       ------------------------------------------------------------
       Browsers repeat table header groups across printed pages. Therefore
       the print-time wrapper is rendered as a table, and #printRepeatHeader
       is rendered as a table-header-group.
       ------------------------------------------------------------ */

    body.is-printing #GWMDocumentForm {
        display: table !important;
        width: 100% !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    body.is-printing #printRepeatHeader,
    body.is-printing .print-repeat-header,
    body.is-printing .wf-print-admin-header {
        display: table-header-group !important;
        background: #fff !important;
        color: #000 !important;
    }

    body.is-printing .print-repeat-header-row,
    body.is-printing .wf-print-admin-header-row {
        display: table-row !important;
    }

    body.is-printing .print-repeat-header-cell,
    body.is-printing .wf-print-admin-header-cell {
        display: table-cell !important;
        width: 100% !important;
        background: #fff !important;
        color: #000 !important;
        padding: 0 0 3mm 0 !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    /* Hide the original Administration block only when the cloned repeating
       header is active. Add .screen-admin-header to the original block, or keep
       the current #administration_tab body and wrap/target it in page JS. */
    body.is-printing .screen-admin-header {
        display: none !important;
    }

    /* Ensure the repeating header does not print interactive controls. */
    body.is-printing #printRepeatHeader .d-print-none,
    body.is-printing #printRepeatHeader button,
    body.is-printing #printRepeatHeader input[type="button"],
    body.is-printing #printRepeatHeader input[type="submit"],
    body.is-printing #printRepeatHeader .btn,
    body.is-printing .wf-print-admin-header .d-print-none,
    body.is-printing .wf-print-admin-header button,
    body.is-printing .wf-print-admin-header input[type="button"],
    body.is-printing .wf-print-admin-header input[type="submit"],
    body.is-printing .wf-print-admin-header .btn {
        display: none !important;
        visibility: hidden !important;
    }

    /* Keep Administration compact and prevent page breaks inside the header. */
    body.is-printing #printRepeatHeader .card,
    body.is-printing #printRepeatHeader .card-body,
    body.is-printing #printRepeatHeader .row,
    body.is-printing .wf-print-admin-header .card,
    body.is-printing .wf-print-admin-header .card-body,
    body.is-printing .wf-print-admin-header .row {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        overflow: visible !important;
    }

    body.is-printing #printRepeatHeader .container,
    body.is-printing #printRepeatHeader .container-fluid,
    body.is-printing .wf-print-admin-header .container,
    body.is-printing .wf-print-admin-header .container-fluid {
        max-width: none !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    body.is-printing #printRepeatHeader input,
    body.is-printing #printRepeatHeader select,
    body.is-printing #printRepeatHeader textarea,
    body.is-printing .wf-print-admin-header input,
    body.is-printing .wf-print-admin-header select,
    body.is-printing .wf-print-admin-header textarea {
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 !important;
        min-height: 0 !important;
    }

    body.is-printing #printRepeatHeader .card-header,
    body.is-printing .wf-print-admin-header .card-header {
        display: none !important;
    }
}
