@media print {
    @page {
        margin-top: 2.5cm;
        margin-bottom: 2cm;
        margin-left: 1.5cm;
        margin-right: 1.5cm;
    }

    /* 1. Hide EVERYTHING by default */
    body {
        visibility: hidden;
        background: white !important;
        color: black !important;
        margin: 0 !important;
        padding-top: 40px !important; /* Space for running header if needed */
    }
    
    body * {
        visibility: hidden;
    }

    /* Hide standard site elements explicitly */
    header, footer, nav, aside, .sidebar, .widget-area, .menu, 
    .comments-area, .respond, .comment-list, .sharedaddy, 
    .jp-relatedposts, .wpa-download-pdf-btn, .wpa-download-ris-btn, 
    .wpa-social-sharing, .cookie-notice, 
    .popup, .entry-title, .post-title, .admin-bar, #wpadminbar {
        display: none !important;
    }

    /* 2. Show only our Print View and its children */
    #wpa-print-view,
    #wpa-print-view * {
        visibility: visible;
    }

    #wpa-print-view {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        padding-bottom: 50px; /* Safety buffer for bottom of page */
        background: white;
        color: black;
    }

    /* 3. Running Header Styling (Footer) */
    .wpa-print-running-header {
        display: flex !important;
        justify-content: space-between !important;
        position: fixed !important;
        bottom: -1.2cm !important; /* Positioned 1.2cm below the content area */
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        border-top: 2px solid #000 !important; /* Border above footer text */
        padding-top: 5px !important;
        font-size: 10pt !important;
        color: #000 !important;
        z-index: 9999999 !important;
        background: white !important;
        visibility: visible !important;
    }
    
    .wpa-ph-left { 
        font-weight: bold !important; 
        text-align: left !important;
        flex: 1;
    }
    .wpa-ph-right { 
        font-style: italic !important; 
        text-align: right !important;
        flex: 1;
    }

    /* 4. Content Formatting */
    .wpa-print-only-header {
        display: block !important;
        text-align: center;
        margin-bottom: 30px;
        page-break-inside: avoid;
    }

    .wpa-print-title {
        font-size: 28pt;
        font-weight: bold;
        margin-bottom: 10px;
        text-align: center;
        color: #000 !important;
    }

    .wpa-print-meta {
        font-size: 14pt;
        margin-bottom: 5px;
        color: #000 !important;
    }

    .wpa-print-link {
        font-size: 10pt;
        color: #555 !important;
        margin-bottom: 20px;
    }

    /* 5. Standardized Boxes (Citation & TOC) */
    .wpa-print-citation-box,
    .wpa-toc-container {
        border: 1px solid #000;
        padding: 20px;
        text-align: left;
        margin: 20px auto;
        max-width: 90%;
        background: none !important;
        color: #000 !important;
        page-break-inside: avoid;
    }
    
    .wpa-print-citation-box h3,
    .wpa-toc-container .wpa-feature-box-title {
        margin-top: 0;
        font-size: 14pt;
        font-weight: bold;
        border-bottom: 2px solid #000;
        padding-bottom: 8px;
        margin-bottom: 15px;
        text-transform: uppercase;
        color: #000 !important;
    }

    /* TOC Specifics */
    .wpa-toc-container {
        page-break-after: always;
    }
    
    .wpa-toc-container ul {
        display: block !important;
        list-style-type: none;
        padding-left: 0;
    }

    .wpa-toc-container ul li {
        margin-bottom: 8px;
        font-size: 11pt;
        color: #000 !important;
    }

    .wpa-toc-arrow {
        display: none !important;
    }

    /* 6. Typography Overrides */
    p, h1, h2, h3, h4, li, a, span, div, strong, em {
        color: #000 !important;
    }
    
    h1 {
        font-size: 24pt;
        margin-bottom: 20px;
    }
    
    p {
        font-size: 12pt;
        line-height: 1.5;
        orphans: 3;
        widows: 3;
    }
    
    a {
        text-decoration: none !important;
    }

    /* Cleanup */
    .wpa-citation-container, 
    .wpa-social-sharing {
        display: none !important;
    }
}