/*
 * c2l-print.css - opt-in print layer of the Coach2Lead design system.
 *
 * Inert unless used: rules target .c2l-print-* components or body.c2l-print-mode only, so no
 * existing page (legacy areas included) prints differently. A page opts in by rendering the
 * components and adding c2l-print-mode to <body> while it is shown. See DESIGN.md "Print".
 * Units: pt/mm for print, never the screen px scale. No background fills in print.
 */
:root {
  --c2l-print-font: var(--c2l-font-sans);
  --c2l-print-fg: var(--c2l-fg-1);
  --c2l-print-fg-muted: var(--c2l-fg-muted);
  --c2l-print-accent: var(--c2l-primary);
  --c2l-print-rule: #bfc4c7;
  --c2l-print-fs-body: 10pt;
  --c2l-print-fs-small: 8.5pt;
  --c2l-print-fs-table: 9pt;
  --c2l-print-fs-h1: 16pt;
  --c2l-print-fs-h2: 13pt;
  --c2l-print-fs-h3: 11pt;
  --c2l-print-tier-high: var(--c2l-orange-deep);
  --c2l-print-tier-limited: var(--c2l-secondary-deep);
  --c2l-print-tier-minimal: var(--c2l-green-deep);
  --c2l-print-tier-prohibited: var(--c2l-red-deep);
  --c2l-print-tier-none: var(--c2l-fg-muted);
  --c2l-print-stage-design: var(--c2l-blue-light);
  --c2l-print-stage-development: var(--c2l-blue-dark);
  --c2l-print-stage-testing: var(--c2l-purple);
  --c2l-print-stage-deployed: var(--c2l-primary-darker);
  --c2l-print-stage-decommissioned: var(--c2l-fg-3);
  --c2l-print-stage-none: var(--c2l-fg-muted);
}

/* ---- Screen: the sheet reads as an A4 preview ---- */
.c2l-print-sheet {
  width: 210mm;
  min-height: 297mm;
  margin: 16px auto;
  padding: 18mm 16mm 20mm;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .15);
  color: var(--c2l-print-fg);
  font-family: var(--c2l-print-font);
  font-size: var(--c2l-print-fs-body);
  line-height: 1.4;
}
.c2l-print-toolbar { display: flex; justify-content: flex-end; gap: 8px; width: 210mm; margin: 16px auto 0; }
.c2l-print-header { border-bottom: 1.5pt solid var(--c2l-print-accent); padding-bottom: 8pt; margin-bottom: 12pt; }
.c2l-print-header h1 { font-size: var(--c2l-print-fs-h1); margin: 0 0 2pt; color: var(--c2l-print-accent); }
.c2l-print-header .c2l-print-subtitle { font-size: var(--c2l-print-fs-small); color: var(--c2l-print-fg-muted); }
.c2l-print-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4pt 12pt; margin-top: 8pt; }
.c2l-print-facts dt { font-size: var(--c2l-print-fs-small); color: var(--c2l-print-fg-muted); text-transform: uppercase; letter-spacing: .03em; }
.c2l-print-facts dd { margin: 0 0 4pt; }
.c2l-print-section { margin-top: 12pt; }
.c2l-print-section > h2 { font-size: var(--c2l-print-fs-h2); color: var(--c2l-print-accent); border-bottom: .5pt solid var(--c2l-print-rule); padding-bottom: 2pt; margin: 0 0 6pt; }
.c2l-print-item > h3 { font-size: var(--c2l-print-fs-h3); margin: 8pt 0 4pt; }
.c2l-print-dl { display: grid; grid-template-columns: 38% minmax(0, 1fr); gap: 3pt 10pt; margin: 0; }
.c2l-print-dl dt { color: var(--c2l-print-fg-muted); }
.c2l-print-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.c2l-print-text { white-space: pre-line; min-width: 0; overflow-wrap: anywhere; }
.c2l-print-cite { color: var(--c2l-print-fg-muted); font-size: var(--c2l-print-fs-small); margin-left: 3pt; }
.c2l-print-missing { color: var(--c2l-print-fg-muted); font-size: var(--c2l-print-fs-small); font-style: italic; margin-top: 4pt; }
.c2l-print-table { width: 100%; border-collapse: collapse; font-size: var(--c2l-print-fs-table); margin: 2pt 0 6pt; table-layout: fixed; }
.c2l-print-table th { text-align: left; border-bottom: .75pt solid var(--c2l-print-fg); padding: 2pt 4pt; }
.c2l-print-table td { border-bottom: .5pt solid var(--c2l-print-rule); padding: 2pt 4pt; vertical-align: top; overflow-wrap: anywhere; }
.c2l-print-chip { display: inline-block; padding: 1pt 6pt; border-radius: 8pt; color: #fff; font-size: var(--c2l-print-fs-small); font-weight: 600; }
.c2l-print-chip--high { background: var(--c2l-print-tier-high); }
.c2l-print-chip--limited { background: var(--c2l-print-tier-limited); }
.c2l-print-chip--minimal { background: var(--c2l-print-tier-minimal); }
.c2l-print-chip--prohibited { background: var(--c2l-print-tier-prohibited); }
.c2l-print-chip--none { background: var(--c2l-print-tier-none); }
.c2l-print-chip--stage-design { background: var(--c2l-print-stage-design); }
.c2l-print-chip--stage-development { background: var(--c2l-print-stage-development); }
.c2l-print-chip--stage-testing { background: var(--c2l-print-stage-testing); }
.c2l-print-chip--stage-deployed { background: var(--c2l-print-stage-deployed); }
.c2l-print-chip--stage-decommissioned { background: var(--c2l-print-stage-decommissioned); }
.c2l-print-chip--stage-none { background: var(--c2l-print-stage-none); }

/* ---- Print ---- */
/* A NAMED page, used only by body.c2l-print-mode below. An unnamed @page would apply to every page
   that loads the design bundle (the version editor included) and break the opt-in contract. */
@page c2l-print {
  size: A4 portrait;
  margin: 18mm 16mm 20mm;
  @bottom-left { content: string(c2l-print-title); font-size: 8pt; color: #646c70; }
  @bottom-right { content: "Page " counter(page) " of " counter(pages); font-size: 8pt; color: #646c70; }
}

@media print {
  /* The named page goes on body, not on the sheet: switching from the default page to a named
     one on an element inside the document forces a page break before it, which printed a blank
     first page. On body the whole document starts on the named page. Removing c2l-print-mode
     removes it again, so no element uses the named page outside print mode. */
  body.c2l-print-mode { page: c2l-print; }
  /* The app's toastr notifications (angular-toastr containerId 'toast-container', e.g. the SignalR
     "Connected" toast) are fixed-position and would repeat on every printed page. */
  body.c2l-print-mode #toast-container,
  body.c2l-print-mode .topnavbar-wrapper,
  body.c2l-print-mode .aside,
  body.c2l-print-mode .offsidebar,
  body.c2l-print-mode footer,
  body.c2l-print-mode .c2l-print-toolbar { display: none !important; }
  body.c2l-print-mode .wrapper > section,
  body.c2l-print-mode .content-wrapper { margin: 0 !important; padding: 0 !important; background: #fff !important; }
  body.c2l-print-mode { background: #fff !important; }
  .c2l-print-sheet { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
  .c2l-print-header h1 { string-set: c2l-print-title content(); }
  .c2l-print-section > h2,
  .c2l-print-item > h3 { break-after: avoid; }
  .c2l-print-dl dt,
  .c2l-print-dl dd,
  .c2l-print-table tr { break-inside: avoid; }
  .c2l-print-table thead { display: table-header-group; }
  .c2l-print-chip { background: none !important; border: 1pt solid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .c2l-print-chip--high { color: var(--c2l-print-tier-high); border-color: var(--c2l-print-tier-high); }
  .c2l-print-chip--limited { color: var(--c2l-print-tier-limited); border-color: var(--c2l-print-tier-limited); }
  .c2l-print-chip--minimal { color: var(--c2l-print-tier-minimal); border-color: var(--c2l-print-tier-minimal); }
  .c2l-print-chip--prohibited { color: var(--c2l-print-tier-prohibited); border-color: var(--c2l-print-tier-prohibited); }
  .c2l-print-chip--none { color: var(--c2l-print-tier-none); border-color: var(--c2l-print-tier-none); }
  .c2l-print-chip--stage-design { color: var(--c2l-print-stage-design); border-color: var(--c2l-print-stage-design); }
  .c2l-print-chip--stage-development { color: var(--c2l-print-stage-development); border-color: var(--c2l-print-stage-development); }
  .c2l-print-chip--stage-testing { color: var(--c2l-print-stage-testing); border-color: var(--c2l-print-stage-testing); }
  .c2l-print-chip--stage-deployed { color: var(--c2l-print-stage-deployed); border-color: var(--c2l-print-stage-deployed); }
  .c2l-print-chip--stage-decommissioned { color: var(--c2l-print-stage-decommissioned); border-color: var(--c2l-print-stage-decommissioned); }
  .c2l-print-chip--stage-none { color: var(--c2l-print-stage-none); border-color: var(--c2l-print-stage-none); }
}
