/* Sevenridge – Druckansicht der Auswertung („Als PDF speichern“).
   Der Bericht (#sr-print-root) wird von js/views/reports.js nur zum Drucken aufgebaut und ist auf dem Bildschirm
   unsichtbar. Gedruckt wird immer hell: hier stehen deshalb nur feste Palette-Tokens (--sr-*), keine
   modusabhängigen Bootstrap-Variablen (--bs-*). Schriften und Tokens kommen aus sevenridge-tokens.css. */

#sr-print-root { display: none; }

/* Eigene Seite für den Bericht: A4 hoch, Inhaltsbreite 190 mm. Seitenzahl und Fußtext stehen in den Randfeldern
   (Chromium/Edge/Chrome; andere Browser drucken ohne Randfelder, der Bericht endet dann mit einer Schlusszeile). */
@page sr-report {
  size: A4 portrait;
  margin: 14mm 10mm 18mm 10mm;
  @bottom-left { content: var(--sr-pr-foot, ""); font-family: var(--sr-font-body); font-size: 8pt; line-height: 1.25; color: var(--sr-stone); width: 72%; text-align: left; vertical-align: top; padding-top: 4mm; padding-right: 6mm; overflow-wrap: anywhere; }
  @bottom-right { content: "Seite " counter(page) " von " counter(pages); font-family: var(--sr-font-body); font-size: 8pt; line-height: 1.25; color: var(--sr-stone); text-align: right; white-space: nowrap; vertical-align: top; padding-top: 4mm; font-variant-numeric: tabular-nums; }
}

@media print {
  html.sr-printing,
  html.sr-printing body {
    background: var(--sr-white) !important;
    color: var(--sr-deep-ridge) !important;
    color-scheme: light !important; /* auch bei dunkler App: weißes Papier, keine dunklen Randflächen */
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  /* Oberfläche (Navigation, Formulare, Knöpfe, Hinweise, Toasts) ausblenden */
  html.sr-printing body > *:not(#sr-print-root) { display: none !important; }

  html.sr-printing #sr-print-root {
    display: block;
    page: sr-report;
    font-family: var(--sr-font-body);
    font-size: 9pt;
    line-height: 1.4;
    color: var(--sr-deep-ridge);
    background: var(--sr-white);
  }
  #sr-print-root * { box-sizing: border-box; }

  /* Briefkopf */
  #sr-print-root .pr-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8mm; padding-bottom: 5mm; border-bottom: 2px solid var(--sr-leaf); }
  #sr-print-root .pr-logo { display: block; width: 58mm; height: auto; }
  #sr-print-root .pr-kind { flex: none; font-family: var(--sr-font-heading); font-weight: 600; font-size: 8pt; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sr-stone); }
  #sr-print-root .pr-title { font-family: var(--sr-font-heading); font-weight: 600; font-size: 22pt; letter-spacing: -0.015em; line-height: 1.15; margin: 6mm 0 3mm; color: var(--sr-deep-ridge); }
  #sr-print-root .pr-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 2mm 8mm; margin: 0 0 5mm; padding: 3mm 4mm; background: var(--sr-mesa-sand); border-radius: 1.5mm; }
  #sr-print-root .pr-meta > div { break-inside: avoid; min-width: 0; }
  #sr-print-root .pr-meta dt { font-size: 8pt; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--sr-stone); }
  #sr-print-root .pr-meta dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

  /* Überschriften und Blöcke */
  #sr-print-root h2 { font-family: var(--sr-font-heading); font-weight: 600; font-size: 11.5pt; letter-spacing: -0.01em; margin: 0 0 1.5mm; color: var(--sr-deep-ridge); break-after: avoid; }
  #sr-print-root .pr-block { margin: 0 0 5mm; }
  #sr-print-root .pr-chart { break-inside: avoid; }
  #sr-print-root .pr-tracks-head { margin-bottom: 2mm; break-after: avoid; }
  #sr-print-root .pr-keep { break-inside: avoid; }
  #sr-print-root .pr-note { margin: 0 0 1mm; font-size: 8pt; color: var(--sr-stone); }

  /* Diagramme (als Bild in Druckbreite) */
  #sr-print-root .pr-img { display: block; width: 100%; height: auto; max-width: 100%; }
  #sr-print-root .pr-fig { margin: 0 0 1.5mm; break-inside: avoid; }
  #sr-print-root .pr-fig figcaption { font-size: 8.5pt; font-weight: 600; margin-bottom: 0.5mm; break-after: avoid; }
  #sr-print-root .pr-zi, #sr-print-root .pr-sum { margin: 1.5mm 0 0; padding-left: 4.5mm; font-size: 8.5pt; }
  #sr-print-root .pr-zi li, #sr-print-root .pr-sum li { margin-bottom: 0.6mm; }
  #sr-print-root .pr-sum { margin-bottom: 5mm; }

  /* Tabellen: Kopfzeile wiederholt sich auf jeder Seite, Zeilen werden nicht geteilt */
  #sr-print-root .pr-table { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
  #sr-print-root .pr-table thead { display: table-header-group; }
  #sr-print-root .pr-table tfoot { display: table-footer-group; }
  #sr-print-root .pr-table tr { break-inside: avoid; }
  #sr-print-root .pr-table th, #sr-print-root .pr-table td { padding: 1mm 2mm; text-align: left; vertical-align: top; border-bottom: 0.3mm solid var(--sr-mist); }
  #sr-print-root .pr-table thead th { font-weight: 600; color: var(--sr-deep-ridge); border-bottom: 0.5mm solid var(--sr-leaf); }
  #sr-print-root .pr-table tbody th { font-weight: 500; }
  #sr-print-root .pr-table tbody tr:nth-child(even) > * { background: var(--sr-mesa-sand); }
  #sr-print-root .pr-table .num { text-align: right; font-family: var(--sr-font-mono); white-space: nowrap; }
  #sr-print-root .pr-table.pr-long td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
  #sr-print-root .pr-table.pr-long td:nth-child(3) { white-space: nowrap; }
  #sr-print-root .pr-table strong { font-weight: 700; }

  #sr-print-root .pr-end { margin: 4mm 0 0; font-size: 8pt; color: var(--sr-stone); text-align: center; }
}
