/* ============================================
   FORSETI UNIVERSAL PRINT STYLESHEET
   Applies when user prints or saves as PDF
   Strips themed colors, forces B&W, manages page breaks
   ============================================ */

@media print {

    /* ─── PAGE SETUP ─── */
    @page {
        size: letter;
        margin: 0.75in;
    }

    /* ─── RESET ALL COLORS TO BLACK ON WHITE ─── */
    body,
    .document-page,
    .tos-page,
    .tos-container,
    .section-content,
    .subsection,
    .acknowledgment-section,
    .summary-block,
    .royal-callout,
    .warning-callout,
    .phase-card,
    .doc-body,
    .doc-body p,
    table,
    th,
    td {
        background: white !important;
        color: black !important;
        border-color: #999 !important;
        box-shadow: none !important;
    }

    /* ─── FORCE ALL TEXT TO BLACK ─── */
    h1, h2, h3, h4, h5, h6,
    .doc-title, .doc-subtitle,
    .section-heading, .section-title,
    .doc-header h1, .doc-header .subtitle, .doc-header .entity-line,
    .toc-header h1, .tos-header p,
    .phase-card h4, .phase-card .stat, .phase-card .label,
    .summary-block h3,
    .doc-footer p, .doc-footer .copyright,
    .revenue-cell,
    strong, b {
        color: black !important;
        background: white !important;
    }

    /* ─── REMOVE THEMED BACKGROUNDS ─── */
    .print-bar,
    .gold-divider,
    .hero-divider,
    .doc-header,
    .site-nav,
    .site-floating-contact,
    .sticky-cta-bar,
    .back-to-top-float,
    .legal-print-btn,
    .legal-print-wrap,
    .frp-dev-footer,
    .site-nav-toggle,
    .footer,
    .footer-logos,
    img[src*="symbol"],
    img[src*="banner"] {
        display: none !important;
    }

    /* ─── KEEP LOGO BUT DESATURATE ─── */
    .doc-emblem {
        filter: grayscale(100%) contrast(1.2);
        width: 80px !important;
    }

    /* ─── BORDERS: SIMPLE BLACK/GRAY ─── */
    .document-page::before,
    .document-page::after {
        display: none !important;
    }

    .section-heading,
    .section-title {
        border-bottom: 2px solid black !important;
        font-size: 13pt !important;
        margin-top: 20px !important;
    }

    .royal-callout,
    .warning-callout,
    .emphasis-box {
        border: 1px solid #999 !important;
        border-left: 3px solid #666 !important;
        background: #f9f9f9 !important;
        padding: 12px 15px !important;
        margin: 12px 0 !important;
    }

    .summary-block {
        border: 2px solid #666 !important;
        padding: 15px !important;
    }

    .acknowledgment-section {
        border: 2px solid #666 !important;
        padding: 20px !important;
    }

    /* ─── TABLES: CLEAN B&W ─── */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin: 12px 0 !important;
    }

    th {
        background: #eee !important;
        color: black !important;
        border: 1px solid #999 !important;
        font-weight: bold !important;
        padding: 6px 8px !important;
    }

    td {
        border: 1px solid #ccc !important;
        padding: 6px 8px !important;
        color: black !important;
    }

    tr:nth-child(even) {
        background: #f5f5f5 !important;
    }

    tr:hover {
        background: white !important;
    }

    /* ─── PHASE CARDS: SIMPLE BOXES ─── */
    .phase-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
    }

    .phase-card {
        border: 1px solid #999 !important;
        padding: 10px !important;
        background: white !important;
    }

    /* ─── ADVANTAGE LIST: PLAIN NUMBERS ─── */
    .advantage-list li::before {
        background: #ddd !important;
        color: black !important;
    }

    .acknowledgment-list li::before {
        color: black !important;
    }

    /* ─── FONTS: KEEP READABLE ─── */
    body {
        font-family: Georgia, 'Times New Roman', serif !important;
        font-size: 11pt !important;
        line-height: 1.6 !important;
    }

    .section-heading,
    .section-title,
    .doc-title,
    .doc-header h1,
    .phase-card h4,
    .summary-block h3,
    th {
        font-family: Georgia, 'Times New Roman', serif !important;
    }

    /* ─── PAGE BREAK RULES ─── */

    /* Never break inside these elements */
    table,
    tr,
    th,
    td,
    .royal-callout,
    .warning-callout,
    .emphasis-box,
    .summary-block,
    .acknowledgment-section,
    .phase-card,
    .phase-grid {
        page-break-inside: avoid !important;
    }

    /* Break before major sections */
    .section-heading,
    .section-title {
        page-break-after: avoid !important;
        page-break-before: auto !important;
    }

    /* Each numbered TOS section can start on a new page if near bottom */
    .section-title {
        page-break-before: auto !important;
    }

    /* Keep headers with their content */
    h1, h2, h3, h4,
    .section-heading,
    .section-title {
        page-break-after: avoid !important;
    }

    /* Footer always at bottom of last page */
    .doc-footer,
    .tos-doc-footer {
        page-break-before: auto !important;
        margin-top: 30px !important;
    }

    /* ─── LINKS: SHOW URL IN PRINT ─── */
    a[href^="mailto:"]::after,
    a[href^="http"]::after,
    a[href^="/"]::after {
        content: "" !important;
    }

    a {
        color: black !important;
        text-decoration: underline !important;
    }

    /* ─── REMOVE ANIMATIONS & TRANSITIONS ─── */
    * {
        transition: none !important;
        animation: none !important;
    }
}