/* ===================================
   PRINT STYLES
   Optimized for printing
   =================================== */

@media print {

    /* === Reset === */
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* === Page Setup === */
    @page {
        margin: 2cm;
        size: A4;
    }

    /* === Typography === */
    body {
        font-family: Georgia, serif;
        font-size: 12pt;
        line-height: 1.5;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
        font-family: Arial, sans-serif;
    }

    h1 {
        font-size: 24pt;
    }

    h2 {
        font-size: 20pt;
    }

    h3 {
        font-size: 16pt;
    }

    h4 {
        font-size: 14pt;
    }

    h5,
    h6 {
        font-size: 12pt;
    }

    p {
        orphans: 3;
        widows: 3;
    }

    /* === Links === */
    a {
        text-decoration: underline;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #555;
    }

    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }

    /* === Images === */
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    /* === Tables === */
    table {
        border-collapse: collapse;
        width: 100%;
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group;
    }

    tr,
    img {
        page-break-inside: avoid;
    }

    th,
    td {
        border: 1pt solid #000;
        padding: 8pt;
    }

    /* === Blockquotes === */
    blockquote {
        border-left: 4pt solid #000;
        padding-left: 1em;
        page-break-inside: avoid;
    }

    /* === Code === */
    pre,
    code {
        font-family: 'Courier New', monospace;
        font-size: 10pt;
        border: 1pt solid #ddd;
        page-break-inside: avoid;
    }

    pre {
        padding: 8pt;
        white-space: pre-wrap;
    }

    /* === Hide Elements === */
    nav,
    header,
    footer,
    .breadcrumbs,
    .no-print,
    .sidebar,
    .navigation,
    .menu,
    .search,
    .comments,
    .social-share,
    .cta,
    button,
    form,
    video,
    audio,
    iframe {
        display: none !important;
    }

    /* === Show Content === */
    article,
    main {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* === Article Meta === */
    .entry-meta {
        font-size: 10pt;
        color: #666;
        margin-bottom: 1em;
        border-bottom: 1pt solid #ddd;
        padding-bottom: 0.5em;
    }

    /* === Featured Image === */
    .featured-image {
        margin-bottom: 1em;
    }

    /* === Page Breaks === */
    .page-break {
        page-break-before: always;
    }

    .page-break-after {
        page-break-after: always;
    }

    .avoid-break {
        page-break-inside: avoid;
    }
}