/* ==========================================================================
   CAYRES LABS — THE TYPESET AUDIT · print.css  (linked media="print")
   §3.10 step 8.1: "Print these findings" produces a clean one-page audit
   memo — black ink on white, Fraunces masthead, numbered citations, URL +
   date in the footer. Two modes:

   1. DEFAULT PRINT — any page prints as a clean document: no nav, no canvas,
      no buttons, no backgrounds.
   2. MEMO PRINT — the discovery widget adds `print-memo` to <body> (and sets
      data-print-date="cayreslabs.com · <date>" on .memo-plate) before calling
      window.print(): ONLY the memo plate prints, as a one-page memo.
   ========================================================================== */

@media print {
  /* ---- shared print base ------------------------------------------------- */
  :root {
    --paper: #fff;
    --paper-raised: #fff;
    --paper-deep: #fff;
    --rule: rgba(0, 0, 0, 0.4);
  }

  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html {
    background: #fff;
  }

  body {
    background: #fff !important;
    color: #000;
    font-size: 11pt;
    line-height: 1.5;
  }

  body::before,
  body::after {
    display: none !important;
  }

  /* page chrome and interactive/animated furniture never print */
  .running-header,
  .mobile-menu,
  .skip-link,
  .rh-cta,
  .btn-pill,
  .intake-submit,
  .chip-row,
  .chip-note,
  canvas,
  .vault-canvas-wrap,
  .monogram,
  .memo-actions,
  .memo-status,
  .switch,
  .booking,
  .colophon-col,
  video,
  iframe {
    display: none !important;
  }

  .section {
    padding-block: 24pt;
    overflow: visible;
  }

  .tone-paper,
  .tone-deep,
  .tone-raised,
  .colophon {
    background: #fff !important;
  }

  .vault {
    background: #fff !important;
    color: #000 !important;
    border-top: 1pt solid #000;
  }

  .vault .mono-label,
  .vault .folio-label,
  .vault .wf-booked,
  .vault .text-booked {
    color: #000 !important;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  /* citations resolve on paper: print href after rail links */
  .rail-note a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
  }

  .rail {
    position: static;
    border-left: 0;
    border-top: 1pt solid #000;
    padding-left: 0;
  }

  h1,
  h2,
  h3 {
    break-after: avoid;
  }

  .finding,
  .exhibit,
  .figure-plate,
  .letter,
  .limitations-placard {
    break-inside: avoid;
  }

  @page {
    margin: 18mm;
  }

  /* ==========================================================================
     MEMO MODE — body.print-memo: the plate alone, one page
     (visibility technique: works regardless of how deep the plate is nested)
     ========================================================================== */
  body.print-memo * {
    visibility: hidden;
  }

  body.print-memo .memo-plate,
  body.print-memo .memo-plate * {
    visibility: visible;
  }

  body.print-memo .memo-plate {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    border: 0;
    padding: 0 0 48pt;
    background: #fff;
    color: #000;
  }

  /* the memo never spills to a second sheet */
  body.print-memo {
    height: 257mm; /* A4 height minus margins */
    overflow: hidden;
  }

  /* Fraunces masthead */
  body.print-memo .memo-masthead {
    font-family: "Fraunces", Georgia, serif;
    font-size: 16pt;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: #000;
    border-bottom: 1.5pt solid #000;
    padding-bottom: 8pt;
    margin-bottom: 12pt;
  }

  body.print-memo .memo-masthead.is-fallback {
    color: #000;
  }

  body.print-memo .memo-finding {
    border-bottom: 0.5pt solid rgba(0, 0, 0, 0.35);
    padding-block: 6pt;
    break-inside: avoid;
  }

  body.print-memo .memo-finding-num {
    color: #000;
    font-weight: 700;
  }

  body.print-memo .memo-finding-text {
    text-align: justify;
  }

  body.print-memo .memo-total {
    border-top: 1.5pt solid #000;
    color: #000;
    font-weight: 700;
  }

  body.print-memo .memo-disclosure {
    color: #000;
    font-size: 8.5pt;
  }

  /* citations as a numbered list at the foot of the memo */
  body.print-memo .memo-citations {
    margin-top: 12pt;
    border-top: 0.5pt solid rgba(0, 0, 0, 0.35);
    padding-top: 6pt;
    font-size: 8.5pt;
  }

  body.print-memo .memo-citations li {
    margin-bottom: 3pt;
  }

  /* the gilt stamp prints as line art */
  body.print-memo .memo-stamp {
    visibility: visible;
    position: absolute;
    right: 0;
    bottom: 36pt;
    width: 96pt;
    color: #000;
  }

  /* URL + date footer — widget sets data-print-date="cayreslabs.com · <date>" */
  body.print-memo .memo-plate::after {
    content: attr(data-print-date);
    visibility: visible;
    position: absolute;
    left: 0;
    bottom: 12pt;
    font-family: "JetBrains Mono", monospace;
    font-size: 8pt;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #000;
    border-top: 0.5pt solid #000;
    padding-top: 6pt;
    width: 100%;
  }


  .no-print {
    display: none !important;
  }
}
