/* The datasheet (datasheet.html): one A4 sheet.

   Standalone - no Bootstrap - because it is a printed document rather than a
   page of the site, and print layout wants exact control over every margin.
   On screen it sits as a sheet on a grey desk with a toolbar above it; in print
   the desk and toolbar go and the sheet is the page. Colours are fixed rather
   than themed: a datasheet is the same on paper whatever the screen is set to. */

:root {
  --ds-blue: #0d5aa7;      /* --qp-header-blue */
  --ds-ink: #1d2329;
  --ds-muted: #555e67;     /* AA on white at the small sizes used here */
  --ds-rule: #cfd5db;
  --ds-tint: #eef3f9;
}

* { box-sizing: border-box; }

html { background: #d9dde1; }

body {
  margin: 0;
  padding: 16px;
  font-family: 'Barlow', system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 9.5pt;
  line-height: 1.35;
  color: var(--ds-ink);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.ds-toolbar {
  max-width: 210mm;
  margin: 0 auto 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 11pt;
}
.ds-toolbar a { color: #0b4c8c; }
.ds-toolbar button {
  font: inherit;
  color: #fff;
  background: var(--ds-blue);
  border: 0;
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
}

.ds-sheet {
  background: #fff;
  max-width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 12mm 13mm 10mm;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  display: flex;
  flex-direction: column;
}

h1, h2, h3, .ds-fig, .ds-brand span {
  font-family: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
}

/* ------------------------------------------------------------ head */
.ds-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 3mm;
  border-bottom: 2.5px solid var(--ds-blue);
}
.ds-brand { display: flex; align-items: center; gap: 10px; }
.ds-brand span { font-size: 18pt; font-weight: 600; color: var(--ds-blue); }
.ds-contact { text-align: right; font-size: 9pt; color: var(--ds-muted); }

.ds-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8mm;
  margin-top: 5mm;
}
.ds-kicker {
  font-size: 7.5pt;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ds-blue);
}
h1 { font-size: 24pt; font-weight: 600; line-height: 1.05; margin: 1mm 0 1mm; }
.ds-sub { margin: 0 0 2.5mm; color: var(--ds-muted); }
.ds-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ds-tags span {
  border: 1px solid var(--ds-rule);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 8.5pt;
}
/* The old site's photographs are small studio shots, so they are shown near
   natural size rather than stretched - as on the product page. */
.ds-photo { max-height: 42mm; max-width: 45mm; object-fit: contain; }

.ds-desc { margin: 4mm 0 0; }

/* ------------------------------------------------------------ figures */
.ds-figures {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 4mm;
  border: 1px solid var(--ds-rule);
  border-radius: 4px;
  background: var(--ds-tint);
}
.ds-figures > div { padding: 2.5mm 3.5mm; border-right: 1px solid var(--ds-rule); }
.ds-figures > div:last-child { border-right: 0; }
.ds-label, .ds-group h3 {
  font-size: 7pt;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ds-muted);
}
.ds-fig { font-size: 17pt; font-weight: 600; line-height: 1.1; }
.ds-fig small { font-size: 9pt; color: var(--ds-muted); font-weight: 500; }
.ds-note { font-size: 8pt; color: var(--ds-muted); margin: 0; }

/* ------------------------------------------------------------ blocks */
/* Only the curve is kept whole. A specification block that refused to
   break moved to page two in one piece on most pumps; its groups and table
   rows still keep themselves together. */
.ds-block { margin-top: 4.5mm; }
.ds-curve { break-inside: avoid; }
h2 { break-after: avoid; }
h2 {
  font-size: 12pt;
  font-weight: 600;
  margin: 0 0 2mm;
  padding-bottom: 1mm;
  border-bottom: 1px solid var(--ds-rule);
  color: var(--ds-blue);
}

.ds-curve svg { display: block; width: 100%; height: auto; }
.ds-curve .grid { stroke: #e3e7eb; stroke-width: 1; }
.ds-curve .frame { fill: none; stroke: #9aa3ab; stroke-width: 1; }
.ds-curve .curve { fill: none; stroke: var(--ds-blue); stroke-width: 2.25; stroke-linejoin: round; }
.ds-curve .bep { fill: #fff; stroke: var(--ds-blue); stroke-width: 2; }
.ds-curve .tick { font-size: 10px; fill: var(--ds-muted); }
.ds-curve .axis { font-size: 10.5px; fill: var(--ds-muted); font-weight: 600; }
.ds-curve .ds-note { margin-top: 1mm; }

.ds-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3mm 7mm;
}
.ds-group { break-inside: avoid; }
.ds-group h3 { margin: 0 0 1mm; }
.ds-group dl {
  display: grid;
  grid-template-columns: auto 1fr;
  margin: 0;
}
.ds-group dt, .ds-group dd {
  padding: .8mm 0;
  border-bottom: 1px solid #edf0f2;
}
.ds-group dt { color: var(--ds-muted); padding-right: 3mm; }
.ds-group dd { margin: 0; text-align: right; }

.ds-table { width: 100%; border-collapse: collapse; }
.ds-table th {
  text-align: left;
  font-size: 7.5pt;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ds-muted);
  border-bottom: 1px solid var(--ds-rule);
  padding: 1mm 2mm 1mm 0;
}
.ds-table td { padding: .9mm 2mm .9mm 0; border-bottom: 1px solid #edf0f2; vertical-align: top; }
.ds-table .num { text-align: right; }
.ds-table .code { font-family: ui-monospace, Consolas, monospace; font-size: 8.5pt; white-space: nowrap; }
.ds-table tr { break-inside: avoid; }

/* Prose and feature lists, on the control panel sheet. */
.ds-para { margin: 0 0 2mm; }
.ds-list { margin: 0 0 2mm; padding-left: 4.5mm; }
.ds-list li { margin-bottom: .6mm; }
.ds-group .ds-para + h3, .ds-group .ds-list + h3 { margin-top: 2mm; }

/* ------------------------------------------------------------ foot */
.ds-foot {
  margin-top: auto;
  padding-top: 4mm;
  display: flex;
  justify-content: space-between;
  gap: 6mm;
  font-size: 7.5pt;
  color: var(--ds-muted);
}
.ds-foot span:first-child { border-top: 1px solid var(--ds-rule); padding-top: 1.5mm; flex: 1; }
.ds-foot span:last-child { border-top: 1px solid var(--ds-rule); padding-top: 1.5mm; white-space: nowrap; }

/* ------------------------------------------------------------ screen, narrow */
@media screen and (max-width: 760px) {
  body { padding: 8px; }
  .ds-sheet { padding: 6mm 5mm; min-height: 0; }
  .ds-figures { grid-template-columns: 1fr 1fr; }
  .ds-figures > div:nth-child(2) { border-right: 0; }
  .ds-figures > div:nth-child(-n+2) { border-bottom: 1px solid var(--ds-rule); }
  .ds-specs { grid-template-columns: 1fr; }
  .ds-title { flex-direction: column; }
}

/* ------------------------------------------------------------ print */
/* The margins belong to the page, not the sheet, so a pump with a long list
   of part numbers that runs onto a second page keeps them there too. The
   sheet's own height is one page less the margins, which is what holds the
   footer to the bottom of a one-page sheet. */
/* Two pages is the ordinary length - a HIPPO 100 with its ten part numbers
   is about one and a half - so nothing is squeezed to fit one. The running
   footer (pump name, page of pages) sits in the page margin and is filled
   in by the template, which knows the name. */
@page {
  size: A4;
  margin: 11mm 13mm 14mm;
  @bottom-left, @bottom-right {
    font-family: 'Barlow', system-ui, sans-serif;
    font-size: 7.5pt;
    color: #555e67;
    vertical-align: top;
    padding-top: 3mm;
  }
}
@media print {
  html, body { background: #fff; padding: 0; }
  .ds-toolbar { display: none; }
  .ds-sheet { box-shadow: none; max-width: none; padding: 0; margin: 0; min-height: 0; }
  .ds-foot { margin-top: 5mm; }
}

/* Dimensions: the drawing beside the figures for its letters, kept on one
   page together - a table of letters cut away from its drawing is no use. */
.ds-dims { break-inside: avoid; }
.ds-dims-body { display: flex; gap: 6mm; align-items: center; }
/* One drawing size across makers, as on the product page. */
.ds-dims-body img { width: 58%; height: 90mm; object-fit: contain; }
.ds-dims-body .ds-table { flex: 1; width: auto; }
.ds-dims-body .letter { font-weight: 600; width: 6mm; }
.ds-dims-body .label { color: var(--ds-muted); }
/* A drawing that prints its own figures (Faggiolati's) has no table beside it
   and takes the width; it is a whole sheet, so it gets most of a page. */
.ds-dims-full { justify-content: center; }
.ds-dims-full img { width: auto; height: auto; max-width: 100%; max-height: 230mm; }  /* its figures are only in the drawing */
/* EVAK's quick-discharge pages letter up to 47 dimensions: drawing across the
   top, then the figures in two tables side by side, all inside the sheet. */
.ds-dims-wide { flex-wrap: wrap; align-items: flex-start; }
.ds-dims-wide img { width: 100%; height: 90mm; margin: 0 auto; }
.ds-dims-wide .ds-table { flex: 1 1 45%; }
