/* ===== Base page setup ===== */
@page {
  size: A4;
  /* Top / Right / Bottom / Left */
  margin: 18mm 14mm 20mm 14mm;

  /* Repeating header & footer using margin boxes */
  @top-center {
    content: element(pageHeader);
  }
  @bottom-center {
    content: element(pageFooter);
  }
}

/* ===== Global print reset ===== */
html, body {
  margin: 0 !important;
  padding: 0 !important;
  background: #fff !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
*, *::before, *::after { box-sizing: border-box; }

/* Kill on-screen layout that breaks pagination */
.no-print { display: none !important; }
[style*="position: sticky"], .sticky { position: static !important; }
[style*="position: fixed"], .fixed { position: static !important; }
[style*="transform"], .transform { transform: none !important; }
.scroll, .overflow-auto, .overflow-scroll { overflow: visible !important; max-height: none !important; }

/* Don't use 100vh in print; it clips pages */
.full-height, [style*="100vh"] { height: auto !important; }

/* Typography / orphans & widows */
p, li { orphans: 3; widows: 3; }
h1, h2, h3 { break-after: avoid; break-inside: avoid; margin-top: 0; }

/* Keep logical blocks together */
.section,
.experience-item,
.education-item,
.skills-block,
.table,
.card {
  break-inside: avoid;
  page-break-inside: avoid;
}

/* Images never overflow; don't split */
img { max-width: 100%; break-inside: avoid; }

/* ===== Running header/footer content ===== */
.page-header {
  position: running(pageHeader);
  font: 700 10pt/1.4 Inter, system-ui, sans-serif;
  color: #475569; /* slate-600 */
  padding: 6mm 0 4mm 0;
  border-bottom: 0.4pt solid #D1D5DB; /* thin line */
}

.page-footer {
  position: running(pageFooter);
  font: 500 9pt/1.4 Inter, system-ui, sans-serif;
  color: #64748B; /* slate-500 */
  padding: 4mm 0 2mm 0;
  border-top: 0.4pt solid #D1D5DB;
  display: flex;
  justify-content: space-between;
}

/* Optional columns inside footer */
.footer-left  { }
.footer-right { }

/* Main resume container */
.resume-page {
  /* Let @page margins define print area; avoid extra padding */
  margin: 0 !important;
  padding: 0 !important;
}

/* Kill on-screen spacing that bleeds into print */
.app, .resume-root, .resume-container {
  margin: 0 !important;
  padding: 0 !important;
  width: auto;
  max-width: none;
  background: white !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* Resume drawer and UI elements - hide in print */
.resume-drawer, .resume-drawer-overlay, .resume-drawer-header,
.resume-drawer-actions, .resume-drawer-content {
  display: none !important;
}

/* Ensure proper text colors for print */
.resume-name, .fortune-name, .section-title, .fortune-section-title,
.job-title, .fortune-job-title, .education-degree, .fortune-education-degree {
  color: #000 !important;
}

.resume-text, .bullet-item, .fortune-bullet-item, .professional-summary,
.fortune-summary, .contact-item, .contact-value {
  color: #333 !important;
}

.job-company, .fortune-job-company, .job-dates, .fortune-job-dates,
.education-details, .fortune-education-details {
  color: #666 !important;
}

/* Remove background colors and gradients for print */
.template-modern, .template-generic, .template-technical,
.template-executive, .template-creative {
  background: white !important;
}

.skills-category, .fortune-skills-list {
  background: white !important;
  border: none !important;
}

/* Ensure bullets and borders are visible */
.bullet-item::before, .fortune-bullet-item::before,
.summary-bullet::before {
  color: #000 !important;
}

.section-title::before, .fortune-section-title {
  background: #000 !important;
}

/* Remove any shadows, borders, or decorative elements that don't print well */
.card, .resume-container {
  box-shadow: none !important;
  border: none !important;
}

/* Ensure proper spacing for print */
.resume-section, .fortune-section {
  margin: 1rem 0 !important;
}

.job-entry, .fortune-job-entry, .education-entry, .fortune-education-entry {
  margin-bottom: 1rem !important;
}

/* Contact info should be compact for print */
.contact-container, .contact-info {
  margin-bottom: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

/* Skills should be compact */
.skills-section, .skills-category {
  margin: 0.25rem 0 !important;
}
