/* =================================================================
   SYMIOS: API Docs — layout & color on home.css design tokens
   ================================================================= */

html.symios-home-page,
html.symios-home-page body.symios-home-page {
  background: var(--home-bg);
  color: var(--home-fg);
  font-family: var(--font-os, 'Open Sans', sans-serif);
}

html.symios-home-page body.symios-home-page {
  margin: 0;
}

/*
 * Sticky footer without the iOS Safari gap under the footer.
 * Prefer svh (small viewport): 100vh on iPhone is taller than the visible
 * viewport and left a scrollable empty band below .home-footer.
 */
.docs-main {
  width: 100%;
}

.docs-frame {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
}

.docs-frame > .home-header,
.docs-frame > .home-footer,
.docs-error-shell > .home-header,
.docs-error-shell > .home-footer {
  flex: 0 0 auto;
}

/* ---- Subnav (sits under shared .home-header) ---- */
.docs-subnav {
  position: sticky;
  top: 64px;
  z-index: 9;
  border-bottom: 1px solid var(--home-line);
  background: var(--home-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.docs-subnav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 28px);
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.docs-subnav-inner::-webkit-scrollbar {
  display: none;
}

.docs-subnav a {
  flex: 0 0 auto;
  padding: 14px 14px 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--home-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

.docs-subnav a:hover {
  color: var(--home-fg);
  text-decoration: none;
}

.docs-subnav a.active,
.docs-subnav a[aria-current="page"] {
  color: var(--home-fg);
  border-bottom-color: var(--home-gold);
}

/* ---- Page shell ---- */
.docs-page {
  position: relative;
  isolation: isolate;
  flex: 1 0 auto;
  padding: clamp(36px, 5vw, 56px) clamp(18px, 4vw, 28px) clamp(56px, 8vw, 88px);
  background:
    radial-gradient(720px 280px at 12% -10%, rgba(201, 168, 106, 0.12), transparent 60%),
    radial-gradient(640px 260px at 92% 0%, rgba(38, 76, 114, 0.10), transparent 55%),
    var(--home-bg);
  color: var(--home-muted);
}

html.symios-home-page[data-theme="dark"] .docs-page {
  background:
    radial-gradient(720px 280px at 12% -10%, rgba(201, 168, 106, 0.08), transparent 60%),
    radial-gradient(640px 260px at 92% 0%, rgba(89, 112, 153, 0.16), transparent 55%),
    var(--home-bg);
}

.docs-page-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
}

.docs-page-inner--wide {
  max-width: 960px;
}

.docs-eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--home-eyebrow, #8a6b2e);
}

html.symios-home-page[data-theme="dark"] .docs-eyebrow {
  color: var(--home-gold);
}

.docs-title {
  margin: 0 0 14px;
  color: var(--home-fg);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.docs-lead {
  margin: 0 0 28px;
  max-width: 42rem;
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  line-height: 1.6;
  color: var(--home-muted);
}

.docs-section {
  margin-bottom: 32px;
}

.docs-section h2 {
  margin: 0 0 14px;
  color: var(--home-fg);
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.docs-section p,
.docs-section li {
  margin: 0 0 12px;
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  line-height: 1.65;
  color: var(--home-muted);
}

.docs-section ul {
  margin: 0 0 12px;
  padding-left: 1.2em;
}

.docs-section a {
  color: var(--home-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

html.symios-home-page[data-theme="dark"] .docs-section a {
  color: var(--home-gold);
}

.docs-section a:hover {
  color: var(--home-accent-hover);
}

/* ---- CTAs ---- */
.docs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 0;
}

.docs-actions .home-nav-cta {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.docs-actions .docs-btn-secondary {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--home-border);
  color: var(--home-fg);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  background: var(--home-surface);
  box-shadow: var(--home-card-shadow);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.docs-actions .docs-btn-secondary:hover {
  border-color: var(--home-gold);
  box-shadow: var(--home-card-shadow-hover);
  text-decoration: none;
  transform: translateY(-1px);
}

/* ---- Cards ---- */
.docs-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
}

@media (max-width: 860px) {
  .docs-cards {
    grid-template-columns: 1fr;
  }
}

.docs-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 20px;
  border-radius: 16px;
  border: 1px solid var(--home-line);
  background: var(--home-surface);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--home-card-shadow);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  position: relative;
  overflow: hidden;
}

.docs-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background .15s ease;
}

.docs-card:hover {
  border-color: rgba(201, 168, 106, 0.55);
  box-shadow: var(--home-card-shadow-hover);
  text-decoration: none;
  transform: translateY(-2px);
  color: inherit;
}

.docs-card:hover::before {
  background: var(--home-gold);
}

.docs-card h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--home-fg);
}

.docs-card p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--home-muted);
}

/* ---- Tables ---- */
.docs-table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--home-line);
  background: var(--home-surface);
  box-shadow: var(--home-card-shadow);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.95rem;
}

.docs-table th,
.docs-table td {
  border-bottom: 1px solid var(--home-line);
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
}

.docs-table tr:last-child th,
.docs-table tr:last-child td {
  border-bottom: none;
}

.docs-table th {
  color: var(--home-fg);
  font-weight: 700;
  background: var(--home-chip);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.docs-table td {
  color: var(--home-muted);
}

/* ---- Code ---- */
.docs-page pre {
  margin: 0 0 14px;
  padding: 16px 18px;
  border-radius: 14px;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.55;
  background: #1c2537;
  color: #e8eef8;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--home-card-shadow);
}

html.symios-home-page[data-theme="light"] .docs-page pre {
  background: #243047;
}

.docs-page code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 0.9em;
  color: inherit;
}

.docs-page :not(pre) > code {
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: var(--home-chip);
  color: var(--home-fg);
  border: 1px solid var(--home-line);
  font-weight: 500;
}

.docs-endpoint-list {
  margin: 0;
  padding-left: 1.1rem;
}

.docs-endpoint-list li {
  margin: 6px 0;
}

.docs-endpoint-list code {
  font-size: 0.86em;
}

/* ---- API endpoint docs ---- */
.docs-api-section > h2 {
  margin-top: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--home-line);
}

.docs-endpoint {
  margin: 28px 0 40px;
  padding: 22px 20px 8px;
  border-radius: 16px;
  border: 1px solid var(--home-line);
  background: var(--home-surface);
  box-shadow: var(--home-card-shadow);
}

.docs-endpoint-title {
  margin: 0 0 18px;
  color: var(--home-fg);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.docs-endpoint-block {
  margin-bottom: 20px;
}

.docs-endpoint-label {
  margin: 0 0 8px;
  color: var(--home-fg);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.docs-endpoint-empty {
  margin: 0;
  color: var(--home-muted);
  font-size: 0.95rem;
}

.docs-endpoint-path {
  margin: 0;
}

.docs-endpoint-path .docs-http-method {
  color: #7dd3fc;
  font-weight: 700;
}

.docs-endpoint-path .docs-path-param {
  color: #f9c74f;
  font-weight: 600;
  padding: 0.05em 0.28em;
  border-radius: 4px;
  background: rgba(249, 199, 79, 0.14);
}

.docs-page pre .docs-http-method {
  color: #7dd3fc;
  font-weight: 700;
}

.docs-page pre .docs-path-param {
  color: #f9c74f;
  font-weight: 600;
  padding: 0.05em 0.28em;
  border-radius: 4px;
  background: rgba(249, 199, 79, 0.14);
}

.docs-example-card {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 48px),
    #151c2b;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 28px rgba(12, 18, 32, 0.28);
}

html.symios-home-page[data-theme="light"] .docs-example-card {
  border-color: rgba(28, 37, 55, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 48px),
    #1a2233;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 8px 22px rgba(28, 37, 55, 0.12);
}

.docs-example-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.28);
}

.docs-segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.docs-segmented-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(232, 238, 248, 0.72);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}

.docs-segmented-btn:hover {
  color: #e8eef8;
  background: rgba(255, 255, 255, 0.08);
}

.docs-segmented-btn.is-active {
  color: #151c2b;
  background: var(--home-gold);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}

.docs-segmented-btn:focus-visible {
  outline: 2px solid var(--home-gold);
  outline-offset: 2px;
}

.docs-example-panels {
  padding: 0;
  background: rgba(0, 0, 0, 0.16);
}

.docs-example-panel {
  margin: 0 !important;
  padding: 18px 18px 20px !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  color: #e4ebf6 !important;
  font-size: 0.82rem !important;
  line-height: 1.65 !important;
}

.docs-example-panel code {
  color: inherit;
  font-size: inherit;
}

.docs-example-panel[hidden] {
  display: none !important;
}

.docs-footer-note {
  margin: 36px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--home-line);
  font-size: 0.9rem;
  color: var(--home-muted);
}

.docs-footer-note a {
  color: var(--home-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

html.symios-home-page[data-theme="dark"] .docs-footer-note a {
  color: var(--home-gold);
}

/* ---- Site error ---- */
.docs-error-shell {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: inherit;
}

.docs-error-page {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  padding-top: clamp(24px, 4vw, 40px);
  padding-bottom: clamp(24px, 4vw, 40px);
}

.docs-error-inner {
  width: 100%;
  max-width: 640px;
  text-align: left;
}

.docs-error-code {
  margin: 0 0 8px;
  font-family: var(--font-os, 'Open Sans', sans-serif);
  font-size: clamp(3.5rem, 10vw, 5.5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--home-fg);
  opacity: 0.14;
}

.docs-error-message {
  margin-bottom: 16px;
}

.docs-error-hint {
  margin: 0 0 28px;
  max-width: 36rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--home-muted);
}

.docs-error-page .docs-actions {
  margin-top: 0;
}

@media (max-width: 700px) {
  .docs-subnav {
    top: 56px;
  }

  .docs-subnav a {
    padding: 12px 10px 10px;
    font-size: 12px;
  }

  /* No language switcher on docs — pull theme + Contact to the right. */
  .home-nav .home-theme {
    margin-left: auto;
  }

  .home-nav .home-nav-cta .cta-full {
    display: inline;
  }

  .home-nav .home-nav-cta .cta-short {
    display: none;
  }
}

/* ---- MCP partner guide ---- */
.docs-lead--tight {
  margin-top: -12px;
}

.docs-mcp-actions {
  margin: 0 0 28px;
}

.docs-mcp-endpoint {
  margin: 0 0 36px;
  padding: 18px 20px 16px;
  border-radius: 16px;
  border: 1px solid var(--home-line);
  background: var(--home-surface);
  box-shadow: var(--home-card-shadow);
}

.docs-mcp-endpoint__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.docs-mcp-endpoint__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--home-eyebrow, #8a6b2e);
}

html.symios-home-page[data-theme="dark"] .docs-mcp-endpoint__label {
  color: var(--home-gold);
}

.docs-mcp-endpoint__badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--home-fg);
  background: var(--home-chip);
  border: 1px solid var(--home-line);
}

.docs-mcp-endpoint__url {
  margin: 0 0 10px !important;
}

.docs-mcp-endpoint__note {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--home-muted);
}

.docs-mcp-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.docs-mcp-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 !important;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--home-line);
  background: var(--home-surface);
  box-shadow: var(--home-card-shadow);
}

.docs-mcp-checklist__n {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--home-fg);
  background: var(--home-chip);
  border: 1px solid var(--home-line);
}

.docs-mcp-auth-grid,
.docs-mcp-app-grid,
.docs-mcp-split {
  display: grid;
  gap: 14px;
}

.docs-mcp-auth-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.docs-mcp-app-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.docs-mcp-split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 760px) {
  .docs-mcp-auth-grid,
  .docs-mcp-app-grid,
  .docs-mcp-split {
    grid-template-columns: 1fr;
  }
}

.docs-mcp-auth-card,
.docs-mcp-app-card,
.docs-mcp-panel {
  padding: 20px 18px;
  border-radius: 16px;
  border: 1px solid var(--home-line);
  background: var(--home-surface);
  box-shadow: var(--home-card-shadow);
}

.docs-mcp-auth-card__eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--home-eyebrow, #8a6b2e);
}

html.symios-home-page[data-theme="dark"] .docs-mcp-auth-card__eyebrow {
  color: var(--home-gold);
}

.docs-mcp-auth-card__title,
.docs-mcp-app-card__title,
.docs-mcp-panel h3,
.docs-mcp-code-block__head h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--home-fg);
  letter-spacing: -0.01em;
}

.docs-mcp-auth-card__body {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--home-muted);
}

.docs-mcp-steps {
  margin: 0;
  padding-left: 1.15em;
}

.docs-mcp-steps li {
  margin: 0 0 8px !important;
  font-size: 0.9rem !important;
  line-height: 1.5 !important;
}

.docs-mcp-steps li:last-child {
  margin-bottom: 0 !important;
}

.docs-mcp-code-block {
  margin: 0 0 16px;
}

.docs-mcp-code-block__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.docs-mcp-code-block__head h3 {
  margin: 0;
}

.docs-mcp-code-block__file {
  font-size: 12px;
  font-weight: 600;
  color: var(--home-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.docs-mcp-note {
  margin: 4px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px dashed var(--home-line);
  background: var(--home-chip);
}

.docs-mcp-note p {
  margin: 0 0 8px !important;
  font-size: 0.9rem !important;
}

.docs-mcp-note p:last-child {
  margin-bottom: 0 !important;
}

.docs-mcp-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0 0 14px !important;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--home-chip);
  border: 1px solid var(--home-line);
  font-size: 0.9rem !important;
}

.docs-mcp-flow span[aria-hidden="true"] {
  color: var(--home-gold);
  font-weight: 700;
}

.docs-mcp-panel ul {
  margin: 0;
  padding-left: 1.15em;
}

.docs-mcp-panel li {
  margin: 0 0 8px !important;
  font-size: 0.9rem !important;
}

.docs-mcp-panel li:last-child {
  margin-bottom: 0 !important;
}

.docs-mcp-page .docs-section {
  margin-bottom: 40px;
}

.docs-mcp-page .docs-section > h2 {
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--home-line);
}
