/* Print Stylesheet for WebPCDesigns Blog Posts */
/* Everything inside this block only applies to printing */
@media print {
    /* 1. Reset Backgrounds and Text Color */
    body {
        background-color: white !important;
        background-image: none !important;
        color: #000 !important; /* Pure black for maximum contrast */
        font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; /* Clean, standard web font */
        font-size: 12pt;
        line-height: 1.6;
        margin: 0;
        padding: 0;
    }
    
    /* 2. Lighten "Heavy" Text Elements */
    h1, h2, h3, h4, h5, h6 {
        color: #000 !important;
        page-break-after: avoid; /* Prevents headers from being left at the bottom of a page */
        font-weight: bold;
        margin-top: 1em;
        margin-bottom: 0.5em;
    }
    
    h1 { font-size: 24pt; }
    h2 { font-size: 20pt; }
    h3 { font-size: 16pt; }
    h4 { font-size: 14pt; }
    h5, h6 { font-size: 12pt; }
    
    /* 3. Remove Non-Essential Web Elements */
    nav, footer, .sidebar, .ad-banner, .social-share, .search-bar, 
    button:not(.print-button), .no-print, .glass-card.blog-categories,
    .newsletter-cta, header, .btn:not(.print-button), .blog-meta,
    .share-buttons, .related-posts, .author-info, .subscribe-box,
    form, input, select, textarea {
        display: none !important;
    }
    
    /* Show only printable content */
    .printable-section {
        display: block !important;
    }
    
    /* 4. Link Handling */
    a {
        text-decoration: none;
        color: #000 !important;
        font-weight: inherit;
    }
    
    /* Optional: Show the URL next to links so they aren't useless on paper */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        font-style: italic;
        color: #666;
    }
    
    /* Don't show URLs for anchor links or javascript links */
    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }
    
    /* 5. Image Management */
    img {
        max-width: 100% !important;
        height: auto;
        page-break-inside: avoid;
        display: block;
        margin: 1em auto;
    }
    
    /* 6. Page Margins */
    @page {
        margin: 2cm;
        size: letter;
    }
    
    /* 7. Table Formatting */
    table {
        width: 100%;
        border-collapse: collapse;
        page-break-inside: avoid;
        margin: 1em 0;
    }
    
    th, td {
        border: 1px solid #000;
        padding: 8px;
        text-align: left;
    }
    
    th {
        background-color: #f0f0f0 !important;
        font-weight: bold;
    }
    
    /* 8. Lists */
    ul, ol {
        margin: 1em 0;
        padding-left: 2em;
    }
    
    li {
        margin-bottom: 0.5em;
        page-break-inside: avoid;
    }
    
    /* 9. Blockquotes and Code */
    blockquote {
        border-left: 3px solid #000;
        padding-left: 1em;
        margin: 1em 0;
        font-style: italic;
        page-break-inside: avoid;
    }
    
    code, pre {
        font-family: "Courier New", Courier, monospace;
        font-size: 10pt;
        background-color: #f5f5f5 !important;
        border: 1px solid #ddd;
        padding: 0.2em 0.4em;
        page-break-inside: avoid;
    }
    
    pre {
        padding: 1em;
        overflow: visible;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
    
    /* 10. Page Break Management */
    .page-break-before {
        page-break-before: always;
    }
    
    .page-break-after {
        page-break-after: always;
    }
    
    .no-page-break {
        page-break-inside: avoid;
    }
    
    /* 11. Print-specific sections */
    .print-only {
        display: block !important;
    }
    
    .screen-only {
        display: none !important;
    }
    
    /* 12. Takeaway box styling */
    .takeaway-box {
        border: 2px solid #000;
        padding: 1em;
        margin: 2em 0;
        page-break-inside: avoid;
        background-color: #f9f9f9 !important;
    }
    
    .takeaway-box h2,
    .takeaway-box h3 {
        margin-top: 0;
        border-bottom: 1px solid #000;
        padding-bottom: 0.5em;
    }
    
    .takeaway-box ul {
        margin-bottom: 0;
    }
    
    /* 13. Warning/Alert Boxes */
    .warning-box,
    .alert-box,
    .tip-box {
        border: 2px solid #000;
        padding: 0.5em 1em;
        margin: 1em 0;
        page-break-inside: avoid;
    }
    
    .warning-box::before {
        content: "⚠ WARNING: ";
        font-weight: bold;
    }
    
    .tip-box::before {
        content: "💡 TIP: ";
        font-weight: bold;
    }
    
    /* 14. Ensure main content is visible */
    main, article, .blog-post-content, .main-content {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* 15. Remove shadows, borders, and decorative elements */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
        background-image: none !important;
    }
}

/* Non-print styles for print button */
@media screen {
    .print-button {
        background-color: #007bff;
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 5px;
        cursor: pointer;
        font-size: 14px;
        margin: 20px 0;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        transition: background-color 0.3s ease;
    }
    
    .print-button:hover {
        background-color: #0056b3;
    }
    
    .print-button i {
        font-size: 16px;
    }
}
