/* River & Branch buyer guides: one shared stylesheet for every product guide.
   Plain CSS, no external fonts or libraries. Colors are defined once below. */

:root {
  --ink: #17191c;
  --text: #2b2f34;
  --muted: #5b6168;
  --paper: #fbfaf7;
  --surface: #f2efe8;
  --line: #dcd6cb;
  --accent: #2f5d50;
  --accent-soft: #e6eeea;
  --on-accent: #ffffff;
  --note-bg: #fbf3e4;
  --note-line: #c9973d;
  --radius: 8px;
  --measure: 46rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
}

/* ---------- Accessibility helpers ---------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
}

.skip-link:focus {
  top: 1rem;
}

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

/* ---------- Site header and footer ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.site-header .bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
}

.brand {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand span {
  color: var(--muted);
  font-weight: 400;
}

.site-header .help {
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer .inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem 1.25rem 2.5rem;
}

.site-footer p {
  margin: 0.25rem 0;
}

/* ---------- Page layout ---------- */

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 0;
}

.page-intro {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.kicker {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-wrap: balance;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  line-height: 1.25;
  text-wrap: balance;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 2.75rem);
  letter-spacing: -0.015em;
}

h2 {
  margin: 3.5rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--ink);
  font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
  letter-spacing: -0.01em;
}

h3 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.3125rem;
}

h4 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.0625rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

li + li {
  margin-top: 0.35rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

.lead {
  color: var(--text);
  font-size: 1.1875rem;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

code {
  padding: 0.05em 0.35em;
  border-radius: 4px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

kbd {
  padding: 0.05em 0.4em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #fff;
  font-family: var(--mono);
  font-size: 0.85em;
}

/* Keeps phone numbers and license numbers on one line. */
.nowrap {
  white-space: nowrap;
}

.back-to-top {
  margin: 2.5rem 0 0;
  font-size: 0.9375rem;
  text-align: right;
}

.back-to-top a {
  display: inline-block;
  padding: 0.35rem 0;
}

/* ---------- Callouts ---------- */

.notice,
.tip,
.important {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
}

.notice {
  border: 1px solid var(--note-line);
  border-left-width: 6px;
  background: var(--note-bg);
}

.tip {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
}

.important {
  border-left: 4px solid var(--note-line);
  background: var(--note-bg);
}

.notice > :last-child,
.tip > :last-child,
.important > :last-child {
  margin-bottom: 0;
}

.callout-title {
  margin: 0 0 0.35rem;
  color: var(--ink);
  font-weight: 700;
}

/* ---------- Table of contents and overview ---------- */

.toc {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.toc h2 {
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
}

/* Parts are not numbered, so their numbers can't be confused with task numbers. */
.toc > ol {
  padding-left: 0;
  list-style: none;
}

.toc > ol > li + li {
  margin-top: 0.5rem;
}

.toc ol ol {
  margin-top: 0.35rem;
  padding-left: 1.75rem;
  font-size: 0.9375rem;
  columns: 2 16rem;
  column-gap: 2rem;
}

.toc ol ol li {
  break-inside: avoid;
}

.steps-overview {
  display: grid;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: overview;
}

.steps-overview li {
  position: relative;
  margin: 0;
  padding: 0.85rem 1rem 0.85rem 3.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  counter-increment: overview;
}

.steps-overview li::before {
  content: counter(overview);
  position: absolute;
  left: 1rem;
  top: 0.85rem;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
}

.steps-overview a {
  display: block;
  width: fit-content;
  margin-top: 0.2rem;
}

/* ---------- Tasks ---------- */

/* "Task 1" and its Required/Optional badge sit on one line above the task title. */
.task-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  color: var(--ink);
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-required {
  background: var(--accent);
  color: var(--on-accent);
}

.badge-optional {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.where {
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  background: var(--surface);
}

.where strong:first-child {
  color: var(--ink);
}

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

.table-wrap {
  margin: 1rem 0 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96875rem;
}

th,
td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

thead th {
  background: var(--surface);
  color: var(--ink);
  font-size: 0.875rem;
  white-space: nowrap;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody th {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Checklists ---------- */

.checklist {
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-left: 2rem;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.3rem;
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid var(--accent);
  border-radius: 3px;
  background: #fff;
}

/* ---------- Product cards (resources index) ---------- */

.guide-list {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

.guide-card {
  margin: 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.guide-card h2 {
  margin: 0 0 0.35rem;
  padding: 0;
  border: 0;
  font-size: 1.25rem;
}

.guide-card p {
  margin: 0 0 0.5rem;
}

.guide-card a {
  display: inline-block;
  padding: 0.3rem 0;
}

/* ---------- Small screens ---------- */

@media (max-width: 40rem) {
  body {
    font-size: 1rem;
  }

  main {
    padding-top: 1.75rem;
  }

  .lead {
    font-size: 1.0625rem;
  }

  main ol,
  main ul {
    padding-left: 1.35rem;
  }

  h3 {
    font-size: 1.1875rem;
  }

  .toc {
    padding: 1rem 1.1rem;
  }

  .toc a {
    display: inline-block;
    padding: 0.2rem 0;
  }

  /* Tables become stacked rows: the label first, then the details. */
  .table-wrap thead {
    display: none;
  }

  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
  }

  .table-wrap tr {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--line);
  }

  .table-wrap tbody tr:last-child {
    border-bottom: 0;
  }

  .table-wrap th,
  .table-wrap td {
    padding: 0;
    border: 0;
  }

  .table-wrap tbody th {
    margin-bottom: 0.15rem;
  }

  .table-wrap .numbered tr {
    display: grid;
    grid-template-columns: 1.25rem 1fr;
    column-gap: 0.5rem;
  }

  .table-wrap .numbered td:first-child {
    grid-row: span 2;
    color: var(--ink);
    font-weight: 700;
  }
}

/* ---------- Print ---------- */

@media print {
  :root {
    --paper: #ffffff;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 10.5pt;
    line-height: 1.5;
  }

  .skip-link,
  .site-header .help,
  .toc,
  .back-to-top {
    display: none;
  }

  .steps-overview li::before {
    border: 1px solid #000;
    background: none;
    color: #000;
  }

  .site-header,
  .site-footer {
    background: none;
  }

  main {
    max-width: none;
    padding: 0;
  }

  /* Content flows continuously; headings stay whole and with the text that follows. */
  h2,
  h3,
  h4 {
    break-inside: avoid;
    break-after: avoid;
  }

  .notice,
  .tip,
  .important,
  .where,
  tr {
    break-inside: avoid;
  }

  .table-wrap {
    overflow: visible;
    border-color: #999;
  }

  a {
    color: #000;
  }

  .badge-required {
    border: 1px solid #000;
    background: none;
    color: #000;
  }
}
