/* ============================================================
   OutcomeDev documentation section
   Loaded after /styles.css and only by pages under /docs/.
   It adds the section layout — a contents rail beside the text —
   and nothing else. Every colour, radius, border and transition
   comes from the variables styles.css already defines, so the
   documentation follows the site theme, light and dark.
   ============================================================ */

/* ---------------------------------------------------------------- shell */

.docs {
  /* styles.css defines --card for the dark theme only, because the marketing
     pages never needed a raised surface in light. Scoped here rather than
     added to the shared stylesheet. */
  --card: #ffffff;
  padding: 128px 0 80px;
}

[data-theme="dark"] .docs { --card: #181818; }

.docs-shell {
  display: grid;
  grid-template-columns: 244px 1fr;
  gap: 56px;
  align-items: start;
}

/* The contents rail stays with the reader on a wide screen. */
.docs-rail {
  position: sticky;
  top: 108px;
  max-height: calc(100vh - 148px);
  overflow-y: auto;
  padding-right: 4px;
}

@media (max-width: 900px) {
  .docs { padding: 104px 0 56px; }
  .docs-shell { grid-template-columns: 1fr; gap: 24px; }
  .docs-rail { position: static; max-height: none; overflow: visible; }
}

/* ---------------------------------------------------------------- rail */

.docs-rail-title,
.docs-rail-group {
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 0 0 12px;
}

.docs-rail-group { margin-top: 24px; }

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-nav a {
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-2);
  padding: 7px 12px;
  border-radius: var(--r-lg);
  border-left: 2px solid transparent;
  transition: background 700ms var(--ease), color 700ms var(--ease);
}
.docs-nav a:hover { background: var(--bg-2); color: var(--ink); }
.docs-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The page being read, so the rail says where the reader is. */
.docs-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  background: var(--line-2);
  border-left-color: var(--ink);
}

/* On a narrow screen the rail folds into one native disclosure. No script. */
.docs-mobile { display: none; }

@media (max-width: 900px) {
  .docs-mobile { display: block; }
  .docs-rail-desktop { display: none; }
}

.docs-mobile > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--card, #fff);
}
.docs-mobile > summary::-webkit-details-marker { display: none; }
.docs-mobile > summary::after {
  content: "+";
  font-size: 18px;
  line-height: 1;
  color: var(--ink-4);
}
.docs-mobile[open] > summary::after { content: "\2212"; }
.docs-mobile > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.docs-mobile .docs-nav { margin-top: 12px; }

@media (max-width: 900px) {
  .docs-mobile .docs-nav a {
    border-left: 0;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 10px 14px;
  }
  .docs-mobile .docs-nav a[aria-current="page"] { border-color: var(--ink-4); }
}

/* ---------------------------------------------------------------- page */

.docs-breadcrumb {
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.docs-breadcrumb a {
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
}
.docs-breadcrumb a:hover { color: var(--ink); border-bottom-color: var(--ink-4); }

/* The documentation home wears the same heading scale as every other
   page on the site; inner pages open smaller, because the rail already
   says which section the reader is in. */
.docs h1 {
  font-size: 56px;
  line-height: 1;
  letter-spacing: -2px;
  font-weight: 700;
  margin-bottom: 16px;
}
.docs-title {
  font-size: 40px;
  line-height: 44px;
  letter-spacing: -1.2px;
  font-weight: 700;
  margin-bottom: 16px;
}
@media (max-width: 860px) {
  .docs h1 { font-size: 36px; letter-spacing: -1.2px; }
  .docs-title { font-size: 30px; line-height: 36px; letter-spacing: -0.8px; }
}

/* min-width: 0 keeps a wide table inside the column instead of widening it. */
.docs-body { min-width: 0; }

.docs-prose { margin-top: 32px; max-width: 700px; }

.docs h2 {
  font-size: 24px;
  line-height: 32px;
  letter-spacing: -0.5px;
  font-weight: 700;
  margin: 40px 0 12px;
  max-width: 700px;
}
.docs-prose > h2:first-child { margin-top: 0; }
/* A heading that follows a block reads as a tighter break than one that
   follows a paragraph, because the block already carries margin below it. */
.docs-table + h2,
.docs ul + h2,
.docs ol + h2 { margin-top: 32px; }

.docs h3 {
  font-size: 17px;
  line-height: 26px;
  font-weight: 700;
  margin: 24px 0 8px;
}

.docs p {
  font-size: 16px;
  line-height: 26px;
  color: var(--ink-2);
  margin-bottom: 16px;
  max-width: 700px;
}

.docs ul,
.docs ol {
  margin: 0 0 16px;
  padding-left: 22px;
  max-width: 700px;
}
.docs li {
  font-size: 16px;
  line-height: 26px;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.docs li strong { color: var(--ink); font-weight: 600; }

.docs a.inline {
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1px solid var(--ink-4);
}
.docs a.inline:hover { border-bottom-color: var(--ink); }

/* ---------------------------------------------------------------- blocks */

.docs-card-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 32px 0 8px;
  padding: 0;
  list-style: none;
  max-width: none;
}
@media (max-width: 700px) { .docs-card-list { grid-template-columns: 1fr; } }

.docs-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  padding: 20px 22px;
  background: var(--card, #fff);
  transition: border-color 700ms var(--ease), transform 700ms var(--ease);
}
.docs-card:hover { border-color: var(--ink-4); transform: translateY(-2px); }
.docs-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.docs-card strong {
  display: block;
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.docs-card span {
  display: block;
  font-size: 14px;
  line-height: 21px;
  color: var(--ink-3);
}

/* A stated limit, or a thing worth pausing on. */
.docs-note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-4);
  border-radius: var(--r-lg);
  background: var(--bg-2);
  padding: 16px 20px;
  margin: 0 0 24px;
  max-width: 700px;
}
.docs-note p {
  margin: 0;
  font-size: 15px;
  line-height: 24px;
  color: var(--ink-2);
}
.docs-note p + p { margin-top: 10px; }
.docs-note strong { color: var(--ink); font-weight: 700; }

/* Facts that have to be read exactly: prices, counts, names. */
.docs-table {
  width: 100%;
  max-width: 700px;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: 0 0 24px;
}
.docs-table th,
.docs-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  line-height: 23px;
  vertical-align: top;
}
.docs-table tr:last-child th,
.docs-table tr:last-child td { border-bottom: 0; }
.docs-table th {
  font-size: 12px;
  line-height: 18px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--bg-2);
}
.docs-table td { color: var(--ink-2); }
.docs-table td strong { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------- pager */

.docs-pager {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  max-width: 700px;
}
.docs-pager a {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--ink);
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.docs-pager a:hover { color: var(--ink-2); }
.docs-pager a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.docs-pager .docs-pager-all { color: var(--ink-3); font-weight: 500; }
