/* ============================================================
   ENHANCED A4 PRINT STYLESHEET FOR ALL 24 RESUME TEMPLATES
   Accurately preserves colors, backgrounds, fonts & layouts
   ============================================================ */

@media print {
    /* Page Configuration for A4 Print */
    @page {
        size: A4 portrait;
        margin: 0mm;
    }

    /* Preserve all background colors, gradients, borders and font colors */
    *, *::before, *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Clean resets for print document root */
    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        background: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Hide all UI bars, action buttons, alerts and navigation */
    .preview-actions,
    .print-preview-header,
    .print-preview-info,
    .template-switcher,
    .template-name-display,
    .no-print,
    .back-link,
    nav,
    header.site-header,
    footer,
    button,
    .btn,
    .alert {
        display: none !important;
    }

    /* Container Resets */
    .preview-container,
    .resume-preview,
    .print-preview-container {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
    }

    /* Resume Template Canvas Fit for A4 */
    .resume-template {
        margin: 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
        box-sizing: border-box !important;
        page-break-after: auto;
    }

    /* Page break prevention on headings & section titles */
    h1, h2, h3, h4, h5, h6,
    .primo-section-header,
    .cascade-side-title,
    .cubic-side-title,
    .crisp-section-title,
    .concept-section-title,
    .diamond-section-title,
    .enfold-section-title,
    .influx-section-title,
    .simple-section-title,
    .minimo-heading,
    .gold-section-header {
        page-break-after: avoid !important;
        break-after: avoid !important;
    }

    /* Multi-column Layouts: Retain 2-Column Flex in Print (Prevents Chromium CSS Grid column drop) */
    .primo-body-grid,
    .crisp-grid,
    .simple-body-grid,
    .gold-grid-container {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        width: 100% !important;
    }

    .primo-col-main,
    .crisp-col-main,
    .simple-col-main {
        width: 63% !important;
        flex: 0 0 63% !important;
        min-width: 0 !important;
    }

    .primo-col-side,
    .crisp-col-side,
    .simple-col-side {
        width: 34% !important;
        flex: 0 0 34% !important;
        min-width: 0 !important;
    }

    .gold-col-main {
        width: 62% !important;
        flex: 0 0 62% !important;
        min-width: 0 !important;
    }

    .gold-col-side {
        width: 35% !important;
        flex: 0 0 35% !important;
        min-width: 0 !important;
    }

    .zety-cascade-template,
    .cubic-body-wrap,
    .enfold-body {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
    }

    .doublebar-split-row,
    .adrian-bottom-grid {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        width: 100% !important;
    }

    .doublebar-split-row > div,
    .adrian-bottom-grid > div {
        width: 48% !important;
        flex: 0 0 48% !important;
    }

    /* Avoid breaks inside individual cards and timeline items */
    .mint-timeline-item,
    .mark-entry,
    .clark-item,
    .annori-timeline-item,
    .barry-exp-item,
    .adrian-exp-item,
    .janelle-card,
    .hannah-exp-item,
    .kyle-card,
    .emily-exp-card,
    .jessica-exp-item,
    .milissa-exp-item,
    .timeline-node,
    .dash-card,
    .chris-exp-item,
    .info-exp-item,
    .chart-exp-item,
    .block-card,
    .sage-exp-item,
    .gold-exp-item,
    .sand-exp-item,
    .charcoal-exp-item,
    .arch-exp-item,
    .doublebar-entry,
    .mint-aside-block,
    .mint-edu-item,
    .primo-timeline-block,
    .primo-tech-group,
    .primo-cert-card,
    .primo-skill-meter,
    .primo-summary-card,
    .cascade-exp-item,
    .cascade-tech-card,
    .cascade-side-section,
    .cubic-exp-item,
    .cubic-tech-group,
    .cubic-cert-card,
    .concept-rail-row,
    .concept-tech-card,
    .crisp-exp-item,
    .crisp-edu-item,
    .crisp-tech-group,
    .diamond-exp-item,
    .diamond-tech-card,
    .enfold-exp-item,
    .enfold-edu-item,
    .influx-exp-item,
    .influx-tech-card,
    .simple-exp-item,
    .minimo-exp-item,
    .gold-summary-content,
    .gold-badge-group,
    .gold-tech-table,
    .gold-cert-item {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* Links: Keep text clean without underline or trailing URL */
    a {
        text-decoration: none !important;
        color: inherit !important;
    }

    a[href^="http"]:after,
    a[href^="mailto"]:after {
        content: none !important;
    }

    /* Image preservation */
    img {
        max-width: 100% !important;
        page-break-inside: avoid !important;
    }
}