/* SmartCV A4 Sheet & Browser Print Engine */

/* Container wrapping template during live preview */
.preview-container {
    width: 210mm;
    min-height: 297mm;
    background: #ffffff;
    box-sizing: border-box;
    position: relative;
}

/* Universal Profile Photo Layout & Dimensions (Section 8) */
.profile-photo-wrap,
.photo-wrapper {
    width: 28mm;
    height: 28mm;
    max-width: 105px;
    max-height: 105px;
    min-width: 75px;
    min-height: 75px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border-radius: 50%;
    margin: 0 0 3mm 0;
    box-sizing: border-box;
}

.profile-photo-wrap img,
.photo-wrapper img,
.photo-img,
.profile-photo {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    object-position: center 20% !important;
    display: block !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: inherit !important;
}

.resume-sidebar .photo-wrapper,
.resume-sidebar .profile-photo-wrap {
    margin: 0 auto 5mm auto;
    display: flex;
}

/* Page Break Divider for visual cue during multi-page editing */
.page-break-indicator {
    position: absolute;
    top: 297mm;
    left: 0;
    right: 0;
    height: 2px;
    background: #ef4444;
    border-top: 1px dashed #ffffff;
    pointer-events: none;
    z-index: 10;
    display: flex;
    justify-content: flex-end;
}

.page-break-indicator::after {
    content: "Page 1 Break (297mm)";
    background: #ef4444;
    color: #ffffff;
    font-size: 8pt;
    padding: 1px 6px;
    font-family: sans-serif;
}

/* Print Rules */
@media print {
    html, body {
        width: 210mm !important;
        height: auto !important;
        min-height: 297mm !important;
        margin: 0 !important;
        padding: 0 !important;
        background: none !important;
        color: #000000 !important;
        font-size: 10pt !important;
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        position: static !important;
    }

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

    /* Hide all web application chrome */
    .navbar-wrapper,
    .builder-toolbar,
    .builder-editor-pane,
    .preview-controls-bar,
    .mobile-view-tabs,
    .mobile-preview-actions,
    .footer-wrapper,
    .toast-container,
    .modal-backdrop,
    .page-break-indicator,
    #pro-template-banner,
    .sr-only,
    .no-print,
    .builder-layout > h1,
    h1.sr-only {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        left: -9999px !important;
    }

    .builder-layout,
    .builder-workspace,
    .builder-preview-pane {
        display: block !important;
        background: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    .preview-scale-wrapper {
        transform: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        width: 210mm !important;
    }

    .preview-container {
        width: 210mm !important;
        box-shadow: none !important;
    }

    /* Avoid page cuts */
    h1, h2, h3, h4, .section-title, .exp-header, .edu-header, .project-header {
        page-break-after: avoid;
        break-after: avoid;
    }

    .exp-item, .edu-item, .project-item, .cert-item, .main-section, .sidebar-section, .section {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}
