/* v52 — fluid PDF pagination after Work Experience.
   Sections may split naturally; individual education/training/certificate entries stay intact. */
@media print {
  .resume [data-section-id="experience"],
  .resume [data-section-id="education"],
  .resume [data-section-id="training"],
  .resume [data-section-id="certificates"] {
    display: block !important;
    overflow: visible !important;
    contain: none !important;
    break-inside: auto !important;
    page-break-inside: auto !important;
    break-before: auto !important;
    page-break-before: auto !important;
  }

  /* Do not push an entire Education/Training/Certificates section to a new page. */
  .resume [data-section-id="education"] > h2,
  .resume [data-section-id="training"] > h2,
  .resume [data-section-id="certificates"] > h2 {
    margin-top: 10px !important;
    break-before: auto !important;
    page-break-before: auto !important;
    break-after: avoid-page !important;
    page-break-after: avoid !important;
  }

  /* Keep one qualification/course/certificate together, but allow the next entry
     to continue on the following page. This avoids the large empty page gap. */
  .resume [data-section-id="education"] > .item,
  .resume [data-section-id="training"] > .item,
  .resume [data-section-id="certificates"] > .item {
    break-inside: avoid-page !important;
    page-break-inside: avoid !important;
    margin-bottom: 10px !important;
  }

  .resume [data-section-id="education"] .item-top,
  .resume [data-section-id="training"] .item-top,
  .resume [data-section-id="certificates"] .item-top {
    break-inside: avoid-page !important;
    page-break-inside: avoid !important;
  }

  /* Experience can fragment bullet-by-bullet when needed. */
  .resume [data-section-id="experience"] > .item,
  .resume [data-section-id="experience"] li {
    break-inside: auto !important;
    page-break-inside: auto !important;
  }
}
