body {
    background-color: white;
}

.resume-container {
    box-shadow: none;
    margin: 0;
    padding: 20px;
    max-width: none;
}

/* Use CSS Grid for better print compatibility */
.item-header {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 15px !important;
    align-items: baseline !important;
    page-break-inside: avoid;
    break-inside: avoid;
}

.item-header h3 {
    margin-bottom: 0 !important;
    grid-column: 1 !important;
}

.date {
    white-space: nowrap !important;
    grid-column: 2 !important;
}

/* Keep section headers with at least some content */
h2 {
    page-break-after: avoid;
    break-after: avoid;
}

/* Keep individual items as complete blocks - don't split them */
.work-item, 
.education-item, 
.project-item, 
.leadership-item, 
.volunteer-item,
.skill-category, 
.certificate-item, 
.language-item, 
.interest-category {
    page-break-inside: avoid;
    break-inside: avoid;
}

/* Keep the graduation project within education item */
.project {
    page-break-inside: avoid;
    break-inside: avoid;
}

/* Keep list items together */
li {
    page-break-inside: avoid;
    break-inside: avoid;
}

/* Ensure header stays together */
.header {
    page-break-inside: avoid;
    break-inside: avoid;
}