/* ─────────────────────────────────────────────────────────────────
   Wink Developers — docs page shell + prose styles
   Used by every layered-doc page (Core API, Core SDKs, WinkKey, MCP).
   ───────────────────────────────────────────────────────────────── */

/* ─── Layer-aware breadcrumb bar ──────────────────────────────────── */
.layer-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.layer-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--indigo-light);
}
.layer-bar a {
  color: var(--indigo-light);
  text-decoration: none;
  font-weight: 500;
}
.layer-bar a:hover { color: var(--indigo); }
.layer-bar .sep { color: var(--border); user-select: none; }
.layer-bar .here { color: var(--text); font-weight: 600; }
.layer-bar .layer-pill { margin-left: auto; }

/* ─── Page shell — sidebar + main ─────────────────────────────────── */
.page {
  display: grid;
  grid-template-columns: 240px 1fr;
  max-width: var(--max-width);
  margin: 0 auto;
  gap: 0;
  min-height: calc(100vh - 200px);
}
.side {
  border-right: 1px solid var(--border);
  padding: 32px 24px 32px 32px;
}
.side h6 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--indigo-light);
  margin: 0 0 12px;
  font-weight: 700;
}
.side h6:not(:first-child) { margin-top: 28px; }
.side ul { list-style: none; padding: 0; margin: 0; }
.side li { margin-bottom: 2px; }
.side li a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 120ms, color 120ms;
}
.side li a:hover { background: var(--surface-cool); }
.side li a.active {
  background: var(--teal-tint);
  color: var(--teal);
  font-weight: 700;
}
.side li a.disabled {
  color: var(--indigo-light);
  cursor: default;
  opacity: 0.7;
}
.side li a.disabled:hover { background: transparent; }
.side li a .soon {
  float: right;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--surface-cool);
  color: var(--indigo-light);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
  font-weight: 700;
}

/* ─── Doc head (eyebrow + title + lead) ───────────────────────────── */
.doc {
  background: var(--surface);
  min-width: 0;
  padding: 32px 56px 80px;
}
.doc-head { padding-bottom: 28px; border-bottom: 1px solid var(--border); margin-bottom: 36px; }
.doc-head .eyebrow { display: block; margin-bottom: 8px; }
.doc-head h1 {
  font-size: 36px;
  color: var(--indigo);
  margin: 0 0 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.doc-head .lead {
  font-size: 17px;
  color: var(--indigo-light);
  margin: 0;
  max-width: 720px;
  line-height: 1.55;
}
.doc-head .meta {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.doc-head .meta .item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface-cool);
  padding: 6px 12px;
  border-radius: 8px;
}
.doc-head .meta .item code {
  color: var(--indigo);
  font-size: 12.5px;
}

/* ─── Prose ───────────────────────────────────────────────────────── */
.doc-prose { max-width: 760px; }
.doc-prose h2 {
  font-size: 24px;
  color: var(--indigo);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 56px 0 16px;
  padding-top: 8px;
  scroll-margin-top: 90px;
}
.doc-prose h2:first-of-type { margin-top: 0; }
.doc-prose h3 {
  font-size: 18px;
  color: var(--text);
  font-weight: 700;
  margin: 32px 0 10px;
  scroll-margin-top: 90px;
}
.doc-prose p {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 16px;
}
.doc-prose p strong { color: var(--indigo); font-weight: 700; }
.doc-prose ul, .doc-prose ol {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 16px;
  padding-left: 22px;
}
.doc-prose li { margin-bottom: 6px; }
.doc-prose code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  background: rgba(61, 60, 138, 0.06);
  color: var(--indigo);
  padding: 1px 6px;
  border-radius: 4px;
}
.doc-prose a { color: var(--indigo); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.doc-prose a:hover { color: var(--indigo-deep); }

/* ─── Code blocks ────────────────────────────────────────────────── */
.codeblock {
  background: #1F1E3A;
  border-radius: 12px;
  margin: 16px 0 24px;
  overflow: hidden;
}
.codeblock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.codeblock-head .lang {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.codeblock-head .filepath {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}
.codeblock pre {
  margin: 0;
  padding: 16px 20px;
  overflow-x: auto;
  background: transparent;
}
.codeblock pre code {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: #E8E8F2;
  background: transparent;
  padding: 0;
  border-radius: 0;
  display: block;
  white-space: pre;
}
.codeblock .kw { color: #C397F1; }
.codeblock .str { color: #98D982; }
.codeblock .num { color: #F4B860; }
.codeblock .com { color: #6B6985; font-style: italic; }
.codeblock .fn { color: #7CC5F7; }
.codeblock .type { color: #F0A9C7; }

/* ─── Callouts ───────────────────────────────────────────────────── */
.callout {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  margin: 20px 0;
  font-size: 14.5px;
  line-height: 1.55;
}
.callout .icon { line-height: 1.4; font-weight: 800; }
.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }
.callout-info { background: var(--teal-tint); color: var(--text); border-left: 3px solid var(--teal); }
.callout-info .icon { color: var(--teal); }
.callout-warn { background: rgba(218, 10, 79, 0.06); color: var(--text); border-left: 3px solid var(--magenta); }
.callout-warn .icon { color: var(--magenta); }
.callout-note { background: rgba(61, 60, 138, 0.06); color: var(--text); border-left: 3px solid var(--indigo); }
.callout-note .icon { color: var(--indigo); }

/* ─── Gotcha cards (the WinkKey hard-won lessons) ────────────────── */
.gotchas { display: grid; gap: 14px; margin: 16px 0 24px; }
.gotcha {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start;
}
.gotcha .num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--magenta);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}
.gotcha h4 {
  margin: 0 0 4px;
  font-size: 15.5px;
  color: var(--indigo);
  font-weight: 700;
  letter-spacing: -0.005em;
}
.gotcha p {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
}
.gotcha p code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: rgba(61, 60, 138, 0.06);
  color: var(--indigo);
  padding: 1px 6px;
  border-radius: 4px;
}
.gotcha .severity {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  align-self: start;
  white-space: nowrap;
}
.gotcha .severity.blocker { background: rgba(218, 10, 79, 0.10); color: var(--magenta); }
.gotcha .severity.high { background: #FEF3C7; color: #92400E; }
.gotcha .severity.medium { background: var(--surface-cool); color: var(--indigo-light); }

/* ─── Step list (numbered procedure) ─────────────────────────────── */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 24px 44px;
  margin: 0;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--indigo);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}
.steps > li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 13px;
  top: 32px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}
.steps h3 {
  margin: 4px 0 8px;
  font-size: 17px;
  color: var(--indigo);
  font-weight: 700;
}

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .page { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--border); padding: 20px; }
  .doc { padding: 24px 20px 56px; }
  .layer-bar-inner { padding: 0 20px; flex-wrap: wrap; }
  .layer-bar .layer-pill { margin-left: 0; }
  .gotcha { grid-template-columns: auto 1fr; }
  .gotcha .severity { grid-column: 2; justify-self: start; margin-top: 6px; }
}
