/* ============================================================
   Offline CV Generator — PRINT / PDF (A4)
   Prints ONLY the CV sheet: dashboard, editor and template
   library are hidden. Page breaks keep entries and headings
   intact across multi-page A4 output. Text stays selectable
   because every template is real HTML text (no images).
   ============================================================ */
@page{size:A4 portrait;margin:0}
@media print{
  html,body{background:#fff !important;margin:0 !important;padding:0 !important;height:auto !important;overflow:visible !important}
  /* hide the app chrome */
  .topbar,.sidebar,.editor,.preview-toolbar,.mobile-tabs,#toast,.modal-back,
  .lib-back,.no-print{display:none !important}
  .layout{display:block !important;height:auto !important}
  .main{display:block !important}
  .preview-pane{display:block !important;border:0 !important;background:#fff !important}
  .preview-scroll{display:block !important;padding:0 !important;overflow:visible !important;height:auto !important}
  #cvPreviewWrap{display:block !important}

  /* the sheet becomes exactly one A4 page wide; user margin is honoured */
  .cv-sheet{
    zoom:1 !important;
    width:210mm !important;max-width:none !important;min-height:297mm !important;
    margin:0 !important;padding:var(--pad-y,var(--sheet-pad)) !important;
    box-shadow:none !important;border-radius:0 !important;
    -webkit-print-color-adjust:exact !important;print-color-adjust:exact !important;
  }
  /* full-bleed templates keep their zero page padding */
  .tpl-corp-sidebar,.tpl-exec-darkpanel,.tpl-crea-darkside{--pad-y:0 !important}
  .tpl-corp-sidebar .cvcols,.tpl-exec-darkpanel .cvcols,.tpl-crea-darkside .cvcols{min-height:297mm !important}

  /* keep colour for banners, sidebars and rules */
  .cv-sheet *{ -webkit-print-color-adjust:exact !important;print-color-adjust:exact !important }

  /* ---- page-break behaviour ---- */
  .cv,.cvmain,.cvaside,.cvcols{break-inside:auto;page-break-inside:auto}
  .cve,.cvh,.ptbl,.cvf,.tbl tr,.cvs-body>.cve{break-inside:avoid;page-break-inside:avoid}
  .cvsh,.cve-h,.cve-line{break-inside:avoid;page-break-inside:avoid;break-after:avoid;page-break-after:avoid}
  .cvs{break-inside:auto;page-break-inside:auto}
  h1,h2,h3{break-after:avoid;page-break-after:avoid}
  .cvsh{break-before:auto}
  /* avoid an orphan heading at the very bottom of a page */
  .cvs{orphans:3;widows:3}
  a{color:inherit !important;text-decoration:none !important}
}
