/* =========================================================================
   print.css — Cloud Hardening Guide
   -------------------------------------------------------------------------
   PRINT SKELETON — Phase 1; full polish in Phase 12 per PRINT-01..04.

   This stylesheet ships the minimum print rules required by PITFALLS.md
   A-6 so that printing or "Save as PDF" produces a usable artifact:
     - chrome (nav, sidebar, breadcrumb, copy/search affordances) hidden
     - gradients, shadows, and decorative backgrounds stripped
     - black-and-white serif typography for body
     - absolute URLs expanded inline after each link
     - page-break hygiene around the heavyweight blocks (control-box,
       threat-model, compliance-table, code blocks)
     - severity tags remain distinguishable without color (DS-07): each
       .sev gets a 1px solid #000 border so the icon+label channel
       survives a black-and-white print

   Constraints (enforced by Wave 0 lint scripts):
     - NO CSS custom properties (--foo:)         — DS-04
     - NO Flexbox / NO CSS Grid layout modes     — DS-02
     - Every hex literal MUST appear in css/main.css COLOR PALETTE block

   Authored: 2026-05-22 (Phase 01, Plan 06)
   ========================================================================= */

@media print {

  /* -----------------------------------------------------------------------
     Hide chrome that wastes paper. Sidebar, primary nav, breadcrumb, and
     interactive affordances (copy buttons, search, cross-provider
     equivalence pivots) carry no print value.
     ----------------------------------------------------------------------- */
  .sidebar,
  .site-header .nav-primary,
  .breadcrumb,
  .copy-btn,
  .search-box,
  .equivalence-link {
    display: none !important;
  }

  /* -----------------------------------------------------------------------
     Reset typography to a print-friendly serif. Body color forced to
     black; page background forced to white so any decorative texture
     from screen styles disappears.
     ----------------------------------------------------------------------- */
  body {
    font: 11pt/1.5 "Times New Roman", Georgia, serif;
    color: #000;
    background: #fff !important;
  }

  /* -----------------------------------------------------------------------
     Strip gradients, box shadows, and text shadows from EVERY element
     including ::before and ::after pseudo-elements. Skeuomorphic gloss
     does not survive ink; black-and-white printers render gradients as
     muddy halftones. Removing them up front guarantees clean output.
     ----------------------------------------------------------------------- */
  *,
  *::before,
  *::after {
    background: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* -----------------------------------------------------------------------
     Inline-expand URLs for absolute links so a printed citation remains
     navigable. Local fragment / relative links are skipped to avoid
     cluttering body text with "(./foo.html)" noise.
     ----------------------------------------------------------------------- */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    font-family: "Courier New", monospace;
  }

  /* -----------------------------------------------------------------------
     Page-break hygiene. Keep heavyweight blocks intact across page
     boundaries so a control's CLI snippet, IaC snippet, or compliance
     table does not split mid-row.
     ----------------------------------------------------------------------- */
  pre,
  table,
  .control-box,
  .threat-model,
  .compliance-table,
  .detection-runbook {
    page-break-inside: avoid;
  }

  /* -----------------------------------------------------------------------
     Severity tags must remain distinguishable without color (DS-07).
     A 1px solid black border preserves the tag boundary in B&W; the
     nested .sev-icon glyph and .sev-label uppercase text supply the
     other two channels.
     ----------------------------------------------------------------------- */
  .sev {
    border: 1px solid #000 !important;
  }

  /* -----------------------------------------------------------------------
     Control-box prints as an audit row: simple black frame, no gloss.
     ----------------------------------------------------------------------- */
  .control-box {
    border: 1px solid #000;
  }

  /* -----------------------------------------------------------------------
     Layout flatten. The float-based two-column layout collapses to a
     single column for print: main content fills the page, sidebar gone.
     ----------------------------------------------------------------------- */
  .main-content {
    margin-left: 0;
    padding: 0;
  }

  .wrapper {
    max-width: none;
    border: none;
  }

  /* -----------------------------------------------------------------------
     Image placeholders print as a dashed black box so the reader sees
     the missing diagram slot. The figcaption (prose description) carries
     the meaning per STD-05 / PITFALLS.md A-13.
     ----------------------------------------------------------------------- */
  .img-placeholder .img-placeholder-box {
    border: 1px dashed #000;
  }

  /* -----------------------------------------------------------------------
     PRINT-04: Control box prints as a checkbox-style audit row.
     The ::before pseudo-element on .control-header inserts a ballot-box
     glyph before the control ID so a printed page becomes a scannable
     audit checklist. CSS-only — no HTML modification needed.
     .control-header is <header class="control-header"> inside each
     <article class="control-box">, putting the checkbox inline with
     the control-id span.
     ----------------------------------------------------------------------- */
  .control-header::before {
      content: "\2610\0020";   /* ☐ U+2610 BALLOT BOX + U+0020 SPACE */
      font-size: 14pt;
      margin-right: 4px;
  }

}
