/* ─────────────────────────────────────────────────────────────────────────────
   Executive City Travel — print.

   SOURCE OF TRUTH: DESIGN-BRIEF.md §9 — A4 portrait, 11pt, "no navy fills
   (ink)". §4, Print sheet — "black on white, no chrome". §3.5 — "Print is a
   first-class output."

   THIS FILE IS SERVED TO ANYONE WHO ASKS. It prints the site's own pages, and
   StaticAssetTests fails a block here that none of them carries.

   LINK THIS SHEET SEPARATELY, WITH media="print":

     <link rel="stylesheet" href="~/css/app.css" />
     <link rel="stylesheet" href="~/css/print.css" media="print" />

   It is deliberately NOT imported by app.css. A media="print" link is fetched
   at a lower priority and never blocks the first render of a page.

   Everything is still wrapped in @media print so the file is harmless if
   someone later links it without the attribute.

   TOKENS. Custom properties inherit through the DOM regardless of which
   stylesheet declared them, so app.css's :root values are available here. Every
   var() below nonetheless carries a literal fallback, so this sheet still
   produces a correct A4 page if it is ever printed on its own.

   ONE THING THIS SHEET DELIBERATELY DOES NOT DO: expand link URLs. The usual
   print trick of `a::after { content: " (" attr(href) ")" }` would put every
   address on the page onto paper, and a printed sheet is handed on and left on
   desks. Links print as their text and nothing more.
   ──────────────────────────────────────────────────────────────────────────── */

@media print {

  /* ═══ Page ════════════════════════════════════════════════════════════════
     A4 portrait at 11pt (§9). The margins are set for a domestic laser printer:
     14mm top and bottom, 12mm sides, comfortably inside the unprintable edge of
     every A4 device while still leaving a wide page room. */

  @page {
    size: A4 portrait;
    margin: 14mm 12mm;
  }

  html,
  body {
    /* pt, not px: a print stylesheet measured in px is at the mercy of the
       browser's assumed DPI. §9 says 11pt, so say 11pt. */
    font-size: 11pt;
    line-height: 1.35;
    background: #fff !important;
    color: #000 !important;
  }

  body {
    /* Undo the shells' min-height: 100dvh, which forces a mostly-blank second
       page on a short confirmation. */
    min-height: 0 !important;
    display: block !important;
    font-family: var(--font-sans, system-ui, sans-serif);
  }

  /* ═══ Ink only ════════════════════════════════════════════════════════════
     §9: "no navy fills (ink)". Everything is black on white. Two reasons
     beyond the brief's word: a navy fill on a mono laser prints as a grey wash
     that swallows the text on it, and on an inkjet it costs a cartridge.

     NOTE ON §2.2 vs §9: the colour table gives --navy-900 the job of "print
     headers", which reads as a colour-printed letterhead or the 600px email
     header of §4. §9's rule is about the pages that actually come out of an
     office printer, so §9 wins here. A colour-printed letterhead, if one is
     ever wanted, is a separate sheet and not an exception in this one.

     The universal selector is heavy-handed and that is the point: it catches
     every card, callout and tint without this file needing to know they
     exist. */

  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    /* Do not let the browser "helpfully" reinstate our backgrounds. */
    print-color-adjust: economy;
    -webkit-print-color-adjust: economy;
  }

  /* Borders stay, but in ink. They are what carries structure once the fills
     are gone — the callout's left rule and the card's edge are now the only
     thing distinguishing those elements. */
  .ect-card,
  .ect-callout,
  .ect-contact-block {
    border-color: #000 !important;
  }

  /* ═══ No chrome ═══════════════════════════════════════════════════════════
     §4: "no chrome". Navigation, actions and anything interactive are removed:
     none of it means anything on paper, and all of it costs paper.

     Hidden here rather than with a .ect-no-print class on each element, so a
     new component cannot forget to opt in. Anything that genuinely must print
     and happens to match one of these gets .ect-print-only, below. */

  .ect-skip,
  .ect-header,
  .ect-nav,
  .ect-navtoggle,
  .ect-footer,
  .ect-btn,
  .ect-actions,
  .ect-pagehead__actions,
  .ect-honeypot,
  .ect-no-print,
  form .ect-field__help,
  [hidden] {
    display: none !important;
  }

  /* The escape hatch: a print-only line — the sheet's date, a signature strip,
     the operator licence number on a confirmation (§11, OQ-5). Hidden on
     screen with [hidden] in markup, revealed here. */
  .ect-print-only,
  [hidden].ect-print-only {
    display: block !important;
  }

  /* ═══ Layout ══════════════════════════════════════════════════════════════
     Undo the shells. A printed page has one column and no containers. */

  .ect-shell,
  .ect-shell--public {
    display: block !important;
    min-height: 0 !important;
    grid-template-columns: none !important;
  }

  .ect-container,
  .ect-container--narrow,
  .ect-container--wide,
  .ect-shell__main {
    max-width: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .ect-card,
  .ect-callout,
  .ect-contact-block {
    border-radius: 0 !important;
    padding: 6pt 8pt !important;
  }

  .ect-section { padding-block: 0 !important; }

  /* ═══ Type ════════════════════════════════════════════════════════════════
     Scaled from the 11pt base. Playfair is kept for the title only — it
     identifies the company at a glance on a desk — and everything that has to
     be read quickly is the sans. */

  h1, .ect-pagehead__title {
    font-family: var(--font-display, Georgia, serif);
    font-size: 18pt;
    line-height: 1.2;
    margin-bottom: 4pt;
  }

  h2 { font-size: 14pt; line-height: 1.2; }
  h3 { font-size: 12pt; }
  h4, h5, h6 { font-size: 11pt; }

  .ect-lead,
  .ect-pagehead__subtitle { font-size: 11pt; }

  /* Links print as plain text — see the note at the top of this file about
     never printing an address. Underlines are dropped because on paper there is
     nothing to click and the underline only adds noise. */
  a,
  a:visited {
    text-decoration: none !important;
    color: #000 !important;
  }

  /* Never strand a single line of a paragraph across a page break. */
  p, li, blockquote {
    orphans: 3;
    widows: 3;
  }

  h1, h2, h3, h4 {
    break-after: avoid-page;
    page-break-after: avoid; /* legacy alias for older engines */
  }

  /* A card should not be split across two pages. */
  .ect-card,
  .ect-callout {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* ═══ Forms ═══════════════════════════════════════════════════════════════
     A printed form is a record, not an input. Controls keep their value and
     lose their chrome. */

  .ect-field__input {
    border: 0 !important;
    border-bottom: 0.5pt solid #000 !important;
    border-radius: 0 !important;
    padding: 1pt 0 !important;
    min-height: 0 !important;
  }

  select.ect-field__input { background-image: none !important; }

  /* ═══ Images ══════════════════════════════════════════════════════════════
     The site's photographs (§2.5) are context, not information. They cost ink
     and tell the reader nothing. */

  .ect-shell--public img,
  .ect-hero img {
    display: none !important;
  }

  /* The wordmark is the exception: it identifies whose sheet this is. */
  .ect-logo,
  .ect-logo__mark,
  .ect-logo__text {
    display: block !important;
    color: #000 !important;
  }

  .ect-logo { display: flex !important; margin-bottom: 6pt; }
}
