/* Base: readable text and comfortable controls at the smallest screen. */
:root {
  color-scheme: light;
  --ink: #182b2e;
  --muted: #4d605c;
  --green: #235846;
  --paper: #f8f9f5;
  --white: #ffffff;
  --wash: #e9eee5;
  --line: #ccd4c9;
  --focus: #855520;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; }
html { scroll-padding-top: 1.5rem; }
main, article, section, header, footer, nav, aside, div { min-width: 0; }
p, ul, ol, figure { margin: 0 0 1.25rem; }
p, li, label, a, button, summary, figcaption, small { font-size: 1rem; }
p, li { overflow-wrap: break-word; }
a { color: var(--green); text-underline-offset: .24em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
button, summary, input, label { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3 { font-weight: 600; text-wrap: balance; }
h1 { margin: .6rem 0 1.25rem; font-size: 2.5rem; line-height: 1.12; letter-spacing: -.045em; }
h2 { margin: 0 0 1.05rem; font-size: 1.5rem; line-height: 1.3; letter-spacing: -.025em; }
h3 { margin: 0 0 .5rem; font-size: 1rem; line-height: 1.5; }
ul { padding-left: 1.25rem; }
li { margin-bottom: .6rem; }
strong { font-weight: 600; }

/* Masthead and the chapter index remain usable without scripts. */
[data-skip] {
  position: absolute;
  left: 1rem;
  top: -6rem;
  z-index: 10;
  min-height: 44px;
  padding: .7rem 1rem;
  background: var(--white);
  border: 1px solid var(--green);
}
[data-skip]:focus { top: 1rem; }
#masthead {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
#masthead > a {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 44px;
  text-decoration: none;
  line-height: 1.25;
  font-weight: 600;
}
#masthead > a:first-of-type { color: var(--ink); }
#masthead > a:last-of-type { padding: .75rem .25rem .75rem .75rem; font-weight: 400; }
#masthead > p { display: none; }
[data-mark] {
  width: 24px;
  height: 32px;
  border: 1px solid var(--green);
  box-shadow: 5px 5px 0 var(--wash);
  display: block;
  flex: 0 0 auto;
  position: relative;
}
[data-mark]::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 1px;
  background: var(--green);
  top: 10px;
  left: 6px;
  box-shadow: 0 7px 0 var(--green);
}
#layout { padding: 0 1.25rem; }
#reading { padding: 2.75rem 0 3rem; }
#reading:focus { outline: none; }
[data-intro] { padding-bottom: 2.1rem; border-bottom: 1px solid var(--line); }
[data-intro] > p:last-child { margin-bottom: 0; color: var(--muted); }
[data-kicker] { margin: 0; color: var(--green); letter-spacing: .025em; }
#reading > section { padding: 2rem 0 .75rem; border-bottom: 1px solid var(--line); }
#reading > section > a {
  display: flex;
  align-items: center;
  width: fit-content;
  min-height: 44px;
  padding: .5rem 0;
  margin-bottom: 1.2rem;
}
#reading > section > p, #reading > section > ul { max-width: 66ch; }
#chapters { padding: 2rem 0; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
#chapters h2 { font-size: 1.25rem; margin-bottom: 1.6rem; }
#chapters section { margin-bottom: 1.25rem; }
#chapters [data-chapter-group] { margin: 0 0 .5rem; color: var(--muted); font-weight: 400; line-height: 1.5; }
#chapters ul { list-style: none; padding: 0; margin: 0; }
#chapters li { margin: 0; }
#chapters li a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .55rem .75rem;
  margin-left: -.75rem;
  color: var(--ink);
  text-decoration: none;
  border-left: 2px solid transparent;
  line-height: 1.35;
}
#chapters li a:hover { background: var(--wash); }
#chapters a[aria-current="page"] { border-color: var(--green); color: var(--green); background: var(--wash); font-weight: 600; }
[data-return] { display: flex; align-items: center; min-height: 44px; padding: .5rem 0; }

/* The opening page pairs a precise invitation with one everyday image. */
[data-page="start"] h1 span { display: block; }
[data-page="start"] h1 span:last-child { color: var(--green); }
[data-actions] { display: flex; align-items: stretch; flex-direction: column; gap: .65rem; margin-top: 1.6rem; }
[data-actions] a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .8rem 1rem;
  text-decoration: none;
  border: 1px solid var(--line);
  line-height: 1.4;
}
[data-actions] a:first-child { background: var(--green); color: var(--white); border-color: var(--green); }
[data-actions] a:last-child:hover { background: var(--wash); }
figure { margin: 1.75rem 0 0; }
img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--wash); color: var(--muted); }
img[src$="paper-and-pencil.webp"] { aspect-ratio: 3 / 2; }
figcaption { margin: .7rem 0 1.4rem; color: var(--muted); }
[data-page="start"] #reading > figure { border-bottom: 1px solid var(--line); }
[data-page="visit-checklist"] #reading > figure { margin-top: 2rem; }

/* Notes and source drawers give detail without competing with the chapter. */
[data-note] { margin: 1.5rem 0 1.25rem; padding: 1.15rem 1.25rem; background: var(--wash); border-left: 2px solid var(--green); }
[data-note] p { margin: 0; }
[data-source-drawer] { margin-top: 2rem; border: 1px solid var(--line); background: var(--white); }
[data-source-drawer] summary { min-height: 52px; padding: .9rem 1rem; color: var(--green); cursor: pointer; }
[data-source-drawer][open] summary { border-bottom: 1px solid var(--line); }
[data-source-drawer] > div { padding: 1.2rem 1.2rem .5rem; }
[data-source-drawer] p { color: var(--muted); max-width: 66ch; }
[data-source-drawer] ul { list-style: none; padding: 0; }
[data-source-drawer] li { margin: 0; }
[data-source-drawer] a { display: flex; align-items: center; min-height: 44px; padding: .65rem 0; }

/* Paper-friendly lists: native controls, large labels, and room for notes. */
[data-checklist] { list-style: none; padding: 0; }
[data-checklist] li { display: flex; align-items: flex-start; gap: .8rem; margin: 0; padding: .9rem 0; border-bottom: 1px solid var(--line); }
[data-checklist] li:last-child { border-bottom: 0; }
[data-checklist] input {
  appearance: none;
  display: grid;
  place-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: -.4rem 0 0 -.6rem;
  cursor: pointer;
  accent-color: var(--green);
}
[data-checklist] input::before { content: ""; display: block; width: 22px; height: 22px; border: 1px solid var(--green); background: var(--white); }
[data-checklist] input:checked::before { content: "✓"; background: var(--green); color: var(--white); font-size: 16px; line-height: 20px; text-align: center; }
[data-checklist] label { min-height: 44px; width: 100%; cursor: pointer; line-height: 1.55; }
[data-note-line] { display: block; min-height: 1.4rem; margin-top: .35rem; border-bottom: 1px dotted var(--line); }
[data-writing-space] { height: 8rem; background: repeating-linear-gradient(transparent 0, transparent 31px, var(--line) 31px, var(--line) 32px); }
[data-print-tools] { margin: 1.5rem 0; }
[data-print-tools] p { margin-top: 1rem; color: var(--muted); }
[data-print] { min-height: 48px; padding: .8rem 1.2rem; background: var(--green); border: 1px solid var(--green); color: var(--white); line-height: 1.4; }
[data-print]:hover { background: var(--ink); }

/* Chapter steps and the footer keep their full tap area. */
[data-page-turn] { display: grid; gap: 1rem; margin-top: 2.5rem; }
[data-page-turn] a { display: block; min-height: 76px; padding: 1rem 0; border-top: 1px solid var(--green); text-decoration: none; }
[data-page-turn] a:hover strong { text-decoration: underline; text-underline-offset: .25em; }
[data-page-turn] span { display: block; color: var(--muted); font-size: 1rem; margin-bottom: .35rem; }
[data-page-turn] strong { font-size: 1.125rem; line-height: 1.4; }
#page-footer { padding: 2rem 1.25rem; border-top: 1px solid var(--line); background: var(--wash); }
#page-footer > p { max-width: 65ch; color: var(--muted); }
#page-footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
#page-footer a { display: flex; align-items: center; min-height: 44px; padding: .6rem 0; }

/* Wider components add a reading rail, never a wider line of body text. */
@media (min-width: 42rem) {
  #masthead { padding: 1.25rem 2.5rem; }
  #masthead > p { display: block; margin: 0 auto 0 .8rem; color: var(--muted); }
  #layout { padding: 0 2.5rem; }
  #reading { max-width: 48rem; margin: 0 auto; }
  h1 { font-size: 3.25rem; }
  h2 { font-size: 1.65rem; }
  [data-page="start"] h1 { font-size: 3.75rem; }
  [data-actions] { flex-direction: row; flex-wrap: wrap; }
  [data-actions] a { justify-content: flex-start; }
  [data-page-turn] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
  #chapters nav { max-width: 48rem; margin: 0 auto; }
  #page-footer { padding: 2rem 2.5rem; }
}

@media (min-width: 64rem) {
  #masthead { max-width: 88rem; margin: 0 auto; padding: 1.4rem 3rem; }
  #layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 4rem; max-width: 88rem; margin: 0 auto; padding: 0 3rem; }
  #reading { grid-column: 2; grid-row: 1; width: 100%; max-width: 54rem; margin: 0 auto; padding-top: 3.75rem; }
  #reading > section { padding-top: 2.4rem; padding-bottom: 1.15rem; }
  [data-intro] { padding-bottom: 2.6rem; }
  [data-intro] > p:last-child { max-width: 64ch; font-size: 1.125rem; }
  #chapters { grid-column: 1; grid-row: 1; align-self: start; padding-top: 3.8rem; border: 0; }
  #chapters nav { margin: 0; }
  #chapters h2 { margin-bottom: 1.9rem; }
  #chapters section { margin-bottom: 1.7rem; }
  #chapters li a { padding-top: .65rem; padding-bottom: .65rem; }
  [data-return] { margin-top: 2rem; }
  [data-page="start"] h1 { font-size: clamp(3.3rem, 4.6vw, 4rem); }
  [data-page="start"] #reading > figure { display: grid; grid-template-columns: 1fr 13rem; gap: 2rem; align-items: end; padding-bottom: 1.75rem; }
  [data-page="start"] #reading > figure img { aspect-ratio: 16 / 7; }
  [data-page="start"] #reading > figure figcaption { padding-bottom: 1.3rem; margin: 0; }
  [data-page="visit-checklist"] #reading > figure { max-width: 32rem; }
  [data-page="cost-checklist"] figure { max-width: 30rem; }
  #page-footer { padding: 2rem max(3rem, calc((100vw - 82rem) / 2)); display: flex; gap: 3rem; justify-content: space-between; }
  #page-footer > p { max-width: 60ch; margin: 0; }
  #page-footer nav { flex: 0 0 auto; align-self: center; }
}

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

@media print {
  @page { margin: 16mm; }
  :root { background: white; color: black; font-size: 11pt; line-height: 1.45; }
  #masthead, #chapters, [data-skip], [data-print-tools], [data-page-turn], #page-footer, figure { display: none !important; }
  #layout { display: block; padding: 0; margin: 0; max-width: none; }
  #reading { display: block; width: 100%; padding: 0; margin: 0; max-width: none; }
  [data-intro] { padding-bottom: 1rem; }
  h1 { font-size: 25pt; }
  h2 { font-size: 15pt; break-after: avoid; }
  p, li, label, a, summary { font-size: 11pt; }
  #reading > section { padding: 1.2rem 0 .3rem; }
  p, li, [data-note], summary { break-inside: avoid; }
  [data-checklist] li { padding: .6rem 0; }
  [data-checklist] label { min-height: 0; }
  [data-checklist] input { appearance: auto; display: block; width: 16px; height: 16px; flex-basis: 16px; margin: .15rem 0 0; }
  [data-checklist] input::before, [data-checklist] input:checked::before { content: none; }
  [data-note-line] { min-height: 1.25rem; border-color: #666; }
  [data-source-drawer] { margin-top: 1rem; break-inside: avoid; }
  [data-source-drawer] summary { padding: .7rem; min-height: 0; }
  [data-source-drawer] a { min-height: 0; padding: .3rem 0; }
  [data-source-drawer] > div { padding: .8rem; }
  a { color: black; }
}
