/* ============================================================
   docs.css — layout for the documentation pages only.
   Depends on ../style.css for the design tokens (:root custom
   properties) and the shared header / footer / button styles.
   Nothing here redefines a token owned by ../style.css.
   ============================================================ */

:root {
  --doc-measure: 760px;
  --doc-code-bg: #0b1222;
  --doc-placeholder: #f0b849;
}

/* ---------- Header adjustments for one-level-deep pages ---------- */

.docs-header-inner {
  height: auto;
  min-height: 68px;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.docs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.docs-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.docs-nav a:hover,
.docs-nav a:focus-visible { color: var(--blue-bright); }

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

.doc-page { padding: 40px 0 88px; }

.doc-container {
  max-width: var(--doc-measure);
  margin: 0 auto;
  padding: 0 24px;
  min-width: 0;
}

/* ---------- Breadcrumb ---------- */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  color: var(--text-faint);
}

.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--blue-bright); }

.breadcrumb li + li::before {
  content: "/";
  color: var(--text-faint);
  margin-right: 8px;
}

.breadcrumb [aria-current="page"] { color: var(--text); }

/* ---------- Article ---------- */

.doc-article { min-width: 0; }

.doc-eyebrow {
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.74rem;
  font-weight: 700;
  margin: 0 0 12px;
}

.doc-article h1 {
  font-size: 2.1rem;
  line-height: 1.2;
  margin: 0 0 14px;
  overflow-wrap: break-word;
}

.doc-lead {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin: 0 0 32px;
}

.doc-article h2 {
  font-size: 1.32rem;
  line-height: 1.3;
  margin: 46px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 92px;
  overflow-wrap: break-word;
}

.doc-article h3 {
  font-size: 1.04rem;
  margin: 30px 0 10px;
  color: var(--text);
  scroll-margin-top: 92px;
}

.doc-article p,
.doc-article li {
  color: var(--text-dim);
  font-size: 0.95rem;
}

.doc-article p { margin: 0 0 16px; }

.doc-article ul,
.doc-article ol { margin: 0 0 18px; padding-left: 22px; }

.doc-article li { margin-bottom: 8px; }
.doc-article li > ul,
.doc-article li > ol { margin: 8px 0 0; }

.doc-article a {
  color: var(--blue-bright);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.doc-article strong { color: var(--text); font-weight: 600; }

.doc-article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* ---------- Contents list ---------- */

.doc-toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 0 0 40px;
}

.doc-toc h2 {
  margin: 0 0 12px;
  padding: 0;
  border: none;
  font-size: 0.74rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-faint);
}

.doc-toc ol {
  margin: 0;
  padding-left: 20px;
}

.doc-toc li { margin-bottom: 6px; color: var(--text-faint); }

.doc-toc a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.92rem;
}

.doc-toc a:hover { color: var(--blue-bright); text-decoration: underline; }

/* ---------- Code ---------- */

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.doc-article :not(pre) > code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text);
}

pre {
  background: var(--doc-code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 20px;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

pre code {
  display: block;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.65;
  white-space: pre;
  overflow-wrap: normal;
}

pre code .c { color: var(--text-faint); }

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

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 0 0 24px;
}

.callout > :last-child { margin-bottom: 0; }

.callout-title {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--blue-bright);
  margin-bottom: 8px;
}

.callout-warn { border-left-color: var(--doc-placeholder); }
.callout-warn .callout-title { color: var(--doc-placeholder); }

.callout-scope { border-left-color: var(--green); }
.callout-scope .callout-title { color: var(--green); }

/* ---------- Placeholders the reader must fill in ---------- */

.ph {
  color: var(--doc-placeholder);
  background: rgba(240, 184, 73, 0.10);
  border: 1px dashed rgba(240, 184, 73, 0.55);
  border-radius: 5px;
  padding: 0 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  overflow-wrap: anywhere;
}

pre .ph {
  background: none;
  border: none;
  padding: 0;
  border-bottom: 1px dashed rgba(240, 184, 73, 0.55);
}

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

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 0 24px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 520px;
}

.doc-table th,
.doc-table td {
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-dim);
}

.doc-table thead th {
  color: var(--text);
  font-size: 0.8rem;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: var(--surface-2);
}

.doc-table tbody tr:last-child td { border-bottom: none; }

.doc-table td code { white-space: nowrap; }

/* ---------- Step list ---------- */

.doc-steps { counter-reset: step; list-style: none; padding-left: 0; }

.doc-steps > li {
  position: relative;
  padding-left: 40px;
  margin-bottom: 20px;
}

.doc-steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--blue-bright);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Prev / next ---------- */

.doc-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.doc-pager-link {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease;
  min-width: 0;
}

.doc-pager-link:hover { border-color: var(--blue-bright); }

.doc-pager-dir {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.doc-pager-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--blue-bright);
  overflow-wrap: break-word;
}

.doc-pager-next { text-align: right; grid-column: 2; }

.doc-pager-empty { visibility: hidden; }

/* ---------- Footer note ---------- */

.doc-footer-note { margin-top: 40px; }

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

@media (max-width: 640px) {
  .doc-page { padding: 28px 0 64px; }
  .doc-container { padding: 0 16px; }
  .doc-article h1 { font-size: 1.65rem; }
  .doc-article h2 { font-size: 1.18rem; margin-top: 38px; }
  .doc-lead { font-size: 1rem; }
  .doc-pager { grid-template-columns: minmax(0, 1fr); }
  .doc-pager-next { text-align: left; grid-column: 1; }
  .doc-pager-empty { display: none; }
  .docs-header-inner { padding-left: 16px; padding-right: 16px; }
  pre { padding: 14px; }
}
