/* ==============================================================
   print.css - GETAXS Career Suite
   Critical: works for Latin, Arabic, Turkish, Ukrainian
   ============================================================== */

@page {
    size: A4;
    margin: 0;
}

@media print {
    /* Force color/background preservation across all browsers */
    *,
    *::before,
    *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* Hide all UI chrome */
    .topbar,
    .steps,
    .editor,
    .preview-toolbar,
    .foot,
    .toast-wrap,
    .translate-popover,
    .no-print {
        display: none !important;
    }

    html, body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .layout {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }

    .preview-wrap {
        position: static !important;
    }

    .preview-frame {
        background: #fff !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        box-shadow: none !important;
    }

    /* CV paper */
    .cv-paper {
        box-shadow: none !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
        border-radius: 0 !important;
        /* No forced min-height and no forced page break — let content flow
           naturally so a short last line never jumps to an empty page */
        min-height: auto !important;
        page-break-after: auto;
        page-break-inside: auto;
    }

    /* Prevent item splitting across pages */
    .cv-item,
    .cv-skill,
    .cv-skill-side {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Anschreiben paragraphs: allow them to break if long, so the closing
       line and attachments are not pushed onto a second page unnecessarily */
    .ans-paragraph {
        page-break-inside: auto;
        break-inside: auto;
    }

    /* Keep the signature and attachments together with the greeting */
    .ans-greeting,
    .ans-signature,
    .ans-attachments {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Sidebar template — keep both columns on same page */
    .tpl-sidebar {
        page-break-inside: avoid;
    }

    /* Headings shouldn't be orphaned */
    .cv-section-title,
    .cv-side-title {
        page-break-after: avoid;
        break-after: avoid;
    }

    /* Anschreiben paper */
    .ans-paper {
        box-shadow: none !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
        border-radius: 0 !important;
        min-height: auto !important;
        page-break-after: auto;
    }

    /* Photo quality */
    .cv-photo,
    .ans-photo {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Links: don't show URL after text */
    a, a:visited {
        text-decoration: none !important;
        color: inherit !important;
    }
    a[href]::after {
        content: "" !important;
    }
}
