/* ============================================================
   senior-bridge — Setup Guide (print stylesheet)
   Target: WeasyPrint, US Letter, 0.75in margins
   Palette: warm cream background, sage + terracotta accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,500;0,600;0,700;1,500&display=swap');

/* ---------- Page rules ---------- */
@page {
  size: Letter;
  margin: 0.75in 0.75in 0.95in 0.75in;
  background: #fdfaf3;

  @bottom-left {
    content: "senior-bridge — Setup Guide";
    font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 9pt;
    color: #8a847d;
    padding-bottom: 0.25in;
  }
  @bottom-right {
    content: counter(page);
    font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 9pt;
    color: #8a847d;
    padding-bottom: 0.25in;
  }
}

/* The cover page: no margins, no footers. */
@page :first {
  margin: 0;
  background: #fdfaf3;
  @bottom-left { content: ""; }
  @bottom-right { content: ""; }
}

/* ---------- Base typography ---------- */
html, body {
  background: #fdfaf3;
  color: #2a2520;
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 10.5pt;
  line-height: 1.55;
}

body { margin: 0; padding: 0; }

/* The pandoc title block (auto-generated <header>) is unwanted —
   we have our own cover page. Hide it. */
header#title-block-header { display: none !important; }

h1, h2, h3, h4 {
  font-family: 'Lora', Georgia, "Times New Roman", serif;
  color: #2a2520;
  page-break-after: avoid;
}

h1 {
  font-size: 24pt;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 18pt 0;
  border-bottom: 2px solid #7a8e6a;
  padding-bottom: 6pt;
  page-break-before: always;
}

/* The very first h1 (cover) has its own treatment and shouldn't break before. */
.cover h1 {
  border: none;
  page-break-before: avoid;
  font-size: 32pt;
  margin: 0 0 12pt 0;
  padding: 0;
  text-align: center;
}

h2 {
  font-size: 16pt;
  font-weight: 600;
  margin: 22pt 0 8pt 0;
  color: #647557;
}

h3 {
  font-size: 13pt;
  font-weight: 600;
  margin: 14pt 0 4pt 0;
  color: #2a2520;
}

h4 {
  font-size: 11pt;
  font-weight: 600;
  margin: 10pt 0 2pt 0;
  color: #5a544c;
}

p { margin: 0 0 8pt 0; }

strong { font-weight: 600; color: #2a2520; }
em { font-style: italic; }

a {
  color: #c9663d;
  text-decoration: none;
}
/* Show the URL after links in print, so readers can find them in print copies. */
a[href^="http"]::after {
  content: " (" attr(href) ")";
  font-size: 8.5pt;
  color: #8a847d;
  word-break: break-all;
}
/* But not on the cover or in headers. */
.cover a::after, h1 a::after, h2 a::after { content: ""; }

ul, ol { margin: 4pt 0 10pt 18pt; padding: 0; }
li { margin: 0 0 3pt 0; }

blockquote {
  margin: 8pt 0 8pt 0;
  padding: 8pt 12pt;
  background: #f5efe0;
  border-left: 3px solid #7a8e6a;
  font-style: italic;
  color: #5a544c;
  page-break-inside: avoid;
}
blockquote p:last-child { margin-bottom: 0; }

hr {
  border: none;
  border-top: 1px solid #e3d9c2;
  margin: 18pt 0;
}

/* Checklist block: each item gets a ☐ marker rendered via ::marker. */
.checklist ul {
  list-style: none;
  margin: 8pt 0 12pt 0;
  padding-left: 18pt;
}
.checklist li {
  margin: 0 0 5pt 0;
  padding: 0;
  page-break-inside: avoid;
  position: relative;
}
.checklist li::before {
  content: "☐";
  position: absolute;
  left: -16pt;
  top: 0;
  font-size: 12pt;
  color: #647557;
  line-height: 1.5;
}

/* Closing link block: a single, lightly-spaced URL with no auto-appended
   parenthetical (the URL IS the link text). */
.closing-link {
  margin-top: 18pt;
  text-align: center;
}
.closing-link a { font-weight: 600; }
.closing-link a::after { content: ""; }

/* ---------- Cover page ---------- */
.cover {
  display: block;
  text-align: center;
  padding: 1.5in 0.75in 0.75in 0.75in;
  page-break-after: always;
  height: 100%;
  background: #fdfaf3;
}

.cover .cover-logo,
.cover img {
  display: block;
  margin: 0 auto 0.4in auto;
  max-width: 3.0in;
  height: auto;
}

.cover h1 {
  font-size: 30pt;
  font-style: italic;
  color: #2a2520;
  margin: 0.2in 0 0.15in 0;
}

.cover h3 {
  font-family: 'Lora', Georgia, serif;
  font-size: 14pt;
  font-style: italic;
  font-weight: 500;
  color: #647557;
  margin: 0 auto 0.5in auto;
  max-width: 4.5in;
  line-height: 1.4;
}

.cover-meta {
  margin-top: 1.2in;
  font-size: 10.5pt;
  color: #5a544c;
  line-height: 1.6;
}
.cover-meta strong { color: #2a2520; }
.cover-meta a { color: #c9663d; }

/* ---------- Section page breaks ---------- */
/* Top-level h1 already breaks (above). The cover doesn't. */

/* Avoid breaks inside small grouped blocks. */
h1 + p, h2 + p, h3 + p { page-break-before: avoid; }

/* ---------- ❌ / ✅ blocks ---------- */
/* "ko-block" = keep-out / wrong way; "ok-block" = the better way.
   These are pandoc fenced div classes (::: ko-block / ::: ok-block). */

.ko-block, .ok-block {
  border-radius: 6pt;
  padding: 9pt 12pt;
  margin: 6pt 0 10pt 0;
  page-break-inside: avoid;
  font-size: 10pt;
}

.ko-block {
  background: #f9eeec;
  border-left: 3px solid #a0524a;
}
.ko-block strong:first-child,
.ko-block p:first-child strong {
  color: #a0524a;
}

.ok-block {
  background: #eff3ea;
  border-left: 3px solid #7a8e6a;
}
.ok-block strong:first-child,
.ok-block p:first-child strong {
  color: #647557;
}

.ko-block p, .ok-block p { margin: 0 0 5pt 0; }
.ko-block p:last-child, .ok-block p:last-child { margin-bottom: 0; }

.ko-block blockquote, .ok-block blockquote {
  background: rgba(255,255,255,0.55);
  border-left-color: rgba(0,0,0,0.15);
  margin: 6pt 0 0 0;
  padding: 6pt 10pt;
  font-style: normal;
  color: #2a2520;
}

/* The 🟡 "Better" middle tier used in Personal Interests —
   muted amber, between ko (red) and ok (sage). */
.mid-block {
  border-radius: 6pt;
  padding: 9pt 12pt;
  margin: 6pt 0 10pt 0;
  page-break-inside: avoid;
  font-size: 10pt;
  background: #f7f0e0;
  border-left: 3px solid #c79b3a;
}
.mid-block strong:first-child,
.mid-block p:first-child strong { color: #8a6a1f; }
.mid-block p { margin: 0 0 5pt 0; }
.mid-block p:last-child { margin-bottom: 0; }

/* ---------- Misc niceties ---------- */
code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 9.5pt;
  background: #f5efe0;
  padding: 1pt 4pt;
  border-radius: 3pt;
  color: #647557;
}

/* Don't orphan headings or first paragraphs at page bottom. */
h1, h2, h3 { page-break-inside: avoid; }
p, li { orphans: 3; widows: 3; }

/* Keep an h2 or h3 attached to the block that follows. */
h2, h3, h4 { page-break-after: avoid; break-after: avoid; }
h2 + p, h2 + ul, h2 + ol, h2 + .ko-block, h2 + .ok-block, h2 + .mid-block,
h3 + p, h3 + ul, h3 + ol, h3 + .ko-block, h3 + .ok-block, h3 + .mid-block,
h4 + p, h4 + ul, h4 + ol, h4 + .ko-block, h4 + .ok-block, h4 + .mid-block {
  page-break-before: avoid;
  break-before: avoid;
}

/* The closing "harveydogbot.com" link gets a touch of breathing room. */
h1 + p + p:last-child { margin-top: 14pt; }
