/* CodeB Credential Provider V2 manual - page-specific styles on top of ../styles.css
   (uses the site's colour and font variables, so it follows the same dark theme). */

.manual-meta { margin-top: 1rem; font-size: 0.75rem; letter-spacing: 0.1em; color: var(--fg-3); text-transform: uppercase; }

@media (min-width: 880px) {
  .manual-layout { grid-template-columns: minmax(220px, 0.42fr) 1.58fr; gap: 3.5rem; }
}
.manual-side { font-size: 0.94rem; }
.manual-side .manual-chapters { list-style: none; padding: 0; margin: 0; counter-reset: ch; }
.manual-side .manual-chapters li { counter-increment: ch; margin-bottom: 0.3rem; }
.manual-side .manual-chapters a::before {
  content: counter(ch, decimal-leading-zero);
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--fg-3); margin-right: 0.6rem;
}
.manual-side a[aria-current="page"] { color: var(--fg-0); background: var(--bg-1); border-left-color: var(--accent); }
.manual-side a[aria-current="page"]::before { color: var(--accent); }
.manual-side .manual-toc { list-style: none; padding: 0; margin: 0; }
.manual-side .manual-toc a { font-size: 0.88rem; padding: 0.35rem 0.75rem; }
@media (min-width: 880px) {
  .manual-side { max-height: calc(100vh - 120px); overflow-y: auto; }
}

.manual-body { min-width: 0; max-width: 78ch; }
.manual-body > section { scroll-margin-top: 100px; margin-bottom: 3.25rem; }
.manual-body h2 {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.45rem, 2.4vw, 1.8rem);
  margin: 0 0 1.1rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--line-1);
}
.manual-body h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; margin: 2rem 0 0.6rem; scroll-margin-top: 100px; }
.manual-body p, .manual-body li { color: var(--fg-1); line-height: 1.7; }
.manual-body ul, .manual-body ol { padding-left: 1.3rem; margin: 0 0 1.1rem; }
.manual-body li { margin-bottom: 0.35rem; }
.manual-body a:not(.btn) { color: var(--accent); border-bottom: 1px solid var(--accent-tint-strong); }
.manual-body a:not(.btn):hover { border-bottom-color: var(--accent); }
.manual-body .spec-table { margin-top: 0.5rem; }
.manual-body .table-wrap { margin: 0.5rem 0 1.5rem; }
.manual-body .spec-table td:first-child { width: auto; min-width: 12rem; }
.manual-body .spec-table td { vertical-align: top; color: var(--fg-1); }
.manual-body .spec-table.reg td:first-child code { white-space: nowrap; }
.manual-body pre.cli { white-space: pre; }

/* short answer block for people and AI assistants (GEO) */
.tldr {
  border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: var(--radius-lg);
  background: var(--bg-1); padding: 1.1rem 1.3rem; margin: 0 0 2.25rem;
}
.tldr p { margin: 0; }
.tldr .kicker { display: block; margin-bottom: 0.4rem; color: var(--accent); }

.callout {
  border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--bg-1);
  padding: 1rem 1.2rem; margin: 1.1rem 0 1.5rem;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout .kicker { display: block; margin-bottom: 0.35rem; }
.callout.warn { border-left: 3px solid var(--bad); }
.callout.warn .kicker { color: var(--bad); }
.callout.note { border-left: 3px solid var(--ok); }
.callout.note .kicker { color: var(--ok); }

.manual-body dl.defs { margin: 0 0 1.25rem; }
.manual-body dl.defs dt { font-weight: 600; color: var(--fg-0); margin-top: 0.9rem; }
.manual-body dl.defs dd { margin: 0.2rem 0 0; color: var(--fg-1); line-height: 1.65; }

.chapter-grid { display: grid; grid-template-columns: 1fr; gap: 0.9rem; margin: 0.5rem 0 1.5rem; }
@media (min-width: 640px) { .chapter-grid { grid-template-columns: 1fr 1fr; } }
.manual-body .chapter-grid a {
  display: block; border: 1px solid var(--line-1); border-radius: var(--radius-lg); background: var(--bg-1);
  padding: 1rem 1.1rem; color: var(--fg-1); border-bottom: 1px solid var(--line-1);
}
.manual-body .chapter-grid a:hover { border-color: var(--accent); }
.chapter-grid strong { display: block; color: var(--fg-0); margin-bottom: 0.25rem; }
.chapter-grid span { font-size: 0.9rem; color: var(--fg-2); }

.manual-body .flow { margin: 0.5rem 0 1.5rem; }
.manual-body .flow-step { padding: 1.35rem 0; grid-template-columns: 56px 1fr; }
.manual-body .flow-step .step-num { font-size: 2rem; }
.manual-body .flow-step h3 { margin-top: 0; font-size: 1.1rem; }

.manual-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line-1); }
.manual-body .manual-pager a {
  display: block; border: 1px solid var(--line-1); border-radius: var(--radius-lg); padding: 0.9rem 1rem;
  color: var(--fg-0); border-bottom: 1px solid var(--line-1); font-weight: 500;
}
.manual-body .manual-pager a:hover { border-color: var(--accent); }
.manual-pager .kicker { display: block; margin-bottom: 0.25rem; }
.manual-pager .manual-next { grid-column: 2; text-align: right; }

@media print {
  .site-header, .site-footer, .cta-strip, .manual-side, .manual-pager { display: none !important; }
  .manual-layout { display: block; }
  body { background: #fff; color: #000; }
}

/* chapter links: number and text side by side; on small screens only the chapter list is shown above the text */
.manual-side .manual-chapters a { display: flex; gap: 0.6rem; align-items: baseline; }
.manual-side .manual-chapters a::before { margin-right: 0; flex: none; }
@media (max-width: 879px) {
  .manual-side .manual-toc, .manual-side .manual-toc-head { display: none !important; }
}

/* inline code in tables: break only when a token does not fit on a line of its own */
.manual-body .spec-table code, .manual-body p code, .manual-body li code {
  word-break: normal; overflow-wrap: break-word;
}

/* phones: stack table rows instead of scrolling sideways */
@media (max-width: 640px) {
  .manual-body .table-wrap { overflow-x: visible; }
  .manual-body .spec-table, .manual-body .spec-table tbody { display: block; width: 100%; }
  .manual-body .spec-table thead { display: none; }
  .manual-body .spec-table tr { display: block; padding: 0.7rem 0; border-bottom: 1px solid var(--line-1); }
  .manual-body .spec-table tr:last-child { border-bottom: 0; }
  .manual-body .spec-table td { display: block; border: 0; padding: 0.2rem 1rem; width: auto; min-width: 0; }
  .manual-body .spec-table.reg td:nth-child(2)::before {
    content: "Default: "; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--fg-3);
  }
}
.manual-body .flow-step > div { min-width: 0; }
@media (max-width: 640px) { .manual-body code { overflow-wrap: anywhere; } .manual-body .flow-step { grid-template-columns: 44px minmax(0, 1fr); } }
