/*
 * Safari-only resume layout (screen + print).
 * Scoped with html.safari — set in js/app.js (UA sniff excludes Chrome/Chromium/Edge).
 *
 * Tested: Safari 26.2 (WebKit 21623.1.14.11.9, macOS).
 */

@media (min-width: 48rem) {
  html.safari .resume-top-columns {
    grid-template-columns: 2.5fr 1fr;
    align-items: start;
    gap: 0 1.5rem;
  }

  html.safari aside.resume-sidebar,
  html.safari .resume-sidebar {
    border-top: none;
    border-left: 1px solid #ccc;
    padding-left: 1rem;
  }
}

@media print {
  /* Full-width work experience row — Safari print engine */
  html.safari .resume-top-columns {
    display: grid !important;
    grid-template-columns: 2.5fr 1fr !important;
    align-items: start !important;
    gap: 0 1rem !important;
  }

  html.safari .work-experience-section {
    grid-column: auto;
    width: 100%;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid #ccc;
  }

  html.safari .page-content .container {
    max-width: none;
  }

  html.safari main {
    padding: 0.5rem 1rem;
  }

  html.safari .page-content section {
    margin-bottom: 0.35rem;
  }

  /*
   * Do NOT use break-inside: avoid on whole job <section>s. Crunchy Bueno’s block
   * is tall (role + 3 projects); Safari keeps it unbroken and jumps it to the
   * next page, leaving a huge gap after Acts29’s last bullet.
   */
  html.safari .work-experience-section > section {
    break-inside: auto;
    page-break-inside: auto;
  }

  /* Prefer keeping a job title with the next line, without blocking the whole job */
  html.safari .work-experience-section > section > h3:first-of-type {
    break-after: avoid;
    page-break-after: avoid;
  }
}
