/* WeatherRouting manual: the app's colour tokens, light or dark like the browser, and a print layout for the PDF. */
/* The app's fonts (SIL Open Font License, see fonts/), served with the manual so it works offline. */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600 700; font-display: swap; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url("fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); }
:root {
  --bg: #eef2f4;
  --panel: #ffffff;
  --raise: #f5f8f9;
  --line: #d6dee2;
  --fg: #15232b;
  --muted: #5d6f78;
  --accent: #0f6c8f;
  --accent-soft: #dcecf2;
  --warn: #b7791f;
  --warn-soft: #fbf0dc;
  --ok: #2e8a57;
  --ok-soft: #e1f2e8;
  --bad: #c0392b;
  --bad-soft: #f9e2df;
  --f-body: "IBM Plex Sans", system-ui, sans-serif;
  --f-display: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0e171c; --panel: #142128; --raise: #1a2a32; --line: #26404a;
    --fg: #e3edf1; --muted: #8fa5ae; --accent: #4fb3d9; --accent-soft: #163a48;
    --warn: #e3a64a; --warn-soft: #3a2c14;
    --ok: #4cc283; --ok-soft: #163527; --bad: #ec6b5d; --bad-soft: #3d1c19;
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0 auto;
  max-width: 860px;
  padding: 24px 20px 48px;
  background: var(--panel);
  color: var(--fg);
  font: 16px/1.6 var(--f-body);
}
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; line-height: 1.2; }
h1 { font-size: 2.6rem; margin: 0.2em 0; }
h2 { font-size: 1.8rem; margin: 2em 0 0.6em; padding-bottom: 0.2em; border-bottom: 2px solid var(--accent); }
h3 { font-size: 1.3rem; margin: 1.8em 0 0.5em; color: var(--accent); }
h4 { font-size: 1.05rem; margin: 1.4em 0 0.4em; }
a { color: var(--accent); }
section[id], h2, h3 { scroll-margin-top: 16px; }

.cover { padding: 24px 0 8px; border-bottom: 1px solid var(--line); }
.kicker { margin: 0; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; color: var(--muted); }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 40em; }
.edition { font-size: 0.85rem; color: var(--muted); }
.print-hint { font-size: 0.85rem; }
.langs { font-size: 0.9rem; margin-top: 0.4rem; }

.toc h2 { border: none; margin-top: 1em; }
.toc ul { list-style: none; padding-left: 0; }
.toc > ul > li { margin-top: 8px; }
.toc > ul > li > a { font-weight: 600; }
.toc ul ul { padding-left: 2.8em; font-size: 0.95em; }
.toc li { margin: 3px 0; }
.toc .n { display: inline-block; min-width: 2.8em; font-variant-numeric: tabular-nums; color: var(--muted); }
.toc .todo > a, .chapter.todo h2 { color: var(--muted); }
.placeholder { color: var(--muted); font-style: italic; }

figure { margin: 1.2em 0; }
figure img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 6px; }
figure.side { float: right; width: 240px; margin: 0.3em 0 1em 24px; }
section::after { content: ""; display: table; clear: both; }

.ui { font-weight: 600; white-space: nowrap; padding: 0 4px; border: 1px solid var(--line); border-radius: 5px; background: var(--raise); font-size: 0.92em; }
.badge { display: inline-block; padding: 0 7px; border-radius: 9px; font-size: 0.82em; white-space: nowrap; }
.badge { background: var(--raise); color: var(--muted); border: 1px solid var(--line); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 0.9rem; }
th, td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
th { background: var(--raise); font-weight: 600; }
.table-wrap { overflow-x: auto; }
blockquote { margin: 1em 0; padding: 6px 14px; border-left: 3px solid var(--line); color: var(--muted); }
pre, code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.88em; }
pre { padding: 10px 12px; background: var(--raise); border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; }
dl.badges { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; align-items: baseline; }
dl.badges dd { margin: 0; }
dt { font-weight: 600; }
dl.badges dt { font-weight: normal; }
.tip { margin: 1em 0; padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 4px; }
ol.steps li { margin: 4px 0; }
.colophon { margin-top: 3em; padding-top: 1em; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); }

/* Phones and narrow tablets: pictures full width. */
@media (max-width: 640px) {
  figure.side { float: none; width: auto; margin: 1em 0; }
  figure.side img { max-width: 320px; }
}

/* Print / PDF: A4, always light, a chapter per page, pictures never split. */
@media print {
  :root { color-scheme: light; --bg: #fff; --panel: #fff; --raise: #f5f8f9; --line: #d6dee2; --fg: #15232b; --muted: #5d6f78;
    --accent: #0f6c8f; --accent-soft: #e8f3f7; --warn: #8a5a12; --warn-soft: #fbf0dc; }
  @page { size: A4; margin: 18mm 16mm 20mm; }
  html, body { background: #fff; }
  body { max-width: none; padding: 0; font-size: 10.5pt; }
  .cover { min-height: 70vh; display: flex; flex-direction: column; justify-content: flex-end; border: none; break-after: page; }
  .cover h1 { font-size: 36pt; }
  .toc { break-after: page; }
  .chapter { break-before: page; }
  .chapter.todo { break-before: auto; }
  h2, h3, h4 { break-after: avoid; }
  figure, .tip, tr, pre { break-inside: avoid; }
  dt { break-after: avoid; }
  /* Chrome does not split a grid over pages: in print the label lists are floats, which do split. */
  dl.badges { display: block; }
  dl.badges dt { float: left; clear: left; width: 30%; margin: 3px 0; }
  dl.badges dd { margin: 3px 0 3px 32%; }
  dl.badges::after { content: ""; display: table; clear: both; }
  table { font-size: 9pt; }
  .print-hint { display: none; }
  .langs { display: none; }
  figure.side { width: 34%; }
  figure img { max-height: 200mm; width: auto; }
  a { color: inherit; text-decoration: none; }
  .toc a { color: var(--accent); }
}
