/* johnstirrat.ca — one stylesheet for every page.
   Static, self-contained, light theme only (audience skews older and rural;
   white-on-black body text is harder for them). Fonts are local stacks; nothing
   is fetched from a CDN. */

:root {
  color-scheme: light;
  /* warm neutrals */
  --paper: #fbf9f6;
  --paper-2: #f3efe8;
  --paper-3: #e9e3d9;
  --line: #d9d2c6;
  --line-soft: #e7e1d7;
  --ink: #1c1b19;
  --ink-2: #3d3a35;
  --muted: #5e5952;      /* 7.0:1 on paper */
  --accent: #1e40af;     /* royal blue, used sparingly; 8.6:1 on paper */
  --accent-deep: #172f8a;
  --accent-tint: #e8edf9;
  --dark: #26231f;       /* footer */
  --on-dark: #efe9df;
  --on-dark-muted: #c9c1b4; /* 9.4:1 on dark */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter, Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Helvetica, Arial, sans-serif;
  --max: 1120px;
  --prose: 44rem;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { font-family: var(--sans); font-size: 17px; line-height: 1.6; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--paper); color: var(--ink); }
::selection { background: var(--accent); color: #fff; }

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-deep); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; color: var(--ink); margin: 0 0 0.5rem; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.05; }
h2 { font-size: clamp(1.7rem, 3vw, 2.35rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.02rem; font-family: var(--sans); font-weight: 600; }
p, ul, ol, dl { margin: 0 0 1rem; }
li { margin-bottom: 0.35rem; }
address { font-style: normal; }
small { font-size: 0.9em; }

.skip { position: absolute; left: -999px; top: 0; background: var(--paper); color: var(--ink); padding: 0.5rem 1rem; border: 2px solid var(--accent); }
.skip:focus { left: 1rem; top: 1rem; z-index: 50; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.label { font-family: var(--sans); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.75rem; }
.lede { font-size: 1.18rem; line-height: 1.5; color: var(--ink-2); max-width: 36rem; }
.muted { color: var(--muted); }
.note { font-size: 0.93rem; color: var(--muted); line-height: 1.55; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ---------- header ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(251,249,246,0.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-soft); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.wordmark { font-family: var(--serif); font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.wordmark small { font-family: var(--sans); font-size: 0.78rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-left: 0.6rem; }
.topbar nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem; align-items: center; }
.topbar nav a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 0.3em; }
.topbar nav a.button { text-decoration: none; }
/* CSS-only menu for phones (no JavaScript on this site) */
.topbar details { display: none; }
.topbar details summary { list-style: none; cursor: pointer; font-size: 0.95rem; font-weight: 500; color: var(--ink-2); padding: 0.5rem 0; }
.topbar details summary::-webkit-details-marker { display: none; }
.topbar details summary::after { content: " ▾"; }
.topbar details[open] summary::after { content: " ▴"; }
.topbar details ul { list-style: none; margin: 0; position: absolute; right: 1.25rem; left: 1.25rem; top: 64px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.5rem 1rem; flex-direction: column; gap: 0; box-shadow: 0 12px 32px rgba(28,27,25,0.12); }
.topbar details li { margin: 0; border-bottom: 1px solid var(--line-soft); }
.topbar details li:last-child { border-bottom: 0; }
.topbar details a { display: block; padding: 0.75rem 0; }
@media (max-width: 720px) {
  .topbar nav.desktop { display: none; }
  .topbar details { display: block; position: static; }
  .wordmark small { display: none; }
}

.button { display: inline-block; font-family: var(--sans); font-weight: 600; font-size: 0.95rem; padding: 0.7rem 1.2rem; border-radius: 999px; text-decoration: none; border: 1px solid transparent; }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-deep); color: #fff; }
.button.quiet { border-color: var(--line); color: var(--ink); background: transparent; }
.button.quiet:hover { border-color: var(--ink); }
.button.small { font-size: 0.88rem; padding: 0.5rem 0.95rem; }

/* ---------- sections ---------- */
section.sec { padding: 4.25rem 0; }
section.sec.tight { padding: 3rem 0; }
section.sec.tone { background: var(--paper-2); }
section.sec + section.sec { border-top: 1px solid var(--line-soft); }
section.sec.tone + section.sec, section.sec + section.sec.tone { border-top: 0; }
@media (max-width: 720px) { section.sec { padding: 3rem 0; } }
.sec-head { max-width: var(--prose); margin-bottom: 2rem; }
.sec-head p { color: var(--ink-2); margin: 0.25rem 0 0; }

/* ---------- hero ---------- */
.hero { padding: 3.5rem 0 4.5rem; background: linear-gradient(180deg, var(--paper-2), var(--paper)); }
.hero .wrap { display: grid; gap: 2.5rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 860px) { .hero .wrap { grid-template-columns: 1.25fr 0.75fr; gap: 4rem; } .hero { padding: 4rem 0 5rem; } }
.hero h1 { max-width: 15ch; margin-bottom: 1.1rem; }
.hero .lede { margin-bottom: 1.6rem; }
.hero .actions { display: flex; gap: 0.75rem 1.25rem; flex-wrap: wrap; align-items: center; }
.hero .actions a.textlink { font-weight: 500; }
.portrait { margin: 0; justify-self: center; width: min(100%, 320px); }
.portrait .frame { aspect-ratio: 4 / 5; border-radius: 14px; background: var(--paper-3); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.portrait .frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait .frame .initials { font-family: var(--serif); font-size: 4rem; color: var(--muted); }
.portrait figcaption { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 0.6rem; }
@media (max-width: 859px) {
  .portrait { order: -1; width: 96px; justify-self: start; }
  .portrait .frame { aspect-ratio: 1; border-radius: 50%; }
  .portrait .frame .initials { font-size: 2rem; }
  .portrait figcaption { display: none; }
  .hero .wrap { gap: 1.25rem; }
}

/* ---------- audience panels + CTA band ---------- */
.audience { padding-top: 0; margin-top: -1.5rem; position: relative; }
.audience .panel.path { padding: 1.75rem; }
.audience .panel.path h2 { font-size: 1.55rem; margin-bottom: 0.5rem; }
.audience .panel.path p { color: var(--ink-2); font-size: 1rem; margin-bottom: 1rem; }
.audience .panel.path .phone-line { margin: 0 0 0.5rem; }
.audience .panel.path .phone-big { margin: 0; }
.actions { display: flex; gap: 0.75rem 1.25rem; flex-wrap: wrap; align-items: center; }
.actions .textlink { font-weight: 500; }
.hero .lede { margin-bottom: 0; }
.directory.compact li { padding: 0.75rem 0; grid-template-columns: 1fr; }
.directory.compact h3 { font-size: 1.05rem; }
.directory.compact p { font-size: 0.93rem; color: var(--muted); }
.steps p { font-size: 0.95rem; }
.cta-band { background: var(--dark); color: var(--on-dark-muted); padding: 3.5rem 0; }
.cta-band h2 { color: var(--on-dark); font-size: 1.5rem; margin-bottom: 0.35rem; }
.cta-band p { color: var(--on-dark-muted); margin-bottom: 1rem; }
.cta-band strong { color: var(--on-dark); }
.cta-band .button.quiet { color: var(--on-dark); border-color: rgba(255,255,255,0.4); }
.cta-band .button.quiet:hover { border-color: #fff; }
.cta-band + footer.foot { margin-top: 0; border-top: 1px solid rgba(255,255,255,0.12); }
.topbar nav .button.small { padding: 0.45rem 0.9rem; }

/* ---------- bio / trust block ---------- */
.bio { display: grid; gap: 1.5rem 3rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .bio { grid-template-columns: 1.2fr 0.8fr; } }
.bio p { font-size: 1.05rem; color: var(--ink-2); max-width: 40rem; }
.facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.25rem; font-size: 0.95rem; align-content: start; }
.facts dt { color: var(--muted); font-weight: 500; }
.facts dd { margin: 0; color: var(--ink); }

/* ---------- services directory ---------- */
.directory { display: grid; gap: 0 3rem; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
@media (min-width: 760px) { .directory { grid-template-columns: 1fr 1fr; } }
.directory li { margin: 0; padding: 1.05rem 0; border-bottom: 1px solid var(--line-soft); display: grid; gap: 0.2rem; }
.directory h3 { font-size: 1.12rem; margin: 0; }
.directory p { margin: 0; color: var(--ink-2); font-size: 0.97rem; }
.directory a { color: inherit; text-decoration: none; }
.directory a:hover { color: var(--accent); }
.directory .tag { display: inline-block; font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 0.4rem; margin-left: 0.5rem; vertical-align: middle; }

/* ---------- steps (open sequence) ---------- */
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem 2rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { margin: 0; padding-top: 1rem; border-top: 2px solid var(--ink); }
.steps li::before { counter-increment: step; content: counter(step, decimal-leading-zero); display: block; font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 0.5rem; }
.steps h3 { font-size: 1.15rem; margin: 0 0 0.35rem; }
.steps p { margin: 0; color: var(--ink-2); font-size: 0.96rem; }

/* ---------- panels ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.panel.tint { background: var(--accent-tint); border-color: #cfd8f2; }
.panel h3 { margin-top: 0; }
.split { display: grid; gap: 2rem 3rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; } }
.split.wide-left { grid-template-columns: 1fr; }
@media (min-width: 860px) { .split.wide-left { grid-template-columns: 1.3fr 0.9fr; } }

.checklist { list-style: none; margin: 0 0 1rem; padding: 0; }
.checklist li { position: relative; padding: 0.55rem 0 0.55rem 1.7rem; border-bottom: 1px solid var(--line-soft); margin: 0; }
.checklist li::before { content: "✓"; position: absolute; left: 0; top: 0.5rem; color: var(--accent); font-weight: 700; }
.checklist li:last-child { border-bottom: 0; }

.routes { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.routes > div { display: grid; grid-template-columns: 9rem 1fr; gap: 0.25rem 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line-soft); align-items: baseline; }
@media (max-width: 480px) { .routes > div { grid-template-columns: 1fr; } }
.routes dt { color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.routes dd { margin: 0; }
.routes dd .big { font-family: var(--serif); font-size: 1.45rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.routes dd .big:hover { color: var(--accent); }
.routes dd .note { margin: 0.1rem 0 0; }

/* ---------- contact ---------- */
.contact-grid { display: grid; gap: 2rem 3rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.phone-big { font-family: var(--serif); font-size: clamp(1.8rem, 3.5vw, 2.4rem); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; display: inline-block; margin: 0.2rem 0 0.4rem; }
.phone-big:hover { color: var(--accent); }
.kv { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.45rem 1.25rem; font-size: 0.98rem; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; }
.hospitals { list-style: none; margin: 0; padding: 0; }
.hospitals li { padding: 0.8rem 0; border-bottom: 1px solid var(--line-soft); margin: 0; }
.hospitals li:first-child { border-top: 1px solid var(--line); }
.hospitals strong { font-family: var(--serif); font-weight: 500; font-size: 1.08rem; display: block; }
.hospitals span { color: var(--ink-2); font-size: 0.95rem; }

/* ---------- footer ---------- */
footer.foot { background: var(--dark); color: var(--on-dark-muted); padding: 3rem 0 2rem; margin-top: 2rem; }
footer.foot .wrap { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
footer.foot h4 { color: var(--on-dark); font-family: var(--serif); font-weight: 500; font-size: 1.05rem; margin-bottom: 0.6rem; }
footer.foot ul { list-style: none; margin: 0; padding: 0; }
footer.foot li { margin-bottom: 0.4rem; font-size: 0.95rem; }
footer.foot a { color: var(--on-dark); text-decoration: none; }
footer.foot a:hover { text-decoration: underline; }
footer.foot p { font-size: 0.95rem; margin: 0; }
footer.foot .legal { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,0.14); padding-top: 1.2rem; font-size: 0.85rem; color: var(--on-dark-muted); }

/* ---------- article pages (privacy, patients, binder) ---------- */
main.article { max-width: var(--prose); margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
main.article h1 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); margin-bottom: 0.3rem; }
main.article h2 { font-size: 1.45rem; margin: 2.25rem 0 0.5rem; }
main.article h3 { font-size: 1.1rem; margin: 1.4rem 0 0.3rem; }
main.article .subtitle { color: var(--muted); margin: 0 0 1.5rem; }
main.article dt { font-weight: 600; margin-top: 0.75rem; }
main.article dd { margin: 0 0 0.25rem 1.25rem; }
.callout { background: var(--accent-tint); border-left: 4px solid var(--accent); padding: 1rem 1.1rem; margin: 1.5rem 0; border-radius: 0 var(--radius) var(--radius) 0; }
.callout h2, .callout h3 { margin-top: 0; }
.callout :last-child { margin-bottom: 0; }
.notice { background: #fff6df; border-left: 4px solid #b8860b; padding: 1rem 1.1rem; margin: 1.5rem 0; border-radius: 0 var(--radius) var(--radius) 0; }
.notice :last-child { margin-bottom: 0; }
table { border-collapse: collapse; width: 100%; margin: 0 0 1.25rem; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line-soft); }
th { font-weight: 600; }
@media (max-width: 40rem) {
  table.stack thead { display: none; }
  table.stack tr { display: block; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
  table.stack td { display: block; border: 0; padding: 0.15rem 0; }
  table.stack td::before { content: attr(data-label) ": "; font-weight: 600; }
}
.tag { display: inline-block; font-size: 0.8rem; padding: 0 0.45rem; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); white-space: nowrap; }
.toc { font-size: 0.95rem; background: var(--paper-2); padding: 1rem 1.25rem; border-radius: var(--radius); }
.toc ol { margin: 0.25rem 0 0; padding-left: 1.5rem; columns: 2; column-gap: 2rem; }
@media (max-width: 40rem) { .toc ol { columns: 1; } }
main.article .foot-note { border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1rem; color: var(--muted); font-size: 0.9rem; }

/* ---------- printable referral form ---------- */
.form-page { max-width: 46rem; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.form-page h1 { font-size: 1.9rem; }
.fieldset { border: 1px solid var(--ink); border-radius: 6px; padding: 0.9rem 1rem; margin: 0 0 1rem; }
.fieldset h2 { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; color: var(--muted); margin: 0 0 0.6rem; }
.fieldset .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.6rem 1.25rem; margin-bottom: 0.4rem; }
.fieldset .f { border-bottom: 1px solid var(--ink); padding: 0.9rem 0 0.15rem; font-size: 0.82rem; color: var(--muted); }
.fieldset .f.tall { padding-top: 3.2rem; }
.boxes { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.boxes li { margin: 0; font-size: 0.95rem; }
.boxes li::before { content: ""; display: inline-block; width: 0.85em; height: 0.85em; border: 1.5px solid var(--ink); border-radius: 2px; margin-right: 0.45rem; vertical-align: -0.1em; }

/* ---------- print ---------- */
@media print {
  @page { margin: 1.8cm; }
  html { font-size: 11pt; line-height: 1.45; }
  body { background: #fff; color: #000; }
  .topbar, .skip, .actions, .button, .cta-band, .no-print { display: none !important; }
  .hero, section.sec.tone, .toc, .panel, .panel.tint, .callout, .notice { background: #fff !important; }
  section.sec { padding: 1rem 0; }
  .portrait { display: none; }
  footer.foot { background: #fff; color: #000; margin-top: 1rem; padding: 1rem 0 0; border-top: 1px solid #000; }
  footer.foot h4, footer.foot a, footer.foot .legal { color: #000; }
  a { color: #000; text-decoration: none; }
  main a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.9em; }
  h2 { page-break-after: avoid; }
  .callout, .notice, .panel, .fieldset { page-break-inside: avoid; }
  .form-page { max-width: none; padding: 0; font-size: 9.5pt; line-height: 1.35; }
  .form-page h1 { font-size: 16pt; margin-bottom: 0.2rem; }
  .form-page > p { margin-bottom: 0.6rem; }
  .fieldset { padding: 0.45rem 0.7rem 0.5rem; margin-bottom: 0.5rem; border-radius: 4px; }
  .fieldset h2 { margin-bottom: 0.25rem; font-size: 7.5pt; }
  .fieldset .row { gap: 0.3rem 1rem; margin-bottom: 0.2rem; }
  .fieldset .f { padding-top: 0.75rem; font-size: 7.5pt; }
  .fieldset .f.tall { padding-top: 2.4rem; }
  .boxes { gap: 0.2rem 0.9rem; }
  .boxes li { font-size: 9pt; }
  .form-page .note { font-size: 7.5pt; margin: 0.3rem 0 0; }
}
