/**
 * TechVorta Print Stylesheet
 * Clean, professional article layout for printing and PDF export
 */

@media print {

    /* ── Hide non-essential UI ──────────────────────────── */
    #masthead,
    #tv-ticker,
    .tv-ticker,
    #tv-search-overlay,
    #tv-consent-banner,
    #tv-consent-modal,
    .tv-share-bar,
    .tv-reactions,
    .tv-related,
    .tv-sidebar,
    .tv-comments,
    #respond,
    .tv-newsletter-widget,
    .tv-pagination,
    .tv-reading-progress,
    #tv-reading-progress,
    #tv-scroll-top,
    .tv-load-more,
    .tv-bookmark-btn,
    .tv-toc-toggle,
    .tv-ad,
    .tv-adsense,
    [id*="adsense"],
    footer,
    nav,
    .tv-breaking-ticker { display: none !important; }

    /* ── Page setup ──────────────────────────────────────── */
    @page {
        margin: 1.5cm 2cm;
        size: A4 portrait;
    }

    @page :first {
        margin-top: 2.5cm;
    }

    /* ── Reset to print-friendly base ───────────────────── */
    *,
    *::before,
    *::after {
        background: #fff !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
        border-color: #ccc !important;
    }

    html, body {
        font-size: 11pt;
        line-height: 1.6;
        color: #000 !important;
        background: #fff !important;
    }

    /* ── Typography ──────────────────────────────────────── */
    h1, h2, h3, h4, h5, h6 {
        font-family: Georgia, 'Times New Roman', serif !important;
        color: #000 !important;
        page-break-after: avoid;
        line-height: 1.25;
    }

    h1 { font-size: 22pt; margin-bottom: .5cm; }
    h2 { font-size: 16pt; margin-top: .6cm; }
    h3 { font-size: 13pt; margin-top: .4cm; }

    p, li {
        font-family: Georgia, 'Times New Roman', serif !important;
        font-size: 11pt;
        line-height: 1.7;
        orphans: 3;
        widows: 3;
    }

    /* ── Links ───────────────────────────────────────────── */
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }

    /* Print full URL after links in content */
    .tv-post-content a[href]::after {
        content: " (" attr(href) ")";
        font-size: 8pt;
        color: #666 !important;
        word-break: break-all;
    }

    /* But not for navigation or icon links */
    a[href^="#"]::after,
    a[href^="javascript:"]::after { content: "" !important; }

    /* ── Post header ─────────────────────────────────────── */
    .tv-post-header {
        border-bottom: 2pt solid #000 !important;
        padding-bottom: .5cm;
        margin-bottom: .75cm;
    }

    .tv-post-title {
        font-size: 22pt !important;
        color: #000 !important;
        margin-bottom: .3cm;
    }

    .tv-meta {
        font-size: 9pt !important;
        color: #555 !important;
        border-top: 1pt solid #ccc !important;
        padding-top: .25cm;
        margin-top: .3cm;
    }

    /* ── Publication masthead for print ─────────────────── */
    .tv-post-content::before {
        content: "TechVorta — Intelligence · Precision · Impact | techvorta.com";
        display: block;
        font-size: 8pt;
        color: #888 !important;
        text-align: center;
        border-bottom: 1pt solid #ccc !important;
        padding-bottom: .3cm;
        margin-bottom: .5cm;
        font-family: Arial, sans-serif !important;
        letter-spacing: .05em;
    }

    /* ── Images ──────────────────────────────────────────── */
    img {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid;
    }

    .tv-post-thumb,
    .tv-featured-image {
        margin-bottom: .5cm;
        page-break-after: avoid;
    }

    .tv-post-thumb img {
        max-height: 8cm;
        object-fit: cover;
        width: 100% !important;
    }

    /* ── Table of Contents ───────────────────────────────── */
    .tv-toc {
        background: #f5f5f5 !important;
        border: 1pt solid #ccc !important;
        border-radius: 0 !important;
        padding: .4cm .6cm !important;
        margin-bottom: .6cm;
        page-break-inside: avoid;
    }

    .tv-toc-head { border-bottom: 1pt solid #ccc !important; padding-bottom: .2cm; margin-bottom: .3cm; }
    .tv-toc a::after { content: "" !important; }
    .tv-toc a { text-decoration: none !important; }

    /* ── Review box ──────────────────────────────────────── */
    .tv-review-box {
        border: 2pt solid #000 !important;
        padding: .5cm !important;
        margin: .5cm 0 !important;
        page-break-inside: avoid;
    }

    .tv-rb-fill {
        background: #000 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    /* ── Code blocks ─────────────────────────────────────── */
    pre, code {
        font-family: 'Courier New', monospace !important;
        font-size: 9pt !important;
        background: #f5f5f5 !important;
        border: 1pt solid #ddd !important;
        padding: .1cm .2cm !important;
        page-break-inside: avoid;
        white-space: pre-wrap !important;
        word-break: break-word !important;
    }

    /* ── Blockquotes ─────────────────────────────────────── */
    blockquote {
        border-left: 3pt solid #000 !important;
        padding-left: .4cm !important;
        margin-left: 0 !important;
        font-style: italic;
        page-break-inside: avoid;
    }

    /* ── Tables ──────────────────────────────────────────── */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        page-break-inside: auto;
        font-size: 9pt !important;
    }

    tr { page-break-inside: avoid; page-break-after: auto; }
    thead { display: table-header-group; }
    tfoot { display: table-footer-group; }

    th, td {
        border: 1pt solid #ccc !important;
        padding: .1cm .2cm !important;
        text-align: left !important;
    }

    th { background: #f0f0f0 !important; font-weight: bold; }

    /* ── Disclosure / Sponsored ──────────────────────────── */
    .tv-disclosure {
        border: 1pt solid #ccc !important;
        padding: .3cm !important;
        font-size: 9pt !important;
        font-style: italic;
        page-break-inside: avoid;
        margin-bottom: .4cm;
    }

    /* ── Footer credit ───────────────────────────────────── */
    .tv-post-content::after {
        content: "© " counter(year) " TechVorta. All rights reserved. Printed from techvorta.com";
        display: block;
        margin-top: 1cm;
        padding-top: .3cm;
        border-top: 1pt solid #ccc !important;
        font-size: 8pt;
        color: #888 !important;
        text-align: center;
        font-family: Arial, sans-serif !important;
    }

    /* ── Page numbers ────────────────────────────────────── */
    .tv-post-content {
        counter-reset: page;
    }
}
