/* Field guide styles. Shared by the contents page and every chapter. */
:root {
  --bg: #f0f2ec; --surface: #ffffff; --text: #1b2a22; --muted: #55625a; --line: #cbd3c8;
  --accent: #1f5c45; --copper: #c2622d; --btn: #1f5c45; --btn-ink: #ffffff; --tint: #e3ece2;
  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131f1a; --surface: #1b2b24; --text: #ecf1eb; --muted: #a5b3aa; --line: #2f463b;
    --accent: #82d1ab; --copper: #e8935c; --btn: #82d1ab; --btn-ink: #10201a; --tint: #22382d;
  }
}
:root[data-theme="dark"] {
  --bg: #131f1a; --surface: #1b2b24; --text: #ecf1eb; --muted: #a5b3aa; --line: #2f463b;
  --accent: #82d1ab; --copper: #e8935c; --btn: #82d1ab; --btn-ink: #10201a; --tint: #22382d;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 1.125rem; line-height: 1.65; }
a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: -0.015em; margin: 0; }

.skip { position: absolute; left: -999px; top: 0; background: var(--btn); color: var(--btn-ink); padding: 0.5rem 0.9rem; font-weight: 600; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; }

.wrap { width: min(100% - 3rem, 68rem); margin-inline: auto; }
.column { width: min(100% - 3rem, 40rem); margin-inline: auto; }

.site-head { padding-block: 1.4rem; font-size: 1rem; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-head .name { font-weight: 600; text-decoration: none; color: var(--text); }
.site-head nav { display: flex; align-items: center; gap: 1.6rem; font-size: 0.95rem; }
.site-head nav a { color: var(--muted); text-decoration: none; }
.site-head nav a:hover { color: var(--text); }
.theme-toggle { font: inherit; font-size: 0.875rem; color: var(--muted); background: none; cursor: pointer; border: 1.5px solid var(--line); border-radius: 99px; padding: 0.3rem 0.8rem; }
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }

/* Chapter opening */
.opening { padding-block: clamp(2rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 2.5rem); }
.part { margin: 0 0 0.9rem; color: var(--muted); font-size: 1rem; }
.part a { color: inherit; }
.part .n { font-family: var(--display); font-style: italic; color: var(--copper); font-size: 1.2rem; margin-right: 0.15rem; }
.opening h1 { font-size: clamp(2.3rem, 5.4vw, 3.5rem); line-height: 1.06; letter-spacing: -0.02em; text-wrap: balance; }
.standfirst { font-family: var(--display); font-size: clamp(1.3rem, 2.6vw, 1.55rem); line-height: 1.35; color: var(--muted); margin: 1.4rem 0 0; text-wrap: pretty; }

/* Chapter body */
.chapter { padding-bottom: clamp(3rem, 7vw, 5rem); }
.chapter p { margin: 0 0 1.15rem; }
.chapter .column > h2 { font-size: clamp(1.6rem, 3.2vw, 1.95rem); line-height: 1.15; margin: 2.8rem 0 0.9rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.chapter ul { margin: 0 0 1.4rem; padding-left: 1.2rem; }
.chapter ul li { margin-bottom: 0.5rem; padding-left: 0.2rem; }
.chapter ul li::marker { color: var(--copper); }

.questions, .moves { list-style: none; margin: 0 0 1.4rem; padding: 0; counter-reset: item; }
.questions li, .moves li { counter-increment: item; display: grid; grid-template-columns: 2rem 1fr; column-gap: 0.75rem; }
.questions li::before, .moves li::before { content: counter(item); font-family: var(--display); font-style: italic; color: var(--copper); }
.questions li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.questions li::before { font-size: 1.2rem; }
.moves li { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.moves li::before { font-size: 2.1rem; line-height: 1; }
.moves h3 { font-size: 1.3rem; line-height: 1.2; margin-bottom: 0.4rem; }
.moves p { margin: 0; color: var(--muted); }
.moves p + p { margin-top: 0.6rem; }

.chapter .signs { list-style: none; margin: 0 0 1.4rem; padding: 0; }
.questions li:last-child, .moves li:last-child, .chapter .signs li:last-child { border-bottom: 0; }
.chapter .signs li { position: relative; margin: 0; padding: 0.55rem 0 0.55rem 1.9rem; border-bottom: 1px solid var(--line); }
.signs li::before { content: ""; position: absolute; left: 0.2rem; top: 1.05rem; width: 0.8rem; height: 0.42rem; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

.practice { margin: 0 0 1.4rem; padding: 1.3rem 1.5rem; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--copper); border-radius: 0 8px 8px 0; }
.practice p:last-child { margin-bottom: 0; }

.assess-link { margin: 2.6rem 0 0; padding: 1.4rem 1.5rem; background: var(--tint); border-radius: 8px; }
.assess-link p { margin: 0 0 1rem; }
.btn { display: inline-block; padding: 0.7rem 1.2rem; border-radius: 4px; font-weight: 600; font-size: 1rem; text-decoration: none; border: 1.5px solid var(--btn); background: var(--btn); color: var(--btn-ink); }
.btn:hover { filter: brightness(1.08); }

.pager { display: flex; justify-content: space-between; gap: 1.5rem; margin-top: 2.6rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: 1rem; }
.pager span, .pager a { display: block; }
.pager .label { color: var(--muted); font-size: 0.9rem; }
.pager .next { text-align: right; margin-left: auto; }
.pager .soon { color: var(--muted); }

/* Contents page */
.contents { list-style: none; margin: 0; padding: 0; counter-reset: item; border-top: 1px solid var(--line); }
.contents li { counter-increment: item; display: grid; grid-template-columns: 2.4rem 1fr; column-gap: 0.75rem; padding: 1.05rem 0; border-bottom: 1px solid var(--line); }
.contents li::before { content: counter(item); font-family: var(--display); font-style: italic; font-size: 1.7rem; line-height: 1.1; color: var(--copper); }
.contents h2 { font-size: 1.4rem; line-height: 1.2; }
.contents h2 a { color: var(--accent); }
.contents p { margin: 0.25rem 0 0; color: var(--muted); font-size: 1rem; }
.contents .status { font-size: 0.9rem; }

footer { border-top: 1px solid var(--line); padding-block: 1.6rem; font-size: 0.95rem; color: var(--muted); }
footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
footer a { color: var(--muted); margin-left: 1.4rem; }

@media (max-width: 40rem) {
  body { font-size: 1.0625rem; }
  .site-head nav { gap: 1rem; }
  .site-head nav a, .theme-toggle { white-space: nowrap; }
  .practice, .assess-link { padding: 1.1rem 1.15rem; }
}

@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --text: #111; --muted: #444; --line: #bbb; --accent: #1f5c45; --copper: #a04f22; --tint: #f1f1f1; }
  body { font-size: 11pt; }
  .site-head nav, .skip, .pager, footer .links { display: none; }
  .chapter .column > h2 { break-after: avoid; }
  .moves li, .practice, .assess-link { break-inside: avoid; }
  a { color: inherit; }
}
