/* Print layout (0.2.0), see js/ui/print.js.
   While printing, <body> has the class "printing" plus a paper class (paper-A4 / paper-A3) and an
   orientation class (portrait / landscape). The map then gets a fixed size in millimetres that fits
   on that paper with 10 mm margins, leaving room for the title above and the legend below.
   The @page size itself is added by print.js (CSSOM), because it depends on the user's choice. */

.print-only { display: none; }

/* ---- the same layout on screen (as a preview) and on paper ---- */
body.printing .toolbar, body.printing aside, body.printing footer, body.printing .drop,
body.printing .ol-zoom, body.printing .ol-rotate { display: none !important; }
body.printing main { display: block; overflow: auto; }
body.printing .sheet { display: block; flex: none; margin: 0 auto; background: #fff; }
body.printing .print-only { display: block; }
body.printing .map { flex: none; }

/* map size per paper (width x height in mm; content area = paper minus 2 x 10 mm margin) */
body.printing.paper-A4.portrait .sheet, body.printing.paper-A4.portrait .map { width: 190mm; }
body.printing.paper-A4.portrait .map { height: 205mm; }
body.printing.paper-A4.landscape .sheet, body.printing.paper-A4.landscape .map { width: 277mm; }
body.printing.paper-A4.landscape .map { height: 125mm; }
body.printing.paper-A3.portrait .sheet, body.printing.paper-A3.portrait .map { width: 277mm; }
body.printing.paper-A3.portrait .map { height: 320mm; }
body.printing.paper-A3.landscape .sheet, body.printing.paper-A3.landscape .map { width: 400mm; }
body.printing.paper-A3.landscape .map { height: 200mm; }

#printHead h2 { margin: 0 0 1mm; font-size: 16pt; }
#printHead p { margin: 0; font-size: 9pt; color: #333; }
#printHead { margin-bottom: 2mm; }
#printFoot { display: none; margin-top: 2mm; font-size: 9pt; }
body.printing #printFoot { display: flex; gap: 6mm; align-items: flex-start; justify-content: space-between; }
#printFoot .print-legend-box ul { list-style: none; margin: 0; padding: 0; columns: 3; column-gap: 6mm; }
#printFoot .print-legend-box h3 { margin: 0 0 1mm; font-size: 10pt; }
#printFoot .print-legend-box li .n, #printFoot .print-legend-box li .lg-n { margin-left: 2mm; }          /* 0.2.0: space between name and count on paper */
#printFoot .print-meta { text-align: right; white-space: nowrap; }
#printFoot .north { font-size: 14pt; font-weight: bold; margin: 0; }
#printFoot p { margin: 0; }
#printFoot .print-credit { font-size: 7.5pt; color: #444; margin-top: 1mm; }   /* 0.2.2: GWSW source line */
body.printing .map-popup { display: none !important; }
/* 0.3.0-m5: the table of pipes is never printed; the map is printed also from the view "Tabel" */
body.printing .pipe-table-box { display: none !important; }
body.printing .sheet.view-tabel .map { display: block !important; }
#printFoot .print-note { font-size: 8pt; margin-top: 1mm; }                          /* no popup on paper (0.2.2; class name 0.2.3) */
.map .ol-scale-bar { left: 8px; bottom: 8px; }

@page { margin: 10mm; }

@media print {
  html, body { height: auto; }
  body { display: block; }
  /* print the colours of swatches and lines exactly (browsers drop backgrounds by default) */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* printing without the Afdrukken tab (Ctrl+P): at least hide the controls */
  .toolbar, aside, footer, .drop, .ol-zoom, .ol-rotate { display: none !important; }
  main { display: block; }
}
