/* Larkfield Health Library — stylesheet
   Warm paper background, serif body copy against sans-serif headings,
   flat bordered panels, and a left-hand sticky rail on the guide chapters. */

:root {
  --ink: #1b201d;
  --ink-soft: #4b544e;
  --ink-faint: #78827a;
  --paper: #fbf9f5;
  --surface: #ffffff;
  --surface-2: #f3f0e8;
  --line: #e1dcd0;
  --line-soft: #ebe7dd;
  --brand: #1f4d3d;
  --brand-dark: #15362a;
  --brand-tint: #e7eee9;
  --clay: #a84f18;
  --clay-tint: #fbefe5;
  --flag: #8d2a1f;
  --flag-tint: #faeae7;
  --marker: #fff1b8;

  --serif: Georgia, "Iowan Old Style", "Times New Roman", Times, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1160px;
  --r-sm: 3px;
  --r-md: 5px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 1.68;
}

img, svg { max-width: 100%; }

a { color: var(--brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--clay); }

h1, h2, h3, h4 {
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.22;
  letter-spacing: -.015em;
  font-weight: 700;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(1.95rem, 1.25rem + 2.4vw, 2.85rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1.05vw, 1.7rem); margin-top: 2.3em; }
h3 { font-size: 1.1rem; margin-top: 1.9em; letter-spacing: -.005em; }
h4 { font-size: .98rem; margin-top: 1.5em; letter-spacing: 0; }

p, ul, ol, dl, table, figure { margin: 0 0 1.15em; }
ul, ol { padding-left: 1.25em; }
li { margin-bottom: .5em; }
li > ul, li > ol { margin-top: .5em; }
strong { font-weight: 700; }
em { font-style: italic; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.6rem 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }

.jump {
  position: absolute; left: -9999px; top: 0; z-index: 120;
  background: var(--brand); color: #fff; font-family: var(--sans);
  padding: 11px 18px; text-decoration: none;
}
.jump:focus { left: 0; }

:focus-visible { outline: 3px solid var(--clay); outline-offset: 2px; }

/* ---------- Masthead ---------- */

.topline {
  height: 4px;
  background: linear-gradient(90deg, var(--brand) 0 44%, var(--clay) 44% 100%);
}

.masthead {
  position: sticky; top: 0; z-index: 60;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.masthead-row { display: flex; align-items: center; gap: 18px; min-height: 74px; }

.progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 0;
  background: var(--clay); pointer-events: none;
}

.wordmark { display: inline-flex; align-items: center; gap: 11px; margin-right: auto; text-decoration: none; color: var(--ink); }
.wordmark-mark { width: 34px; height: 34px; flex: none; }
.wordmark-text { display: flex; flex-direction: column; line-height: 1.1; }
.wordmark-text strong { font-family: var(--sans); font-size: 1.18rem; font-weight: 700; letter-spacing: -.02em; }
.wordmark-text em {
  font-family: var(--sans); font-style: normal; font-size: .62rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .17em; color: var(--clay); margin-top: 2px;
}

.menu-btn {
  display: none; align-items: center; gap: 9px; cursor: pointer;
  font-family: var(--sans); font-size: .76rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em;
  background: transparent; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px;
}
.menu-btn:hover { border-color: var(--brand); color: var(--brand); }
.menu-bars { position: relative; display: block; width: 16px; height: 2px; background: currentColor; }
.menu-bars::before, .menu-bars::after { content: ""; position: absolute; left: 0; width: 16px; height: 2px; background: currentColor; }
.menu-bars::before { top: -5px; }
.menu-bars::after { top: 5px; }

.mainnav ul { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.mainnav li { margin: 0; }
.mainnav a {
  display: block; padding: 10px 11px; text-decoration: none;
  font-family: var(--sans); font-size: .74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft);
  border-bottom: 2px solid transparent;
}
.mainnav a:hover { color: var(--brand); border-bottom-color: var(--line); }
.mainnav a[aria-current="page"] { color: var(--brand-dark); border-bottom-color: var(--clay); }

@media (max-width: 1040px) {
  .menu-btn { display: inline-flex; }
  .mainnav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--line);
  }
  .mainnav.is-open { display: block; }
  .mainnav ul { flex-direction: column; align-items: stretch; gap: 0; max-width: var(--wrap); margin: 0 auto; padding: 6px 22px 16px; }
  .mainnav li + li { border-top: 1px solid var(--line-soft); }
  .mainnav a { padding: 15px 2px; font-size: .82rem; border-bottom: 0; }
  .mainnav a[aria-current="page"] { color: var(--clay); }
}

/* ---------- Page heads ---------- */

.pagehead { border-bottom: 1px solid var(--line); padding: 34px 0 36px; }
.pagehead h1 { margin-bottom: .4em; max-width: 26ch; }
.pagehead .lede { font-family: var(--serif); font-size: 1.13rem; color: var(--ink-soft); max-width: 60ch; margin-bottom: 0; }

.crumbs { font-family: var(--sans); font-size: .76rem; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 16px; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 9px; list-style: none; margin: 0; padding: 0; }
.crumbs li { margin: 0; color: var(--ink-faint); }
.crumbs li + li::before { content: "\203A"; margin-right: 9px; color: var(--line); }
.crumbs a { color: var(--ink-faint); text-decoration: none; }
.crumbs a:hover { color: var(--clay); text-decoration: underline; }

.chapter-tag {
  display: inline-block; margin-bottom: 14px;
  font-family: var(--sans); font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em; color: #fff;
  background: var(--brand); padding: 5px 11px; border-radius: 2px;
}

.byline {
  display: flex; flex-wrap: wrap; gap: 5px 22px;
  font-family: var(--sans); font-size: .78rem; color: var(--ink-faint);
  margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line);
}

.strip { background: var(--brand-tint); border-bottom: 1px solid var(--line); }
.strip p {
  margin: 0; padding: 15px 0; font-family: var(--sans);
  font-size: .85rem; line-height: 1.55; color: var(--brand-dark);
}
.strip a { color: var(--brand-dark); }

/* ---------- Guide layout ---------- */

.sheet {
  display: grid; grid-template-columns: 268px minmax(0, 1fr);
  gap: 0 54px; padding: 42px 0 78px; align-items: start;
}
.sheet > .article { grid-column: 2; grid-row: 1; max-width: 70ch; }
.sheet > .rail { grid-column: 1; grid-row: 1; position: sticky; top: 96px; }
.article > :first-child { margin-top: 0; }

@media (max-width: 1000px) {
  .sheet { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-bottom: 58px; }
  .sheet > .article, .sheet > .rail { grid-column: 1; grid-row: auto; position: static; max-width: none; }
}

.rail { display: grid; gap: 22px; font-family: var(--sans); font-size: .88rem; }
.rail h3 { font-size: .72rem; text-transform: uppercase; letter-spacing: .13em; color: var(--clay); margin: 0 0 10px; }
.rail ul { list-style: none; padding-left: 0; }
.rail ol { padding-left: 1.1em; }
.rail li { margin-bottom: .45em; }
.rail p { line-height: 1.55; }
.rail p:last-child, .rail ul:last-child, .rail ol:last-child { margin-bottom: 0; }

.rail-block { border-top: 2px solid var(--brand); padding-top: 14px; }
.rail-block.is-tinted { background: var(--surface-2); border-top-color: var(--clay); padding: 14px 16px 16px; }

.toc { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { counter-increment: toc; margin: 0; border-bottom: 1px solid var(--line); }
.toc a { display: flex; gap: 10px; padding: 9px 0; text-decoration: none; color: var(--ink-soft); line-height: 1.4; }
.toc a::before { content: counter(toc, decimal-leading-zero); color: var(--clay); font-weight: 700; font-size: .78rem; flex: none; padding-top: 1px; }
.toc a:hover { color: var(--clay); }

/* ---------- Blocks ---------- */

.band { padding: 54px 0; }
.band-paper { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-head { max-width: 62ch; margin-bottom: 30px; }
.band-head h2 { margin-top: 0; }
.band-head p { color: var(--ink-soft); margin-bottom: 0; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px 24px; }
.panel-accent { border-top: 3px solid var(--clay); border-radius: 0 0 var(--r-md) var(--r-md); }
.panel h2, .panel h3 { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }

.panel-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(265px, 1fr)); }
.panel-grid-3 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

.kicker {
  font-family: var(--sans); font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .15em; color: var(--clay);
  display: block; margin-bottom: 12px;
}

.note {
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--brand);
  border-radius: 0 0 var(--r-sm) var(--r-sm); padding: 18px 22px; margin: 1.8em 0;
}
.note > :last-child { margin-bottom: 0; }
.note-title {
  display: block; font-family: var(--sans); font-size: .73rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em; color: var(--brand); margin-bottom: .6em;
}
.note-caution { border-top-color: var(--clay); background: var(--clay-tint); }
.note-caution .note-title { color: var(--clay); }
.note-urgent { border-top-color: var(--flag); background: var(--flag-tint); }
.note-urgent .note-title { color: var(--flag); }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; text-decoration: none;
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
  padding: 14px 22px; border-radius: var(--r-sm);
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-line { background: transparent; color: var(--brand); }
.btn-line:hover { background: var(--brand-tint); color: var(--brand-dark); border-color: var(--brand); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.9em 0 0; }

/* ---------- Home: hero, figures, chapter rail ---------- */

.hero { padding: 58px 0 50px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 54px; align-items: start; }
.hero h1 { max-width: 22ch; }
.hero-lede { font-size: 1.16rem; color: var(--ink-soft); max-width: 56ch; }
@media (max-width: 920px) { .hero { padding: 40px 0 36px; } .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; } }

.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 26px 0; }
.figure { padding: 0 26px; border-left: 1px solid var(--line); }
.figure:first-child { padding-left: 0; border-left: 0; }
.figure-num { display: block; font-family: var(--serif); font-size: 2.1rem; line-height: 1.1; color: var(--clay); }
.figure p { font-family: var(--sans); font-size: .86rem; line-height: 1.5; color: var(--ink-soft); margin: 8px 0 0; }
@media (max-width: 760px) {
  .figure { padding: 0 0 0 18px; border-left: 3px solid var(--line-soft); }
  .figure:first-child { padding-left: 18px; border-left: 3px solid var(--line-soft); }
}

.chapters { list-style: none; margin: 0; padding: 0; counter-reset: chap; border-top: 1px solid var(--line); }
.chapters li { counter-increment: chap; margin: 0; border-bottom: 1px solid var(--line); }
.chapters a {
  display: grid; grid-template-columns: 62px minmax(0, 1fr) 28px; align-items: start;
  gap: 0 8px; padding: 24px 12px 24px 0; text-decoration: none; color: inherit;
}
.chapters a::before {
  content: counter(chap, decimal-leading-zero);
  font-family: var(--sans); font-size: 1.5rem; font-weight: 700; line-height: 1;
  color: var(--line); letter-spacing: -.03em;
}
.chapters a:hover { background: var(--clay-tint); }
.chapters a:hover::before { color: var(--clay); }
.chapters strong { display: block; font-family: var(--sans); font-size: 1.12rem; letter-spacing: -.01em; margin-bottom: 5px; }
.chapters span { color: var(--ink-soft); font-size: .97rem; }
.chapters-go { font-family: var(--sans); font-size: 1.1rem; color: var(--clay); text-align: right; }

/* Signpost lists that are not the numbered chapter sequence. */
.chapters-plain a { grid-template-columns: minmax(0, 1fr) 28px; }
.chapters-plain a::before { content: none; }
@media (max-width: 620px) {
  .chapters a { grid-template-columns: 44px minmax(0, 1fr); padding: 20px 0; }
  .chapters-go { display: none; }
  .chapters a::before { font-size: 1.2rem; }
}

/* ---------- Tables ---------- */

.table-scroll { overflow-x: auto; margin-bottom: 1.4em; border-bottom: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .9rem; line-height: 1.5; }
caption { font-family: var(--sans); font-size: .79rem; color: var(--ink-faint); text-align: left; padding-bottom: 10px; }
thead th {
  background: var(--brand); color: #fff; font-weight: 600; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
th, td { text-align: left; vertical-align: top; padding: 11px 13px; border-bottom: 1px solid var(--line-soft); }
tbody tr:nth-child(even) { background: var(--surface-2); }
tbody tr:nth-child(odd) { background: var(--surface); }
tbody th[scope="row"] { font-weight: 700; color: var(--brand-dark); white-space: nowrap; }

/* ---------- FAQ accordion ---------- */

.faq { border-top: 1px solid var(--line); margin-bottom: 1.6em; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; gap: 18px; align-items: baseline; justify-content: space-between;
  cursor: pointer; list-style: none;
  font-family: var(--sans); font-size: 1rem; font-weight: 650; padding: 17px 2px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::marker { content: ""; }
.faq summary::after { content: "+"; flex: none; font-family: var(--sans); font-weight: 400; font-size: 1.45rem; line-height: 1; color: var(--clay); }
.faq details[open] summary { color: var(--brand-dark); }
.faq details[open] summary::after { content: "\2013"; }
.faq details > *:not(summary) { margin-bottom: 1.15em; padding-right: 42px; }
@media (max-width: 620px) { .faq details > *:not(summary) { padding-right: 0; } }

/* ---------- Glossary ---------- */

.alpha-nav { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 2em; padding: 0; }
.alpha-nav li { margin: 0; }
.alpha-nav a {
  display: block; min-width: 34px; text-align: center; padding: 7px 4px;
  font-family: var(--sans); font-size: .82rem; font-weight: 700; text-decoration: none;
  color: var(--brand); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.alpha-nav a:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

.gloss h2 {
  font-size: 1.5rem; color: var(--clay); margin-top: 2em;
  padding-bottom: 6px; border-bottom: 2px solid var(--line);
}
.gloss dl { margin: 0 0 1.6em; }
.gloss dt { font-family: var(--sans); font-weight: 700; font-size: 1rem; margin-top: 1.3em; }
.gloss dd { margin: .35em 0 0; color: var(--ink-soft); }

/* ---------- Misc content ---------- */

.sources { font-size: .94rem; color: var(--ink-soft); }
.sources li { margin-bottom: .75em; }
.fineprint { font-family: var(--sans); font-size: .82rem; color: var(--ink-faint); line-height: 1.55; }

.fill-in {
  background: var(--marker); border-bottom: 1px dashed #b58b00;
  font-family: var(--sans); font-size: .86em; padding: 0 3px;
}

.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 30px; margin-bottom: .7em; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .42em;
  width: 13px; height: 13px; border: 1px solid var(--brand); border-radius: 2px;
}
.crosslist { list-style: none; padding: 0; }
.crosslist li { position: relative; padding-left: 30px; margin-bottom: .7em; }
.crosslist li::before {
  content: "\00D7"; position: absolute; left: 2px; top: -.05em;
  color: var(--flag); font-size: 1.2rem; font-weight: 700;
}

/* ---------- Footer ---------- */

.footer { background: var(--surface-2); border-top: 3px solid var(--brand); margin-top: 0; padding: 50px 0 30px; }
.footer-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 34px; }
@media (max-width: 860px) { .footer-cols { grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); } }
.footer h2 {
  font-family: var(--sans); font-size: .71rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .14em; color: var(--clay); margin: 0 0 14px;
}
.footer ul { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: .89rem; }
.footer li { margin-bottom: .6em; }
.footer a { color: var(--ink-soft); text-decoration: none; }
.footer a:hover { color: var(--clay); text-decoration: underline; }
.footer-brand p { font-size: .94rem; color: var(--ink-soft); max-width: 44ch; margin: 14px 0 0; }
.footer-end {
  display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between;
  border-top: 1px solid var(--line); margin-top: 38px; padding-top: 20px;
  font-family: var(--sans); font-size: .8rem; color: var(--ink-faint);
}
.footer-end p { margin: 0; }

.consent-link {
  font: inherit; color: var(--ink-faint); background: none; border: 0; padding: 0;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.consent-link:hover { color: var(--clay); }

/* ---------- Cookie consent card ---------- */

.consent {
  position: fixed; z-index: 90; left: 20px; bottom: 20px; width: calc(100% - 40px); max-width: 420px;
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--clay);
  border-radius: 0 0 var(--r-md) var(--r-md); box-shadow: 0 14px 40px rgba(27, 32, 29, .18);
  padding: 22px 24px;
}
.consent p { font-family: var(--sans); font-size: .85rem; line-height: 1.55; color: var(--ink-soft); margin: 0 0 1em; }
.consent .consent-head {
  font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  color: var(--clay); margin-bottom: .7em;
}
.consent-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.consent-actions .btn { padding: 11px 16px; font-size: .72rem; }
@media (max-width: 560px) {
  .consent { left: 0; right: 0; bottom: 0; width: 100%; max-width: none; border-radius: 0; border-left: 0; border-right: 0; }
  .consent-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Utilities ---------- */

.t0 { margin-top: 0; }
.b0 { margin-bottom: 0; }
.gap-t { margin-top: 24px; }
.gap-b { margin-bottom: 1.6em; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media print {
  .masthead, .footer, .rail, .menu-btn, .topline, .consent { display: none; }
  body { background: #fff; font-size: 11.5pt; }
  .sheet { display: block; padding: 0; }
  a { text-decoration: none; color: inherit; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
