/* HLMS Documentation Print Stylesheet
   Optimized for letter size (8.5" x 11") binder pages
*/

@media print {
    /* ==========================================
       Page Setup
       ========================================== */
    @page {
        size: letter;
        margin: 0.75in;
    }
    
    @page :first {
        margin-top: 1in;
    }
    
    /* ==========================================
       Hide Non-Print Elements
       ========================================== */
    .docs-nav,
    .docs-sidebar,
    .nav-search,
    .search-results,
    .nav-menu-toggle,
    .skip-link,
    .page-nav,
    .tip-box .tip-icon,
    .screenshot-placeholder::before {
        display: none !important;
    }
    
    /* ==========================================
       Reset Layout
       ========================================== */
    body {
        background: white;
        color: black;
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .docs-content {
        margin: 0;
        padding: 0;
        max-width: none;
    }
    
    .page-content {
        max-width: none;
    }
    
    /* ==========================================
       Typography
       ========================================== */
    h1 {
        font-size: 24pt;
        margin-bottom: 0.5em;
        color: black;
        border-bottom: 2pt solid #667eea;
        padding-bottom: 0.25em;
    }
    
    h2 {
        font-size: 18pt;
        margin-top: 1.5em;
        margin-bottom: 0.5em;
        color: black;
        page-break-after: avoid;
    }
    
    h3 {
        font-size: 14pt;
        margin-top: 1em;
        margin-bottom: 0.5em;
        color: black;
        page-break-after: avoid;
    }
    
    p, li {
        font-size: 12pt;
        orphans: 3;
        widows: 3;
    }
    
    /* ==========================================
       Page Breaks
       ========================================== */
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .step-box,
    .screenshot,
    .tip-box,
    .warning-box,
    pre {
        page-break-inside: avoid;
    }
    
    article {
        page-break-before: auto;
    }
    
    /* Force page break before major sections */
    .section-break {
        page-break-before: always;
    }
    
    /* ==========================================
       Links
       ========================================== */
    a {
        color: black;
        text-decoration: none;
    }
    
    /* Show URLs for external links */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
    
    /* Don't show URLs for internal navigation */
    .related-pages a::after,
    .breadcrumb a::after {
        content: none;
    }
    
    /* ==========================================
       Step Boxes (Print Optimized)
       ========================================== */
    .step-box {
        border: 1pt solid #ccc;
        border-left: 4pt solid #667eea;
        padding: 0.5em 1em;
        margin: 1em 0;
        background: white;
        box-shadow: none;
    }
    
    .step-number {
        background: #667eea;
        color: white;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* ==========================================
       Screenshots
       ========================================== */
    .screenshot {
        margin: 1em 0;
        page-break-inside: avoid;
    }
    
    .screenshot img {
        max-width: 100%;
        max-height: 4in;
        border: 1pt solid #ccc;
    }
    
    .screenshot-placeholder {
        border: 1pt dashed #999;
        padding: 1em;
        text-align: center;
        background: #f5f5f5;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .screenshot figcaption {
        font-size: 10pt;
        font-style: italic;
        text-align: center;
        margin-top: 0.5em;
    }
    
    /* ==========================================
       Tips and Warnings
       ========================================== */
    .tip-box {
        border: 1pt solid #667eea;
        padding: 0.5em 1em;
        margin: 1em 0;
        background: #f0f4ff;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .tip-box::before {
        content: "💡 Tip: ";
        font-weight: bold;
    }
    
    .warning-box {
        border: 1pt solid #f59e0b;
        border-left: 4pt solid #f59e0b;
        padding: 0.5em 1em;
        margin: 1em 0;
        background: #fffbeb;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .warning-box::before {
        content: "⚠️ Warning: ";
        font-weight: bold;
    }
    
    /* ==========================================
       Code Blocks
       ========================================== */
    pre {
        background: #f5f5f5;
        border: 1pt solid #ccc;
        padding: 0.5em;
        font-size: 10pt;
        overflow-x: visible;
        white-space: pre-wrap;
        word-wrap: break-word;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    code {
        font-size: 10pt;
        background: #f5f5f5;
    }
    
    /* ==========================================
       Tables
       ========================================== */
    table {
        width: 100%;
        border-collapse: collapse;
        margin: 1em 0;
        page-break-inside: avoid;
    }
    
    th, td {
        border: 1pt solid #ccc;
        padding: 0.5em;
        text-align: left;
        font-size: 11pt;
    }
    
    th {
        background: #f5f5f5;
        font-weight: bold;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* ==========================================
       Footer
       ========================================== */
    .page-footer {
        margin-top: 2em;
        padding-top: 1em;
        border-top: 1pt solid #ccc;
        font-size: 10pt;
        color: #666;
    }
    
    .related-pages {
        display: none;
    }
    
    .page-meta {
        text-align: center;
    }
    
    /* ==========================================
       Glossary Terms (Print)
       ========================================== */
    [data-glossary] {
        border-bottom: none;
        font-style: italic;
    }
    
    [data-glossary]::after {
        content: none;
    }
    
    /* ==========================================
       Student Pages (Print Optimized)
       ========================================== */
    .audience-student h1 {
        text-align: center;
        border-bottom: 4pt double #667eea;
    }
    
    .audience-student .page-tagline {
        text-align: center;
        font-size: 14pt;
        margin-bottom: 1em;
    }
    
    .audience-student .step-box {
        margin: 1.5em 0;
    }
    
    .audience-student .step-title {
        font-size: 16pt;
    }
    
    .audience-student .step-text {
        font-size: 14pt;
    }
    
    /* ==========================================
       Binder Hole Margin Adjustment
       ========================================== */
    /* Left pages get extra left margin for binder holes */
    @page :left {
        margin-left: 1in;
    }
    
    /* Right pages get extra right margin for binder holes */
    @page :right {
        margin-right: 1in;
    }
    
    /* ==========================================
       Header/Footer Content
       ========================================== */
    @page {
        @top-center {
            content: "HLMS Documentation";
            font-size: 10pt;
            color: #666;
        }
        
        @bottom-center {
            content: "Page " counter(page);
            font-size: 10pt;
            color: #666;
        }
    }
}

/* ==========================================
   Print Preview Helpers
   (visible in browser, for testing print layout)
   ========================================== */
.print-preview {
    max-width: 8.5in;
    margin: 0 auto;
    padding: 0.75in;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
