/* The Book of Robin Mood. Layered on the main site's site.css (fonts, palette, cards,
   buttons, coin backdrop); only the book's own layout lives here. No inline styles: the
   CSP forbids them. */

.nav__links > a.btn { font-weight: 600; }
.nav__links > a.btn--green, .nav__links > a.btn--green:hover { color: #fff; }

/* ---------------------------------------------------------------- layout */
.docs {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 28px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 20px 56px;
  align-items: start;
}
.toc { position: sticky; top: calc(var(--nav-h) + 16px); }
.toc__box { padding: 14px 16px; max-height: calc(100vh - var(--nav-h) - 32px); overflow-y: auto; scrollbar-width: thin; }
.toc__title {
  font-family: var(--head); font-weight: 700; font-size: 1.2rem; cursor: pointer; list-style: none;
}
.toc__title::-webkit-details-marker { display: none; }
.toc__title { display: flex; justify-content: space-between; align-items: center; }
.toc__title::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--green-2); }
.toc__box[open] .toc__title::after { content: "\2013"; } /* en dash: every font has it (U+2212 minus is missing from Berlin Sans) */
.toc__list { margin: 10px 0 0; padding-left: 1.6em; display: grid; gap: 2px; list-style: upper-roman; }
.toc__list li::marker { font-family: var(--head); font-weight: 700; color: var(--green-2); font-size: 0.85em; }
.toc__list a {
  display: block; padding: 4px 6px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-family: var(--head); font-weight: 600; font-size: 0.95rem;
}
.toc__list a:hover { background: var(--paper); color: var(--green-2); }
.toc__list a.is-current { background: var(--gold-light); color: var(--ink); }

/* -------------------------------------------------------------- chapters */
.chapters { display: grid; gap: 26px; min-width: 0; }
.chapter { padding: 26px 32px 24px; } /* anchor offset comes from html scroll-padding-top in site.css */
.chapter__num {
  margin: 0; font-family: var(--head); font-weight: 600; text-transform: uppercase; letter-spacing: 1.6px;
  font-size: 0.82rem; color: var(--green-2);
}
.chapter__title { font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 2px 0 14px; }
.chapter h3 { font-size: 1.3rem; margin: 22px 0 6px; }
.chapter p { margin: 0 0 12px; }
.chapter code { background: var(--paper); border: 1px solid rgba(61, 37, 9, 0.25); border-radius: 6px; padding: 1px 6px; font-size: 0.88em; word-break: break-all; }

.welcome { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 22px; align-items: center; }
.welcome__art { width: 100%; max-width: 150px; justify-self: center; }
.welcome__art--sm { max-width: 130px; }

.facts-list {
  margin: 18px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 26px;
  padding-top: 14px; border-top: 2px dashed rgba(61, 37, 9, 0.25);
}
.facts-list div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed rgba(61, 37, 9, 0.2); padding: 4px 0; }
.facts-list dt { color: var(--ink-soft); }
.facts-list dd { margin: 0; font-family: var(--head); font-weight: 650; text-align: right; }

/* numbered road through the fee pipeline */
.road { margin: 6px 0 16px; padding-left: 1.5em; display: grid; gap: 10px; }
.road li::marker { font-family: var(--head); font-weight: 700; color: var(--green-2); }

/* reference tables */
.ref { width: 100%; border-collapse: collapse; margin: 4px 0 8px; }
.ref th, .ref td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid rgba(61, 37, 9, 0.18); }
.ref th { width: 34%; font-family: var(--head); font-weight: 650; color: var(--ink); }
.ref--cmd th { width: 24%; }
.ref--addr td { font-variant-numeric: tabular-nums; }
.ref a { overflow-wrap: anywhere; }
.addr { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.86rem; overflow-wrap: anywhere; }
.pending { font-family: var(--lore); font-style: italic; color: var(--ink-soft); }

.notice {
  margin: 16px 0 4px; padding: 14px 18px;
  background: var(--gold-light); border: var(--outline) solid var(--ink); border-radius: 12px;
}
.notice__title { font-family: var(--head); font-weight: 700; font-size: 1.1rem; margin: 0 0 6px !important; }
.notice p:last-child { margin-bottom: 0; }

.risks { margin: 6px 0 4px; padding-left: 1.2em; display: grid; gap: 8px; }

.decrees { margin: 0; display: grid; gap: 14px; }
.decrees dt { font-family: var(--head); font-weight: 700; font-size: 1.1rem; }
.decrees dd { margin: 4px 0 0; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1020px) {
  .docs { grid-template-columns: 1fr; gap: 18px; padding-top: 20px; }
  .toc { position: static; }
}
@media (max-width: 640px) {
  .chapter { padding: 20px 18px; }
  .welcome { grid-template-columns: 1fr; }
  .welcome__art { max-width: 110px; order: -1; }
  .ref th, .ref td { display: block; width: auto; padding: 4px 2px; border: 0; }
  .ref tr { display: block; padding: 8px 0; border-bottom: 1px solid rgba(61, 37, 9, 0.18); }
}
@media (max-width: 480px) {
  .docs { padding: 16px 14px 40px; }
}
