/* =========================================================
   hispeech.ai — API docs page (Google-docs style)
   © BlueNeyron, LLC
   Loaded after styles.css; reuses its variables/header/footer.
   ========================================================= */

.doc-page { background: var(--bg); }

/* ---------- Two-column layout ---------- */
.doc-layout {
  display: grid;
  grid-template-columns: 268px 1fr;
  gap: 44px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 72px;
}
.doc-content { min-width: 0; font-size: 15.5px; }   /* docs read better a touch smaller than the 17px landing body; min-width:0 lets code blocks scroll instead of stretching the grid */
.doc-content > h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 18px;
}

/* "Copy Page" (for LLM context) button */
.copy-llm-btn {
  display: inline-flex; align-items: center; gap: 12px;
  margin: 0 0 22px; padding: 12px 18px; cursor: pointer; text-align: left;
  background: rgba(35,85,173,.06); color: var(--ink);
  border: 1px solid var(--line); border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm); font: inherit;
  transition: background .15s ease, border-color .15s ease, transform .08s ease;
}
.copy-llm-btn:hover { background: rgba(35,85,173,.12); border-color: var(--blue); }
.copy-llm-btn:active { transform: translateY(1px); }
.copy-llm-icon { font-size: 1.4rem; color: var(--blue); line-height: 1; flex: none; }
.copy-llm-text { display: flex; flex-direction: column; line-height: 1.25; }
.copy-llm-title { font-weight: 700; font-size: 1rem; color: var(--blue); }
.copy-llm-sub { font-size: .82rem; color: var(--muted); }
.copy-llm-btn.copied { background: #e9f8ef; border-left-color: #1a9f5a; }
.copy-llm-btn.copied .copy-llm-title, .copy-llm-btn.copied .copy-llm-icon { color: #1a9f5a; }
/* keep anchored headings clear of the sticky header */
.doc-content h2, .doc-content h3, .doc-content [id] { scroll-margin-top: 84px; }
.tab-panel { scroll-margin-top: 80px; }

/* ---------- Sidebar ---------- */
.doc-sidebar { position: sticky; top: 84px; align-self: start; }
.doc-nav { list-style: none; margin: 0; padding: 0; }
.doc-nav > li { margin: 0 0 2px; }
.doc-nav-link {
  display: block; width: 100%; text-align: left;
  font: inherit; font-size: .98rem; font-weight: 600;
  color: var(--body); background: none;
  border: 0; border-left: 3px solid transparent;
  padding: 10px 14px; border-radius: 0 8px 8px 0; cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.doc-nav-link:hover { background: var(--bg-alt); color: var(--ink); }
.doc-nav-link.is-active { color: var(--blue); border-left-color: var(--blue); background: rgba(35,85,173,.06); }

/* Auto-generated outline of the active section */
.doc-subnav { list-style: none; margin: 2px 0 10px; padding: 0; }
.doc-subnav:empty { margin: 0; }
.doc-subnav a {
  display: block; font-size: .87rem; color: var(--muted);
  padding: 5px 12px 5px 20px; border-left: 2px solid var(--line);
  margin-left: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.doc-subnav a:hover { color: var(--blue); border-left-color: var(--blue); text-decoration: none; }
.doc-subnav a.sub-3 { padding-left: 32px; font-size: .82rem; }

/* ---------- Doc typography ---------- */
.doc-intro {
  background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 30px;
}
.doc-intro h3 { font-size: 1.1rem; margin-bottom: 8px; }
.doc-intro p { margin: 6px 0; }

.doc-content h2 { font-size: 1.42rem; font-weight: 800; margin: 1.7em 0 .45em; padding-bottom: .3em; border-bottom: 1px solid var(--line); }
.doc-content h3 { font-size: 1.16rem; font-weight: 800; margin: 1.5em 0 .45em; }
.doc-content h4 { font-size: 1.02rem; font-weight: 700; margin: 1.2em 0 .4em; }
.doc-content p { margin: .6em 0; line-height: 1.75; }
.doc-content .step { font-weight: 700; color: var(--ink); margin-top: 1.1em; }
.doc-content .note { color: var(--muted); font-size: .95rem; }
.resp-label { color: #1a9f5a; font-weight: 700; font-size: .9rem; margin: 1em 0 .35em; }

/* Inline code */
.doc-content code {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: .9em; color: var(--blue);
  background: rgba(35,85,173,.08); border-radius: 5px; padding: 1px 6px;
}

/* ---------- Code blocks (dark, copyable) ---------- */
.code-block {
  position: relative; background: #0a0f1a; border: 1px solid #1d2738;
  border-radius: var(--radius-sm); margin: 10px 0 16px; overflow: hidden;
}
.code-block pre { margin: 0; padding: 18px; overflow-x: auto; }
.code-block code {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: .86rem; line-height: 1.65; color: #e6edf3;
  background: none; padding: 0; white-space: pre;
}
.copy-btn {
  position: absolute; top: 8px; right: 8px;
  font: inherit; font-size: .78rem; font-weight: 600; color: #c7cedb;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px; padding: 5px 12px; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.copy-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.copy-btn.copied { background: #1a9f5a; color: #fff; border-color: #1a9f5a; }

/* ---------- Response blocks (light, green) ---------- */
.response {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: .85rem; line-height: 1.6; color: #137a45;
  background: #f0faf4; border: 1px solid #cdeedd; border-radius: var(--radius-sm);
  padding: 16px 18px; margin: 0 0 16px; overflow-x: auto; white-space: pre;
}

/* ---------- Supported formats ---------- */
.formats {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: .82rem; color: var(--body); background: var(--bg-alt);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; word-break: break-word; line-height: 1.7;
}

/* ---------- Model meta row ---------- */
.model-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: .3em 0 .8em; }
.model-meta code { font-size: .92rem; font-weight: 600; }
.model-meta .released {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: .88rem;
}
.model-meta .released::before {
  content: ""; width: 14px; height: 14px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 2v2H5a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-2V2h-2v2H9V2H7zm12 7v10H5V9h14z'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}
.model-meta .badge-default {
  background: rgba(35,85,173,.1); color: var(--blue);
  font-weight: 700; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 10px; border-radius: 999px;
}

/* ---------- Audio sample ---------- */
.doc-audio { width: 100%; max-width: 480px; height: 42px; margin: 6px 0 18px; display: block; }

/* ---------- Lists ---------- */
.doc-content .doc-list { margin: .7em 0; padding-left: 1.4em; line-height: 1.85; }
.doc-content .doc-list li { margin: .25em 0; }

/* ---------- Tip callout (lightbulb icon) ---------- */
.tip {
  background: rgba(35,85,173,.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232355ad'%3E%3Cpath d='M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7z'/%3E%3C/svg%3E") no-repeat 14px 13px;
  background-size: 19px 19px;
  border-left: 4px solid var(--blue); border-radius: var(--radius-sm);
  padding: 12px 16px 12px 46px; margin: 14px 0; color: var(--body); line-height: 1.65;
}

/* ---------- Warning (triangle icon) ---------- */
.warning {
  background: rgba(240,85,46,.07) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f0552e'%3E%3Cpath d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3E%3C/svg%3E") no-repeat 16px 15px;
  background-size: 20px 20px;
  border: 1px solid rgba(240,85,46,.3);
  border-left: 4px solid var(--orange); border-radius: var(--radius-sm);
  padding: 14px 18px 14px 48px; margin: 18px 0; color: #b23a18; font-weight: 600; font-size: .85rem; line-height: 1.7;
}

/* ---------- Panels ---------- */
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ---------- Mobile: sidebar becomes a horizontal pill bar on top ---------- */
@media (max-width: 860px) {
  .doc-layout { grid-template-columns: 1fr; gap: 0; padding-top: 16px; }
  .doc-sidebar {
    position: sticky; top: 64px; z-index: 40;
    margin: 0 -20px 22px; padding: 10px 20px;
    background: rgba(255,255,255,.92);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .doc-nav { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .doc-nav::-webkit-scrollbar { display: none; }
  .doc-nav > li { margin: 0; flex: 0 0 auto; }
  .doc-nav-link {
    border-left: 0; border-radius: 999px; white-space: nowrap;
    background: var(--bg-alt); padding: 8px 16px;
  }
  .doc-nav-link.is-active { background: var(--blue); color: #fff; border-left: 0; }
  .doc-subnav { display: none; }   /* hide the auto-outline on mobile */
}
