/*
 * VoipAgent documentation site (redesign plan 6.2). Switchboard tokens, one
 * stylesheet, no JavaScript framework. Task-oriented docs in the documentation
 * voice: declarative, present-tense, specific (Blueprint §doc-voice).
 *
 * Loaded after tokens.css + fonts.css. Layout: fixed sidebar nav on desktop,
 * stacked on mobile. Content column caps at a readable measure.
 */

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--surface-0);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

code, pre, .mono { font-family: var(--font-mono); }

a { color: var(--signal-soft); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-ring-offset); border-radius: 3px; }

/* ── Shell ─────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  border-right: 1px solid var(--hairline);
  background: var(--surface-1);
  padding: 22px 18px;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 9px; margin-bottom: 22px; }
.brand-dot { width: 10px; height: 10px; border-radius: var(--radius-pill); background: var(--signal); flex-shrink: 0; }
.brand-name { font-weight: 700; font-size: 15px; color: var(--ink); letter-spacing: -0.01em; }
.brand-name span { color: var(--ink-muted); font-weight: 500; }

.nav-group { margin-bottom: 18px; }
.nav-group-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-faint); margin: 0 0 7px 4px;
}
.nav a {
  display: block; padding: 6px 10px; border-radius: var(--radius-ctl);
  color: var(--ink-muted); font-size: 13.5px; line-height: 1.35;
}
.nav a:hover { background: var(--surface-2); color: var(--ink-soft); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--signal-faint); color: var(--signal-soft); font-weight: 500; }

/* ── Content ───────────────────────────────────────────────────────── */
.content { padding: 40px 44px 96px; }
.doc { max-width: 720px; margin: 0 auto; }

.doc h1 { font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 6px; color: var(--ink); }
.doc .lede { font-size: 16px; color: var(--ink-muted); margin: 0 0 32px; }
.doc h2 { font-size: 20px; letter-spacing: -0.01em; margin: 40px 0 12px; color: var(--ink); }
.doc h3 { font-size: 15px; margin: 26px 0 8px; color: var(--ink-soft); }
.doc p { margin: 0 0 14px; color: var(--ink-soft); }
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 22px; color: var(--ink-soft); }
.doc li { margin-bottom: 6px; }
.doc strong { color: var(--ink); font-weight: 600; }

.doc code {
  background: var(--surface-2); border: 1px solid var(--hairline-soft);
  padding: 1px 6px; border-radius: 6px; font-size: 13px; color: var(--ink);
}
.doc pre {
  background: var(--surface-1); border: 1px solid var(--hairline);
  border-radius: var(--radius-ctr); padding: 16px 18px; overflow-x: auto;
  font-size: 13px; line-height: 1.5; margin: 0 0 18px;
}
.doc pre code { background: none; border: none; padding: 0; color: var(--ink-soft); }

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 20px; }
.steps > li {
  counter-increment: step; position: relative; padding: 0 0 16px 40px; margin: 0;
  border-left: 1px solid var(--hairline); margin-left: 13px;
}
.steps > li:last-child { border-left-color: transparent; }
.steps > li::before {
  content: counter(step); position: absolute; left: -13px; top: -2px;
  width: 26px; height: 26px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--hairline);
  color: var(--ink-soft); font-family: var(--font-mono); font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.steps > li .step-title { font-weight: 600; color: var(--ink); display: block; margin-bottom: 2px; }

/* Callouts */
.note, .warn {
  border-radius: var(--radius-ctr); padding: 12px 16px; margin: 0 0 18px;
  font-size: 14px; border: 1px solid;
}
.note { background: var(--info-faint); border-color: var(--info-edge); color: var(--info-soft); }
.warn { background: var(--warn-faint); border-color: var(--warn-edge); color: var(--warn-soft); }
.note strong, .warn strong { color: inherit; }

/* Definition rows */
.deflist { border: 1px solid var(--hairline); border-radius: var(--radius-ctr); overflow: hidden; margin: 0 0 20px; }
.deflist > div { display: grid; grid-template-columns: 180px 1fr; gap: 0; border-bottom: 1px solid var(--hairline-soft); }
.deflist > div:last-child { border-bottom: 0; }
.deflist dt { padding: 11px 16px; background: var(--surface-1); font-weight: 500; color: var(--ink); font-size: 14px; margin: 0; }
.deflist dd { padding: 11px 16px; margin: 0; color: var(--ink-soft); font-size: 14px; }

.pagenav { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--hairline); }
.pagenav a { font-size: 14px; }

.tag {
  display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--warn-tint); color: var(--warn-soft); border: 1px solid var(--warn-edge);
  vertical-align: middle; margin-left: 8px;
}

.docfooter { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--hairline-soft); color: var(--ink-faint); font-size: 12px; }

/* Changelog */
.release { margin-bottom: 34px; }
.release h2 { display: flex; align-items: baseline; gap: 12px; margin-top: 0; }
.release-date { font-family: var(--font-mono); font-size: 13px; color: var(--ink-faint); font-weight: 400; }
.release ul { margin-top: 8px; }

/* ── Mobile ────────────────────────────────────────────────────────── */
/* Desktop: nav always shown, the summary toggle hidden. */
.nav-collapse summary { display: none; }
.nav-body { display: block; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--hairline);
  }
  .content { padding: 28px 22px 72px; }
  /* Mobile: collapse nav behind the summary; open reveals it. */
  .nav-collapse summary {
    list-style: none; cursor: pointer; color: var(--ink-muted); font-size: 13px;
    padding: 8px 10px; border: 1px solid var(--hairline); border-radius: var(--radius-ctl);
    display: flex; align-items: center; gap: 8px;
  }
  .nav-collapse summary::-webkit-details-marker { display: none; }
  .nav-body { display: none; margin-top: 12px; }
  .nav-collapse[open] .nav-body { display: block; }
  .deflist > div { grid-template-columns: 1fr; }
  .deflist dt { border-bottom: 1px solid var(--hairline-soft); }
}
