/* public/css/print.css */

@media print {
    body {
        font-family: 'Times New Roman', Times, serif; /* Serif font for print */
        font-size: 10pt; /* Slightly smaller for more content */
        color: #000000;
        background-color: #ffffff !important; /* Force white background */
        margin: 0.4in; /* Standard margins */
        padding: 0;
        width: auto !important; /* Allow content to flow naturally */
        float: none !important; /* Reset floats */
    }

    /* Hide non-content elements */
    #launchpad,
    .window-footer,
    .window-title-bar .title-button, /* Hide Up button */
    .page-actions-bar, /* --- Hide the whole bar including Print button --- */
    .page-meta,
    .notice-box,
    .search-bar, /* Hide search bar */
    .admin-forms /* Hide admin forms if present */
    {
        display: none !important; /* Force hide */
    }

    /* Remove window styling */
    .window {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background-color: #ffffff !important;
        width: auto !important;
        float: none !important;
    }

    /* Style the title bar minimally as a main heading */
    .window-title-bar {
        background: none !important;
        color: #000000 !important;
        font-size: 18pt; /* Larger title */
        font-weight: bold;
        text-align: left; /* Align title left */
        border-bottom: 2px solid #000000;
        padding: 0 0 10px 0; /* Only bottom padding/border */
        margin: 0 0 20px 0; /* Only bottom margin */
        page-break-after: avoid; /* Don't break page right after title */
    }
     /* Hide the span containing breadcrumbs/links if needed */
     .window-title-bar .title {
         padding-left: 0;
     }
     .window-title-bar .title a { /* Hide breadcrumb links within title */
         display: none;
     }
     /* If title text is directly in the span, we need to adjust or rely on PHP providing only title */


    .window-content {
        padding: 0 !important;
        border: none !important;
        margin: 0 !important;
        background-color: #ffffff !important;
        width: auto !important;
        float: none !important;
    }

    /* Ensure page body content uses full width */
    .page-body {
        border: none !important;
        padding: 0 !important;
        background-color: #ffffff !important;
        width: auto !important;
        float: none !important;
    }

    /* Make links visible - black and underlined */
    a, a:visited {
        color: #000000 !important;
        text-decoration: underline !important;
    }

    /* Optionally show full URL after links */
    /* Useful for printed documents where links aren't clickable */

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        font-weight: normal;
        word-wrap: break-word;
    }

    /* Don't show for internal jump links */
    
    a[href^="#"]:after {
        content: "";
    }
    


    /* Basic styling for headings */
    h1, h2, h3, h4, h5, h6 {
        color: #000000 !important;
        page-break-after: avoid; /* Keep headings with content */
        page-break-inside: avoid; /* Avoid breaking headings themselves */
        margin-top: 1.5em;
        margin-bottom: 0.5em;
    }
    h1 { font-size: 16pt; }
    h2 { font-size: 14pt; }
    h3 { font-size: 12pt; }


    /* Prevent images/code blocks from breaking across pages badly */
    img, pre, blockquote, table, figure {
        page-break-inside: avoid;
    }

    /* Ensure images don't exceed page width */
    img {
        max-width: 100% !important;
        height: auto !important;
        display: block; /* Avoid weird inline spacing */
        margin: 1em 0; /* Add some space around images */
    }

    /* Basic table styling for print */
    table {
        border-collapse: collapse;
        width: 100%;
        margin: 1em 0;
    }
    th, td {
        border: 1px solid #ccc;
        padding: 4px;
        text-align: left;
    }
    th {
        background-color: #eee;
        font-weight: bold;
    }

    /* Code block styling */
    pre, code {
        font-family: 'Courier New', Courier, monospace;
        font-size: 10pt;
        background-color: #f8f8f8;
        border: 1px solid #ccc;
        padding: 5px;
        white-space: pre-wrap; /* Wrap long lines */
        word-wrap: break-word;
    }
    pre {
        padding: 10px;
    }

    /* List styling */
    ul, ol {
        margin: 1em 0 1em 2em; /* Indent lists */
    }
    li {
        margin-bottom: 0.5em;
    }
}
