/* Shared styling for the printable guide cards at /guides.
 *
 * ONE SOURCE, TWO ARTEFACTS: each guide is a real web page (SEO + a link you can
 * drop in a comment) and the PDF is rendered from that same page by
 * scripts/build-guides.mjs. Everything below the `@media print` block is what
 * makes the printed version behave; do not maintain a separate print-only HTML,
 * it will drift from the page.
 *
 * Brand values match public/learn/* exactly. */
:root {
  --bg: #FDFBF7; --card: #ffffff; --accent: #8FA286; --accent-deep: #6f835f;
  --heading: #44403c; --body: #57534e; --muted: #78716c;
  --faint: #a8a29e; --border: #f5f5f4;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--body);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65; font-size: 16px;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 28px max(24px, env(safe-area-inset-right)) 64px max(24px, env(safe-area-inset-left)); }
.crumb { font-size: 13px; margin-bottom: 14px; }
.crumb a { color: var(--accent); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

.sheet {
  background: var(--card); border: 1px solid var(--border); border-radius: 2rem;
  box-shadow: 0 1px 2px rgba(120, 113, 108, 0.06); padding: 40px 36px 32px;
}
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: 31px; line-height: 1.22; color: #292524; margin: 0 0 10px; font-weight: 600; }
.standfirst { font-size: 16.5px; color: var(--muted); margin: 0 0 26px; }
h2 { font-family: Georgia, "Times New Roman", serif; font-size: 20px; color: var(--heading); font-weight: 600; margin: 30px 0 8px; }
h3 { font-size: 15px; color: var(--heading); font-weight: 600; margin: 18px 0 4px; }
p { margin: 0 0 11px; }
ul, ol { margin: 6px 0 12px; padding-left: 20px; }
li { margin: 5px 0; }
strong { color: var(--heading); }
a { color: var(--accent-deep); }

/* A week / stage block */
.stage { border-left: 3px solid rgba(143,162,134,0.35); padding: 2px 0 2px 16px; margin: 0 0 20px; }
.stage h2 { margin-top: 0; }
.stage .when { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0 0 4px; }

/* Tick-box list for the checklist cards - real boxes so it works on paper */
.checks { list-style: none; padding-left: 0; }
.checks li { position: relative; padding-left: 30px; margin: 9px 0; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 16px; height: 16px;
  border: 1.5px solid var(--accent); border-radius: 5px;
}

/* Question list with room to write an answer on paper */
/* NOTE: counter-reset is set INLINE per list, not here. A blanket
   `counter-reset: q` on .qlist silently overrides the HTML `start` attribute,
   so a card of 13 questions split across 4 sections numbers them 1-3 four
   times over. */
.qlist { list-style: none; padding-left: 0; }
.qlist li { counter-increment: q; margin: 0 0 14px; padding-left: 34px; position: relative; }
.qlist li::before {
  content: counter(q); position: absolute; left: 0; top: 0;
  width: 23px; height: 23px; border-radius: 50%;
  background: rgba(143,162,134,0.16); color: var(--accent-deep);
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.qlist .why { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.ruled { border-bottom: 1px dashed #e7e5e4; height: 22px; margin: 6px 0 0; }

.note { background: #fdfcfa; border: 1px solid var(--border); border-radius: 16px; padding: 14px 17px; margin: 16px 0; font-size: 14.5px; color: var(--muted); }
.urgent { background: #fbf7f2; border: 1px solid #ede4d8; border-radius: 16px; padding: 16px 18px; margin: 18px 0; }
.urgent h2, .urgent h3 { margin-top: 0; }
.urgent p, .urgent li { color: var(--heading); }
.pill { display: inline-block; background: rgba(143,162,134,0.12); color: var(--accent-deep); border-radius: 999px; padding: 3px 11px; font-size: 13px; font-weight: 600; margin: 0 5px 6px 0; }

table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: 14.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--heading); font-weight: 600; }

/* Light branding only. Peter's locked call: no CTA on the printed card, because
   GLP-1 communities remove anything that reads as an advert and a card shared by
   a member travels much further than one we post ourselves. */
.foot {
  margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--faint);
}
.foot .mark { width: 22px; height: 22px; flex: 0 0 auto; }
.foot .who { color: var(--muted); }
.foot .who strong { color: var(--heading); }
.disclaimer { font-size: 12px; color: var(--faint); margin: 10px 0 0; line-height: 1.5; }

/* On-page-only furniture: hidden in the PDF */
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 4px; }
.btn {
  display: inline-block; text-decoration: none; border-radius: 999px;
  padding: 11px 20px; font-size: 14.5px; font-weight: 600;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
}
.btn.ghost { background: #fff; color: var(--accent-deep); }
.sibling { margin-top: 26px; font-size: 14.5px; }
.sibling a { display: block; margin: 5px 0; }

@media print {
  /* A4 with real margins; the sheet loses its card chrome and becomes the page. */
  @page { size: A4; margin: 14mm 15mm 12mm; }
  html, body { background: #fff; font-size: 11.2pt; line-height: 1.5; }
  .wrap { max-width: none; margin: 0; padding: 0; }
  .sheet { border: none; border-radius: 0; box-shadow: none; padding: 0; }
  .crumb, .actions, .sibling, .noprint { display: none !important; }
  h1 { font-size: 23pt; }
  h2 { font-size: 13.5pt; margin-top: 16pt; }
  h3 { font-size: 11.5pt; }
  .standfirst { font-size: 11.5pt; margin-bottom: 16pt; }
  /* Never split a stage, a callout or a table row across a page break - a
     half-a-red-flag-box at the foot of page 1 is how printed guides mislead. */
  .stage, .urgent, .note, tr, li, .qlist li { break-inside: avoid; page-break-inside: avoid; }
  h2, h3 { break-after: avoid; page-break-after: avoid; }
  .foot { margin-top: 18pt; }
  a { color: var(--heading); text-decoration: none; }
}
