/* =============================================================================
   ISS Investigations — print

   Loaded with media="print" from both layouts (includes/header.php and
   includes/app_header.php). Two jobs:

   1. A firm document prints as an official document: A4, a letterhead on the
      first page, ruled tables that repeat their headings across pages, a
      signature area that is never split, and a page footer carrying the page
      number on every sheet.
   2. Everything else — an article, a service page, a policy — prints as clean
      reading matter with no navigation, no buttons and no screenshots of UI.

   Rules are drawn with borders, never with background colours: Chrome skips
   background graphics by default, and an official document must not lose its
   frame because a print-dialog checkbox was off.
   ========================================================================== */

/* 1. The page ----------------------------------------------------------------- */

@page {
  size: A4;
  margin: 18mm 16mm 18mm;
}

/* Documents print on their own named page. The bottom margin carries the
   classification line and the page number on every sheet (CSS page-margin
   boxes: Chrome 131+, Firefox 128+; where unsupported the document's own
   footer still carries its reference). */
@page doc-page {
  size: A4;
  margin: 20mm 18mm 22mm;

  @bottom-left {
    content: "Confidential " "\2014" " issued for the named client only";
    font-family: "DM Sans", Arial, Helvetica, sans-serif;
    font-size: 6.8pt;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #545b68;
    vertical-align: top;
  }

  @bottom-right {
    content: "Page " counter(page) " of " counter(pages);
    font-family: "DM Sans", Arial, Helvetica, sans-serif;
    font-size: 7.4pt;
    color: #333a46;
    vertical-align: top;
  }
}

.doc-sheet { page: doc-page; }

/* 2. Print body ---------------------------------------------------------------- */

@media print {
  html, body {
    background: #fff !important;
    color: #000;
  }

  body {
    font-size: 10pt;
    line-height: 1.45;
    -webkit-font-smoothing: auto;
  }

  /* Nothing that belongs to the screen. */
  .site-header, .site-footer, .header-rail, .header-row, .nav, .nav-toggle,
  .enquiry-band, .callback-fab, .callback-toast, .callback-modal, .reading-progress,
  .app-side, .app-top, .app-foot, .app-burger, .app-timer, .who, .cmdk, .cmdk-trigger,
  .skip-link, .modal, .flash, .no-print, .toolbar, .admin-page-hero,
  .list-foot, .pagination, .crumbs, .post-share, .share-btn, .insights-rss, .post-tags,
  .post-siblings, .post-back, .post-related-section, .post-author .btn,
  .settings-page-nav, .settings-group-nav, .bulk-bar,
  .service-jump, .service-quote .btn, .kpi.is-quiet .k-sub,
  .invoice-lines-editor, .btn, .chip, .cookie-bar, .print-none {
    display: none !important;
  }

  /* The application shell collapses to a single column of paper. */
  .app, .app-main, .app-content, main {
    display: block !important;
    min-height: 0 !important;
  }
  .app-content, .app-main {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
  }
  .wrap, .container {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .section {
    padding-block: 0 !important;
    margin-block: 0 !important;
  }

  /* Cards and panels are screen furniture; the document supplies its own rules. */
  .panel, .card, .post-content-card, .statement-doc-panel, .prose-card {
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }
  .panel-body { padding: 0 !important; }
  .panel + .panel { margin-top: 6mm; }

  /* 3. The document ------------------------------------------------------------ */

  .doc-sheet {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    color: #000;
    font-size: 9.8pt;
    line-height: 1.45;
  }
  .doc-sheet p { margin: 0 0 2mm; }

  /* Letterhead */
  .doc-head { gap: 4mm 8mm; align-items: flex-start; }
  .doc-brand-lockup { gap: 3mm; }
  .doc-logo { width: 13mm; height: 13mm; border-radius: 1.5mm; }
  .doc-brand-name { font-size: 16pt; line-height: 1.05; }
  .doc-brand-meta { margin-top: 2mm; font-size: 7.6pt; line-height: 1.4; }
  .doc-brand-reg { margin-top: 2mm; font-size: 6.8pt; }
  .doc-kicker { font-size: 7pt; letter-spacing: .18em; }
  .doc-ref { font-size: 14pt; }
  .doc-status {
    margin-top: 2mm;
    padding: .6mm 1.6mm;
    border-width: .4pt;
    font-size: 6.6pt;
    color: #000 !important;
  }
  .doc-facts { margin-top: 2mm; font-size: 7.2pt; }
  .doc-id-note { font-size: 6.8pt; }
  .doc-rule {
    height: 0;
    margin: 3.5mm 0 4mm;
    border-top: 1.2pt solid #0b1220;
  }
  .doc-rule::after {
    top: -1.2pt;
    width: 14mm;
    border-top: 1.2pt solid #b8955a;
  }

  /* Who / what / when */
  .doc-parties {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3mm 7mm;
    margin-bottom: 4mm;
  }
  .doc-party h2 { margin-bottom: 1mm; font-size: 6.2pt; letter-spacing: .12em; }
  .doc-party-body { font-size: 8.8pt; line-height: 1.4; }

  /* Body sections */
  .doc-doc-title { margin: 2mm 0 3mm; font-size: 13pt; }
  .doc-section { margin: 0 0 3.5mm; }
  .doc-section h2 { margin-bottom: 1.2mm; font-size: 9.6pt; }
  .doc-prose { font-size: 9.4pt; line-height: 1.5; }
  .doc-prose p { margin-bottom: 1.8mm; }
  .doc-meta-line { margin: 0 0 3mm; font-size: 6.8pt; }
  .doc-url { font-size: 7.4pt; }
  .doc-hash { font-size: 6.4pt; }

  /* Tables: headings repeat, rows never split, numbers stay aligned. */
  .doc-table {
    margin: 0 0 3mm;
    font-size: 8.6pt;
  }
  .doc-table thead { display: table-header-group; }
  .doc-table tr { break-inside: avoid; page-break-inside: avoid; }
  .doc-table th, .doc-table td { padding: 1.3mm 1.6mm; }
  .doc-table thead th { font-size: 6.8pt; }
  .doc-statement-lines { font-size: 7.6pt; }
  .doc-custody-table { font-size: 7.2pt; }
  .doc-custody-table td code { font-size: 6.4pt; }

  /* Account summary */
  .doc-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 4mm;
    break-inside: avoid;
  }
  .doc-summary > div { padding: 1.8mm 2mm; }
  .doc-summary span { font-size: 6.4pt; }
  .doc-summary b { font-size: 9.2pt; }
  .doc-summary .doc-summary-note { font-size: 6.8pt; }

  /* Payment block, notices, signatures */
  .doc-pay { padding: 2.5mm 3mm; }
  .doc-pay-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 2.5mm; }
  .doc-pay-grid dt { font-size: 6.4pt; }
  .doc-pay-grid dd { font-size: 8.6pt; }
  .doc-notice { margin-bottom: 3mm; padding: 2mm 2.6mm; font-size: 8.2pt; break-inside: avoid; }
  .doc-signatures { margin-top: 5mm; break-inside: avoid; }
  .doc-signatures-head { font-size: 6.2pt; }
  .doc-sign-grid { gap: 6mm; }
  .doc-sign-rule { height: 12mm; }
  .doc-sign-label { font-size: 6.4pt; }
  .doc-sign b { font-size: 8.4pt; }
  .doc-sign-detail { font-size: 6.8pt; }

  /* Footer */
  .doc-foot {
    margin-top: 6mm;
    padding-top: 2mm;
    border-top: .8pt solid #0b1220;
    font-size: 6.8pt;
    break-inside: avoid;
  }
  .doc-foot-top { gap: 3mm 7mm; }
  .doc-foot-brand b { font-size: 7.2pt; }
  .doc-foot-verify span:first-child { font-size: 6.2pt; }
  .doc-foot-verify b { font-size: 8pt; }
  .doc-foot-bar { margin-top: 2.5mm; padding-top: 1.6mm; font-size: 6.2pt; }
  .doc-qr svg { width: 18mm; height: 18mm; }
  .doc-qr span { font-size: 5.8pt; }

  /* Draft watermark: a light veil so a draft can never be mistaken for the
     issued copy, and one that repeats on every page of a long report. */
  .doc-watermark {
    position: fixed;
    inset: 0;
    z-index: -1;
    font-size: 110pt;
    color: rgba(0, 0, 0, .055) !important;
  }

  /* Elements that were screen-only or sticky keep printing as plain blocks. */
  .service-aside { position: static !important; }
  .settings-save-actions { position: static !important; box-shadow: none !important; }
  .kpi.is-quiet { display: block !important; }

  /* 4. Page-break discipline ---------------------------------------------------- */

  h1, h2, h3, h4 { break-after: avoid; page-break-after: avoid; }
  .doc-section h2, .doc-doc-title { break-after: avoid; page-break-after: avoid; }
  .doc-parties, .doc-summary, .doc-signatures, .doc-foot, .doc-notice, .doc-pay {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  p, li { orphans: 3; widows: 3; }
  figure, img, svg { break-inside: avoid; }
  img { max-width: 100% !important; }

  /* 5. Reading pages: articles, services, policies ------------------------------ */

  .post-article, .post-content-card { max-width: none; }
  .post-content-card img, .post-article img { max-width: 100%; height: auto; }
  .post-toc {
    border: .5pt solid #999;
    background: #fff !important;
    padding: 3mm 4mm;
    break-inside: avoid;
  }
  .post-toc a { text-decoration: none; }
  .reading-time, .post-meta { color: #333; }

  a { color: inherit !important; text-decoration: none !important; }

  /* 6. Print-only credit -------------------------------------------------------- */

  .print-credit {
    display: block !important;
    margin-top: 8mm;
    padding-top: 2mm;
    border-top: .5pt solid #999;
    font-size: 7.4pt;
    line-height: 1.5;
    color: #444;
  }
  .print-credit b { color: #000; }
}

/* 7. Colour control -------------------------------------------------------------- */

.doc-rule, .doc-rule::after, .doc-status, .doc-watermark {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
