/* ============================================================================
   PRINT STYLESHEET — LGU Portal Pro
   Optimized print layout for certificates, reports, assembly minutes,
   news articles, and general public pages.
   ============================================================================ */

@media print {
    /* ─── Global Print Reset ─────────────────────────────────────────── */
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body {
        font-size: 11pt;
        line-height: 1.5;
        margin: 0;
        padding: 0;
        font-family: "Georgia", "Times New Roman", serif;
    }

    /* ─── Hide Non-Print Elements ────────────────────────────────────── */
    .utility-bar,
    .brand-header,
    .mega-nav-container,
    .offcanvas,
    .offcanvas-backdrop,
    .emergency-strip,
    .breadcrumb-strip,
    .footer-main,
    .footer-copyright,
    .footer-wave,
    #page-footer,
    .ai-chat-widget,
    .ai-chat-toggle,
    .cookie-consent,
    .btn-back-to-top,
    .skip-nav-link,
    .brgy-utility-strip,
    .brgy-alert-strip,
    .brgy-sidebar,
    .brgy-sidebar-toggle,
    .sidebar-toggle-btn,
    .admin-toolbar,
    .dark-mode-toggle,
    .notification-bell,
    nav[aria-label="Main Navigation"],
    nav[aria-label="Sidebar Navigation"],
    .mobile-nav-toggle,
    .btn-print-hide,
    .no-print,
    [data-no-print],
    .toast-container,
    .modal,
    .modal-backdrop,
    .dropdown-menu,
    .tooltip,
    .popover {
        display: none !important;
    }

    /* ─── Page Layout ────────────────────────────────────────────────── */
    #page-container {
        padding: 0 !important;
        margin: 0 !important;
    }

    #main-container {
        padding: 0 !important;
        margin: 0 auto !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .container,
    .container-xl,
    .container-lg,
    .container-md {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* ─── Typography ─────────────────────────────────────────────────── */
    h1 { font-size: 18pt; margin-bottom: 8pt; }
    h2 { font-size: 16pt; margin-bottom: 6pt; }
    h3 { font-size: 14pt; margin-bottom: 5pt; }
    h4 { font-size: 12pt; margin-bottom: 4pt; }
    h5, h6 { font-size: 11pt; margin-bottom: 3pt; }

    p {
        orphans: 3;
        widows: 3;
    }

    a {
        text-decoration: none !important;
    }

    /* Show URLs after links (optional — useful for informational pages) */
    .print-show-urls a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666 !important;
    }

    /* ─── Images ─────────────────────────────────────────────────────── */
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    /* ─── Tables ─────────────────────────────────────────────────────── */
    table {
        border-collapse: collapse !important;
        width: 100%;
    }

    th, td {
        border: 1px solid #333 !important;
        padding: 4pt 6pt;
        font-size: 10pt;
    }

    thead {
        display: table-header-group;
    }

    tr {
        page-break-inside: avoid;
    }

    /* ─── Cards → Simple bordered sections ───────────────────────────── */
    .card {
        border: 1px solid #ccc !important;
        margin-bottom: 10pt;
        page-break-inside: avoid;
    }

    .card-header {
        border-bottom: 1px solid #ccc !important;
        padding: 6pt 10pt;
        font-weight: bold;
    }

    .card-body {
        padding: 8pt 10pt;
    }

    /* ─── Badges → plain text ────────────────────────────────────────── */
    .badge {
        border: 1px solid #333 !important;
        padding: 1pt 4pt;
        font-size: 9pt;
        font-weight: normal;
    }

    /* ─── Page Breaks ────────────────────────────────────────────────── */
    .page-break-before { page-break-before: always; }
    .page-break-after { page-break-after: always; }
    .no-page-break { page-break-inside: avoid; }

    /* ─── Certificate-specific styles ────────────────────────────────── */
    .certificate-container {
        border: 3pt double #333 !important;
        padding: 30pt;
        margin: 20pt auto;
        max-width: 7in;
    }

    .certificate-header {
        text-align: center;
        border-bottom: 2pt solid #333 !important;
        padding-bottom: 15pt;
        margin-bottom: 20pt;
    }

    .certificate-header img {
        width: 80pt !important;
        height: auto;
    }

    .certificate-title {
        font-size: 20pt;
        font-weight: bold;
        text-transform: uppercase;
        letter-spacing: 2pt;
        margin: 10pt 0;
    }

    .certificate-body {
        font-size: 12pt;
        line-height: 1.8;
        text-align: justify;
    }

    .certificate-signatory {
        margin-top: 40pt;
        text-align: center;
    }

    .certificate-signatory .signature-line {
        border-top: 1pt solid #333 !important;
        display: inline-block;
        min-width: 200pt;
        margin-top: 30pt;
        padding-top: 4pt;
    }

    /* ─── Report / Minutes styles ────────────────────────────────────── */
    .report-header {
        text-align: center;
        margin-bottom: 20pt;
        padding-bottom: 10pt;
        border-bottom: 1pt solid #666 !important;
    }

    .report-meta {
        font-size: 10pt;
        color: #444 !important;
        margin-bottom: 15pt;
    }

    /* ─── News Article print layout ──────────────────────────────────── */
    .news-article-print .article-hero {
        max-height: 300pt;
        overflow: hidden;
    }

    .news-article-print .article-meta {
        font-size: 10pt;
        color: #444 !important;
        border-top: 1pt solid #ccc !important;
        border-bottom: 1pt solid #ccc !important;
        padding: 4pt 0;
        margin: 10pt 0;
    }

    /* ─── Barangay layout → full width for print ─────────────────────── */
    .brgy-layout .brgy-main {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .brgy-content-area {
        width: 100% !important;
        padding: 0 !important;
    }

    /* ─── Print Header / Footer ──────────────────────────────────────── */
    @page {
        size: A4;
        margin: 0.75in 0.75in 1in 0.75in;
    }

    @page :first {
        margin-top: 0.5in;
    }

    /* ─── Utility: Force print-visible ───────────────────────────────── */
    .print-only {
        display: block !important;
    }

    .print-block {
        display: block !important;
    }
}

/* Hidden by default, shown only in print */
.print-only {
    display: none;
}
