/* 1-pager pages: one template for every product and service sheet (generated by scripts/build-onepagers.py).
   Everything is sized in em from one base (9.2pt, the A4 body size of the visual guide), so the screen
   version is the print version scaled up. Sheet width 64.6em = 210 mm at 9.2pt. */

@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/dm-sans-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/dm-sans-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

body {
  font-family: var(--nsf-font);
  font-size: 13px;
  line-height: 1.32;
  color: var(--nsf-ink);
  background: var(--nsf-white);
  -webkit-font-smoothing: antialiased;
}

/* 1-pager pages: one template for every product and service sheet (generated by scripts/build-onepagers.py).
   Everything is sized in em from one base (9.2pt, the A4 body size of the visual guide), so the screen version is
   the print version scaled up. Sheet width 64.6em = 210 mm at 9.2pt. */
.op-sheet {
  display: flex;
  flex-direction: column;
  width: 64.6em;
  min-height: 91.4em;
  margin: 0 auto;
  background: var(--nsf-white);
}

/* ---------- hero: title and summary left, logo right, centered on each other ---------- */
.op-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 2.6em;
  align-items: center;
  background: var(--nsf-navy);
  color: var(--nsf-white);
  padding: 2.2em 3.7em 2.4em;
}
/* the summary is exactly as wide as the title, never wider; a 34 em floor keeps it at two lines under a short title
   (the column has 38.6 em: 64.6 sheet minus 7.4 padding, 2.6 gap and the 16 em logo) */
.op-hero-text { display: grid; width: max-content; min-width: 34em; max-width: 100%; justify-self: start; }
.op-title { font-size: 2.174em; font-weight: 700; line-height: 1.05; margin-bottom: 0.5em; }
.op-summary { width: 0; min-width: 100%; font-size: 1.033em; line-height: 1.25; color: var(--nsf-light-blue); text-wrap: wrap; }
.op-logo { display: block; width: 16em; height: auto; margin-top: 0.15em; }

/* ---------- main: full width text, text beside a square picture, proof ---------- */
.op-main { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 1em; padding: 1.8em 3.7em 1.2em; }

.op-block + .op-block { margin-top: 1.3em; }
.op-block h2 {
  font-size: 1.033em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--nsf-navy);
  padding-bottom: 0.4em;
  border-bottom: 0.0925em solid var(--nsf-blue-gray);
  margin-bottom: 0.7em;
}
.op-block p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 12 6 6; }
/* sub- and superscripts (T<sub>e</sub>, 10<sup>19</sup>) must not stretch their line: zero line height, shifted relatively */
.op-sheet sub, .op-sheet sup { font-size: 0.75em; line-height: 0; position: relative; vertical-align: baseline; }
.op-sheet sup { top: -0.5em; }
.op-sheet sub { bottom: -0.25em; }

/* a tinted panel: the same text on the brand light blue, heading without the rule */
.op-panel { background: var(--nsf-light-blue); padding: 0.9em 1.1em 1em; }
.op-panel h2 { border-bottom: 0; padding-bottom: 0; margin-bottom: 0.5em; }

.op-mid { display: grid; grid-template-columns: 1fr 22em; column-gap: 2.4em; align-items: start; }

.op-list { list-style: none; }
.op-list li { position: relative; padding-left: 1.3em; }
.op-list li + li { margin-top: 0.45em; }
.op-list li::before { content: ''; position: absolute; left: 0; top: 0.42em; width: 0.5em; height: 0.5em; background: var(--nsf-cyan); }

/* the picture space is always the same: a 22 em square */
.op-figure { width: 22em; }
.op-figure img { display: block; width: 22em; height: 22em; object-fit: cover; }
.op-figure figcaption { margin-top: 0.5em; font-size: 0.826em; font-style: italic; color: var(--nsf-ink-muted); text-align: center; }

/* ---------- footer: the same company block on every page ---------- */
.op-foot { background: var(--nsf-navy); color: var(--nsf-white); padding: 1.9em 3.7em 1.4em; }
.op-foot p { color: var(--nsf-white); }
.op-top { display: grid; grid-template-columns: 1fr 1fr; column-gap: 3em; align-items: start; }
/* 1.1 em at line height 1.2: three lines are 3.96 em, level with three description lines at the body's 1.32 */
.op-foot .op-mission { color: var(--nsf-cyan); font-weight: 700; font-size: 1.1em; line-height: 1.2; }
.op-bottom {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 1.4em;
  margin-top: 1.6em;
  padding-top: 1.1em;
  border-top: 0.0825em solid rgba(196, 224, 253, 0.35);
}
.op-lux { display: block; width: 5.4em; height: auto; }
.op-qr { display: block; width: 4.6em; height: 4.6em; border-radius: 0.5em; }
.op-foot .op-contact { color: var(--nsf-light-blue); font-size: 0.9em; line-height: 1.5; text-align: center; }
.op-contact span { display: block; }
.op-contact a { color: var(--nsf-cyan); font-weight: 700; text-decoration: none; }

/* ---------- screen only ---------- */
.op-dl { display: none; }
@media screen {
  body { font-size: min(13px, calc(100vw / 64.6)); }
  .op-dl { display: flex; justify-content: flex-end; gap: 8px; width: 64.6em; max-width: 100%; margin: 0 auto; padding: 12px 0; }
  .op-dl a {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px;
    border-radius: 999px; background: var(--nsf-navy); color: var(--nsf-white);
    font: 700 15px var(--nsf-font); text-decoration: none;
  }
  .op-dl a:hover { background: var(--nsf-light-blue); color: var(--nsf-navy); }
  .op-dl a:focus-visible { outline: 2px solid var(--nsf-navy); outline-offset: 2px; }
}
@media screen and (max-width: 700px) {
  body { font-size: 15px; }
  .op-dl { padding: 8px 20px; }
  .op-sheet { width: 100%; min-height: 0; }
  .op-hero { grid-template-columns: 1fr; row-gap: 20px; padding: 24px 20px 28px; }
  .op-logo { grid-row: 1; width: 180px; margin: 0; }
  .op-hero-text { grid-row: 2; width: auto; min-width: 0; }
  .op-summary { width: auto; min-width: 0; }
  .op-main { padding: 24px 20px; }
  .op-mid { grid-template-columns: 1fr; row-gap: 20px; }
  .op-figure { width: 100%; max-width: 22em; margin: 0 auto; }
  .op-figure img { width: 100%; height: auto; aspect-ratio: 1; }
  .op-foot { padding: 24px 20px 20px; }
  .op-top { grid-template-columns: 1fr; row-gap: 16px; }
  .op-bottom { grid-template-columns: 1fr; row-gap: 14px; justify-items: center; }
}

/* ---------- print: page width of the chosen paper, margins zero ---------- */
@media print {
  @page { size: auto; margin: 0; }
  html, body { font-size: 9.2pt; }
  .op-dl { display: none; }
  .op-sheet { width: 100%; min-height: 100vh; }
  /* the macOS print engine renders everything 1.0667 times larger than true size (measured), so a sheet exactly one
     paper tall is 297 mm / 1.0667 on A4 and 279.4 mm / 1.0667 on Letter; the footer then sits on the paper's bottom edge */
  html.paper-a4 .op-sheet { min-height: 278.3mm; }
  html.paper-letter .op-sheet { min-height: 262mm; }
  /* Letter is the shorter paper: tighten the vertical rhythm a little so the same content fits */
  html.paper-letter .op-hero { padding-top: 1.9em; padding-bottom: 2.1em; }
  html.paper-letter .op-main { padding-top: 1.5em; padding-bottom: 1em; gap: 0.8em; }
  /* A4 is the narrower paper: a smaller footer column gap keeps the company line at three lines */
  html.paper-a4 .op-top { column-gap: 2em; }
  .op-block { break-inside: avoid; }
}
