/* ═══════════════════════════════════════════════
   ABORN POWERS — print.css
   Browser print / Save as PDF stylesheet.
   Only activates during window.print().
   ═══════════════════════════════════════════════ */

@media print {

  /* ── Page setup — letter, no margins (pages handle own padding) ── */
  @page {
    size: 8.5in 11in portrait;
    margin: 0;
  }

  /* ── Force color printing ── */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  /* ── Reset body ── */
  html, body {
    width: 8.5in !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: white !important;
  }

  /* ── Hide everything ── */
  body > * {
    display: none !important;
  }

  /* ── Show only the app shell, then drill down ── */
  body > .app-shell {
    display: block !important;
  }

  .app-shell > * {
    display: none !important;
  }

  /* Show only the canvas wrap */
  .app-shell > .canvas-wrap {
    display: block !important;
    width: 8.5in !important;
    overflow: visible !important;
  }

  .canvas-wrap > * {
    display: none !important;
  }

  /* Show only proposal output — not home screen, not toolbar */
  .canvas-wrap > #canvas-scroll {
    display: block !important;
    overflow: visible !important;
    padding: 0 !important;
    background: white !important;
    width: 8.5in !important;
  }

  #canvas-scroll > * {
    display: none !important;
  }

  #canvas-scroll > #proposal-output {
    display: block !important;
    width: 8.5in !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    background: white !important;
    /* Critical: NOT position:fixed — that collapses multi-page output */
    position: static !important;
  }

  /* ── Each proposal page = one printed page ── */
  .proposal-page {
    display: block !important;
    width: 8.5in !important;
    min-height: 11in !important;
    height: 11in !important;
    max-height: 11in !important;
    padding: 0.75in 0.85in !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
    overflow: hidden !important;
    position: relative !important;
    background: white !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;

    /* Page break after every page */
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* No trailing blank page after the last one */
  .proposal-page:last-of-type {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  /* ── Cover page: remove top padding (has its own layout) ── */
  .page-cover {
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }

  .cover-main {
    padding: 0.5in 0.85in 0.3in !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }

  .cover-footer {
    margin: 0 !important;
    padding: 0.3in 0.85in !important;
  }

  /* Cover logo needs top padding since cover has no overall padding */
  .cover-logo {
    margin: 0.6in 0.85in 0 !important;
    display: block !important;
  }

  /* ── Page header ── */
  .page-header {
    margin-bottom: 0.3in !important;
  }

  /* ── Page footer — pin to bottom ── */
  .page-footer {
    position: absolute !important;
    bottom: 0.2in !important;
    left: 0.85in !important;
    right: 0.85in !important;
  }

  /* ── Quill: hide chrome, show content ── */
  .ql-toolbar,
  .ql-clipboard,
  .ql-tooltip,
  .ql-container .ql-editor::before {
    display: none !important;
  }

  .ql-editor {
    padding: 0 !important;
    border: none !important;
    overflow: visible !important;
    min-height: 0 !important;
  }

  .ql-region {
    outline: none !important;
    border: none !important;
  }

  /* ── Hide contenteditable outlines ── */
  [contenteditable="true"] {
    outline: none !important;
    border: none !important;
    cursor: default !important;
  }

  /* ── Tables: keep together ── */
  .extras-table,
  .project-mgmt-table {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    width: 100% !important;
  }

  /* ── Hide browser extension injections ── */
  grammarly-extension,
  grammarly-desktop-integration,
  [data-grammarly-shadow-root],
  [id^="grammarly"],
  [class*="grammarly"],
  [id^="lp_"],
  [class*="lastpass"],
  [id^="dashlane"],
  [class*="dashlane"],
  [id^="1password"],
  [class*="onepassword"],
  .lp_password_wrapper,
  iframe[src*="grammarly"],
  iframe[src*="lastpass"],
  /* Catch injected fixed-position overlays */
  body > div[style*="z-index: 2147483"],
  body > div[style*="z-index:2147483"] {
    display: none !important;
    visibility: hidden !important;
  }

}
