/* The Sereno Routing guide: plain static pages, read on a phone or a
   desk, and printed to one PDF (tools/guide/pdf.py). Brand from the
   Passage Galley format: Playfair Display headings, Open Sans body,
   #03A9F4 accent, generous margins. Colors are the Sabado tokens only
   (app/tests/test_brand_colors.py). No scripts. */

@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/PlayfairDisplay-700.woff2") format("woff2");
  font-weight: 600 700;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("../fonts/OpenSans-VF.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --accent: #03A9F4;
  --accent-dark: #016E9E;
  --ink: #000;
  --text: #333;
  --muted: #656565;
  --bg: #fff;
  --bg-soft: #f6f7f9;
  --border: #e7e7e7;
  --warn: #8A5A00;
  --no: #C62828;
  --go: #2E7D32;
  --heading: "Playfair Display", Georgia, serif;
  --body: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}

.top {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.top-in {
  max-width: 820px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.top a { color: var(--ink); text-decoration: none; }
.top .mark { display: flex; align-items: center; gap: 10px; font-family: var(--heading); font-size: 20px; font-weight: 700; }
.top .mark img { width: 34px; height: 34px; border-radius: 50%; }
.top .sp { flex: 1; }
.top .links a { font-size: 15px; font-weight: 600; color: var(--accent-dark); margin-left: 14px; }
.top a.home { margin-left: 18px; padding: 8px 14px; border-radius: 6px; background: var(--accent-dark);
  color: #fff; font-size: 15px; font-weight: 600; white-space: nowrap; }
.top a.home:hover, .top a.home:focus-visible { background: var(--accent); }

main {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

h1, h2, h3 { font-family: var(--heading); color: var(--ink); line-height: 1.25; }
h1 { font-size: 34px; margin: 8px 0 12px; }
h2 { font-size: 25px; margin: 40px 0 10px; padding-top: 6px; border-top: 3px solid var(--accent); }
h3 { font-size: 20px; margin: 28px 0 6px; }
h1 + .lede { font-size: 19px; color: var(--muted); margin-top: 0; }

a { color: var(--accent-dark); }
a:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 2px; }
p, li { max-width: 70ch; }
ol, ul { padding-left: 1.4em; }
li { margin: 4px 0; }
code, kbd { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }

/* What the reader taps or reads on screen, as the screen writes it. */
.ui { font-weight: 700; color: var(--ink); white-space: nowrap; }
.say { font-style: italic; }

.note {
  border-left: 4px solid var(--accent);
  background: var(--bg-soft);
  padding: 12px 16px;
  margin: 18px 0;
  border-radius: 0 8px 8px 0;
}
.note p { margin: 6px 0; }
.note.caution { border-left-color: var(--warn); }
.note strong:first-child { color: var(--ink); }

figure { margin: 20px 0 26px; }
figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
figure.phone img { max-width: min(300px, 100%); }
figure.small img { max-width: min(420px, 100%); }
figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; max-width: 70ch; }
.pair { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.pair figure { margin: 10px 0; }
/* Phone shots side by side while there's room, each at least 200 px. */
.pair figure.phone { flex: 1 1 200px; min-width: 0; max-width: 300px; }

/* A phone screenshot Ray is to supply: the box says what goes there. */
.placeholder {
  border: 2px dashed var(--accent);
  border-radius: 8px;
  padding: 14px 16px;
  max-width: 320px;
  color: var(--text);
  background: var(--bg-soft);
}
.placeholder strong { display: block; color: var(--accent-dark); font-size: 14px; text-transform: uppercase;
  letter-spacing: .04em; }
.placeholder p { margin: 6px 0 0; font-size: 15px; }

.table-wrap { overflow-x: auto; margin: 16px 0 24px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { font-weight: 700; color: var(--ink); background: var(--bg-soft); }
td.lead { font-weight: 600; color: var(--ink); min-width: 9em; }

.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 44px; margin: 14px 0; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-dark); color: var(--bg);
  font-weight: 700; text-align: center; line-height: 30px;
}

.verdict { font-weight: 700; letter-spacing: .03em; }
.v-go { color: var(--go); }
.v-warn { color: var(--warn); }
.v-no { color: var(--no); }

/* The contents page. */
.toc { list-style: none; padding: 0; }
.toc > li { border-top: 1px solid var(--border); padding: 14px 0; max-width: none; }
.toc > li > a { font-family: var(--heading); font-size: 22px; font-weight: 700; color: var(--ink); text-decoration: none; }
.toc > li > a:hover, .toc > li > a:focus-visible { color: var(--accent-dark); }
.toc > li > p { margin: 4px 0 6px; color: var(--muted); }
.toc ul { margin: 4px 0 0; padding-left: 1.1em; columns: 2 16em; font-size: 15px; }
.toc ul li { margin: 2px 0; break-inside: avoid; }
.chapter-no { color: var(--accent-dark); margin-right: 6px; }

.pager {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--border); margin-top: 48px; padding-top: 16px;
}
.pager a { font-weight: 600; text-decoration: none; }
.foot { color: var(--muted); font-size: 14px; margin-top: 28px; }

@media (max-width: 520px) {
  body { font-size: 16px; }
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
  .top .links a { margin-left: 0; margin-right: 14px; }
  figure.phone img { max-width: 100%; }
}

/* The PDF: one document of every chapter, A4, margins to write in. */
@page { size: A4; margin: 22mm 20mm 24mm; }
@media print {
  body { font-size: 11pt; }
  .top, .pager, .print-hide { display: none; }
  main { max-width: none; padding: 0; }
  .chapter { break-before: page; }
  h1 { font-size: 26pt; }
  h2 { font-size: 17pt; break-after: avoid; }
  h3 { font-size: 13pt; break-after: avoid; }
  figure, .note, tr, .placeholder { break-inside: avoid; }
  figure img { max-height: 150mm; width: auto; }
  figure.phone img { max-height: 120mm; }
  .pair { flex-wrap: nowrap; }
  .pair figure.phone { flex: 1 1 0; }
  a { text-decoration: none; }
  .cover { break-after: page; text-align: center; padding-top: 50mm; }
  .cover img { width: 60mm; border-radius: 50%; }
  .cover p { margin-left: auto; margin-right: auto; }
  .cover h1 { font-size: 34pt; margin-top: 14mm; }
}
.cover { display: none; }
@media print { .cover { display: block; } }
