/* ==========================================================
   ConnectPay — docs page specific styles
   ========================================================== */

.docs-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 56px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px;
  align-items: start;
}
@media (max-width: 960px) {
  .docs-shell { grid-template-columns: 1fr; padding: 20px; gap: 24px; }
}

/* ====================== Sidebar ====================== */

.docs-sidebar {
  position: sticky;
  top: 84px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 16px;
}
.docs-sidebar::-webkit-scrollbar { width: 6px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

.docs-sidebar h5 {
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 24px 0 10px;
}
.docs-sidebar h5:first-child { margin-top: 0; }

.docs-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.docs-sidebar a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.docs-sidebar a:hover { color: var(--text); background: var(--bg-muted); }
.docs-sidebar a.active {
  color: #854D0E;
  background: var(--brand-grad-soft);
  border-left-color: var(--brand-1);
  font-weight: 500;
}
[data-theme="dark"] .docs-sidebar a.active { color: #FDE047; border-left-color: #FDE047; }

@media (max-width: 960px) {
  .docs-sidebar {
    position: fixed;
    top: 68px;
    left: 0;
    bottom: 0;
    width: 280px;
    max-height: none;
    background: var(--bg);
    border-right: 1px solid var(--border);
    padding: 24px 20px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 40;
  }
  .docs-sidebar.open { transform: translateX(0); }
}

.docs-sidebar-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  font-size: 13px;
  color: var(--text-muted);
}
@media (max-width: 960px) { .docs-sidebar-toggle { display: inline-flex; } }

/* ====================== Main content ====================== */

.docs-main {
  max-width: 800px;
  min-width: 0;
}
.docs-main > section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}
.docs-main > section:first-of-type { padding-top: 24px; }
.docs-main > section:last-of-type { border-bottom: none; }

.docs-main h1 {
  font-size: clamp(34px, 4vw, 44px);
  margin-bottom: 12px;
  letter-spacing: -.02em;
}
.docs-main h2 {
  font-size: 28px;
  margin-bottom: 12px;
  letter-spacing: -.02em;
}
.docs-main h3 {
  font-size: 18px;
  font-family: var(--f-display);
  font-weight: 600;
  margin: 28px 0 10px;
}
.docs-main p {
  color: var(--text-muted);
  font-size: 15.5px;
  margin: 0 0 14px;
  line-height: 1.65;
}
.docs-main p strong { color: var(--text); font-weight: 500; }

.docs-main ul, .docs-main ol {
  color: var(--text-muted);
  padding-left: 22px;
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.7;
}
.docs-main ul li::marker { color: var(--brand-2); }

.docs-lede {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 660px;
  margin-bottom: 32px;
}

.docs-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Docs header — mobile */
.nav--docs {
  position: sticky;
}
.nav--docs .brand--docs {
  min-width: 0;
  flex: 1;
  gap: 6px;
  padding-right: 0;
  overflow: hidden;
}
.nav--docs .brand-logo-img {
  height: 28px;
  width: auto;
  max-width: min(140px, 42vw);
  object-fit: contain;
  object-position: left center;
  flex-shrink: 1;
}
@media (max-width: 920px) {
  .nav--docs .docs-pill { display: none; }
}
@media (max-width: 640px) {
  .nav--docs .brand-logo-img {
    height: 24px;
    max-width: min(120px, 38vw);
  }
  .nav--docs .nav-inner {
    border-radius: 14px;
  }
  .nav--docs .nav-mobile {
    left: 8px;
    right: 8px;
    border-radius: 16px;
  }
  .docs-shell {
    padding: 16px 12px;
  }
}

/* Inline code */
code.inline {
  font-family: var(--f-mono);
  font-size: 12.5px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--text);
}

/* Callout */
.callout {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--brand-grad-soft);
  border: 1px solid color-mix(in srgb, var(--brand-1) 40%, transparent);
  margin: 16px 0 22px;
  font-size: 14.5px;
}
.callout .ic {
  flex-shrink: 0;
  color: #854D0E;
  margin-top: 2px;
}
[data-theme="dark"] .callout .ic { color: #FDE047; }
.callout p { color: var(--text); margin: 0; }
.callout p + p { margin-top: 6px; color: var(--text-muted); }

/* Endpoint header */
.endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  font-family: var(--f-mono);
  font-size: 13px;
  margin: 12px 0 20px;
  flex-wrap: wrap;
}
.endpoint .method {
  padding: 3px 8px;
  border-radius: 5px;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .04em;
}
.endpoint .method.post { background: color-mix(in srgb, var(--brand-1) 28%, transparent); color: var(--brand-ink); }
.endpoint .method.get  { background: var(--brand-ink); color: var(--brand-1); }
.endpoint .method.del  { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
[data-theme="dark"] .endpoint .method.post { background: var(--brand-1); color: var(--brand-ink); }
.endpoint .path { color: var(--text); }

/* Params table */
.params-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 20px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.params-table th, .params-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.params-table th {
  background: var(--bg-muted);
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
}
.params-table tr:last-child td { border-bottom: none; }
.params-table td:first-child {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--text);
  width: 32%;
  white-space: nowrap;
}
.params-table td .req {
  display: inline-block;
  font-family: var(--f-body);
  font-size: 10.5px;
  color: var(--red);
  margin-left: 6px;
  letter-spacing: .04em;
  vertical-align: middle;
}
.params-table td .opt {
  display: inline-block;
  font-family: var(--f-body);
  font-size: 10.5px;
  color: var(--text-dim);
  margin-left: 6px;
  letter-spacing: .04em;
  vertical-align: middle;
}
.params-table td .type {
  display: block;
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 3px;
}
.params-table td p {
  font-size: 13.5px;
  margin: 0;
  line-height: 1.55;
}

/* Step list */
.step-list {
  list-style: none !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 14px;
  counter-reset: step;
  margin: 18px 0 8px !important;
}
.step-list li {
  position: relative;
  padding: 16px 18px 16px 56px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-elev);
  font-size: 14.5px;
  counter-increment: step;
}
.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand-grad);
  color: var(--brand-ink);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
}
.step-list li strong {
  display: block;
  font-family: var(--f-display);
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}
.step-list li span {
  color: var(--text-muted);
  font-size: 13.5px;
}

/* Integration cards */
.integ-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 16px 0 24px;
}
@media (max-width: 720px) { .integ-grid { grid-template-columns: 1fr 1fr; } }
.integ-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-elev);
  transition: border-color .2s ease, transform .2s ease;
}
.integ-card:hover { border-color: var(--brand-1); transform: translateY(-2px); }
.integ-card .logo {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--brand-grad-soft);
  color: #854D0E;
  display: grid; place-items: center;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 12px;
  border: 1px solid color-mix(in srgb, var(--brand-1) 30%, transparent);
}
[data-theme="dark"] .integ-card .logo { color: #FDE047; }
.integ-card h4 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}
.integ-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* FAQ */
.faq {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 18px 0;
}
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-elev);
  overflow: hidden;
}
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 15.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--f-mono);
  font-size: 18px;
  color: var(--text-dim);
  transition: transform .2s ease;
}
.faq details[open] summary::after { content: "−"; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq details div {
  padding: 14px 18px 18px;
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Try-it widget */
.try-widget {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: 18px 0 8px;
}
.try-head {
  padding: 14px 18px;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--text-muted);
}
.try-head .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 6px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 20%, transparent); }
.try-body { display: grid; grid-template-columns: 1fr 1fr; min-height: 320px; }
@media (max-width: 720px) { .try-body { grid-template-columns: 1fr; } }
.try-form-side {
  padding: 20px;
  border-right: 1px solid var(--border);
  background: var(--bg-elev);
}
@media (max-width: 720px) { .try-form-side { border-right: none; border-bottom: 1px solid var(--border); } }
.try-form-side label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 12px 0 4px;
  font-weight: 500;
}
.try-form-side label:first-child { margin-top: 0; }
.try-form-side input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-mono);
  font-size: 13px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.try-form-side input:focus {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-1) 20%, transparent);
}
.try-form-side .row {
  display: flex; gap: 8px; align-items: center; margin-top: 18px;
}
.try-form-side .row .btn { flex: 1; }
.try-resp-side {
  background: #0A0A0A;
  padding: 18px;
  overflow-x: auto;
  position: relative;
  min-height: 320px;
}
.try-resp-side pre {
  margin: 0;
  font-family: var(--f-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #E8E5DA;
  white-space: pre-wrap;
  word-break: break-word;
}
.try-resp-side .placeholder {
  color: #7A7766;
  font-family: var(--f-mono);
  font-size: 12.5px;
}
.try-status {
  position: absolute;
  top: 14px; right: 16px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
