﻿/**
 * Print Styles
 * Modernized: Logical properties, better page break handling
 */

@media print {
    /* === Page Setup === */
    @page {
        margin: 1in;
        size: letter;
    }
    
    @page :first {
        margin-block-start: 0.5in;
    }
    
    /* === Base Adjustments === */
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    html {
        font-size: 12pt;
    }
    
    body {
        line-height: 1.4;
    }
    
    /* === Typography === */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        break-after: avoid;
    }
    
    h1 { font-size: 18pt; }
    h2 { font-size: 16pt; }
    h3 { font-size: 14pt; }
    h4, h5, h6 { font-size: 12pt; }
    
    p, li {
        orphans: 3;
        widows: 3;
    }
    
    /* === Links === */
    a {
        text-decoration: underline;
    }
    
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        word-wrap: break-word;
    }
    
    a[href^="#"]::after,
    a[href^="javascript"]::after {
        content: "";
    }
    
    /* === Images === */
    img {
        max-inline-size: 100% !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    /* === Tables === */
    table {
        border-collapse: collapse;
    }
    
    th, td {
        border: 1px solid #000;
    }
    
    thead {
        display: table-header-group;
    }
    
    tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    /* === Forms === */
    form,
    fieldset {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    /* === Page Breaks === */
    hr {
        page-break-before: always;
        break-before: page;
        visibility: hidden;
        padding: 0;
        margin: 0;
        block-size: 0;
    }
    
    .page-break {
        page-break-before: always;
        break-before: page;
    }
    
    .no-break {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    /* === Hide Non-Print Elements === */
    .noprint, .skip-link, nav, .page-selector, .language-selector, .password-toggle, .footer, .page_footer, .portal_navigation, button[type=submit], input[type=submit], input[type=button], .noscript-warning {
        display: none !important;
    }
    
    /* === Main Content === */
    .main_container {
        display: block;
        padding: 0;
    }
    
    .login-wrapper {
        inline-size: 100%;
        padding: 0;
    }
    
    .login-form {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* === Letter Size Specific === */
@media print and (width: 8.5in) and (height: 11in) {
    @page {
        margin: 1in;
    }
}

/* === A4 Size Specific === */
@media print and (width: 210mm) and (height: 297mm) {
    @page {
        margin: 20mm;
    }
}
