/* API reference — Stripe-inspired docs layout */

.api-docs-shell {
    --docs-sidebar-w: 17.5rem;
    --docs-code-bg: #0f172a;
    --docs-border: #e2e8f0;
    --docs-muted: #64748b;
    --docs-accent: #2563eb;
}

.api-docs-layout {
    display: grid;
    grid-template-columns: 1fr;
    min-height: calc(100vh - 4.25rem);
}

@media (min-width: 1024px) {
    .api-docs-layout {
        grid-template-columns: var(--docs-sidebar-w) 1fr;
    }
}

.api-docs-sidebar {
    border-bottom: 1px solid var(--docs-border);
    background: #f8fafc;
    padding: 1.25rem 1rem 2rem;
}

@media (min-width: 1024px) {
    .api-docs-sidebar {
        position: sticky;
        top: 4.25rem;
        height: calc(100vh - 4.25rem);
        overflow-y: auto;
        border-bottom: none;
        border-right: 1px solid var(--docs-border);
        padding: 1.75rem 1.25rem 2rem;
    }
}

.api-docs-sidebar-title {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--docs-muted);
    margin-bottom: 0.75rem;
}

.api-docs-nav a {
    display: block;
    border-radius: 0.5rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    transition: background 0.15s, color 0.15s;
}

.api-docs-nav a:hover,
.api-docs-nav a.is-active {
    background: #eff6ff;
    color: var(--docs-accent);
}

.api-docs-main {
    padding: 2rem 1.25rem 4rem;
    max-width: 52rem;
}

@media (min-width: 640px) {
    .api-docs-main {
        padding: 2.5rem 2rem 5rem;
    }
}

.api-docs-hero {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--docs-border);
}

.api-docs-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #0f172a;
}

.api-docs-hero p {
    margin-top: 0.75rem;
    font-size: 1.0625rem;
    color: var(--docs-muted);
    max-width: 38rem;
}

.api-docs-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.api-docs-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 9999px;
    border: 1px solid var(--docs-border);
    background: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
}

.api-docs-section {
    scroll-margin-top: 6rem;
    padding-top: 2.5rem;
}

.api-docs-section:first-of-type {
    padding-top: 0;
}

.api-docs-section h2 {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

.api-docs-section h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #1e293b;
    margin: 1.75rem 0 0.5rem;
}

.api-docs-section p,
.api-docs-section li {
    color: #475569;
    font-size: 0.9375rem;
    line-height: 1.65;
}

.api-docs-section ul {
    margin: 0.75rem 0;
    padding-left: 1.25rem;
    list-style: disc;
}

.api-docs-endpoint {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #f1f5f9;
    scroll-margin-top: 6rem;
}

.api-docs-endpoint-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.api-docs-method {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.25rem;
    border-radius: 0.375rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    font-family: ui-monospace, monospace;
}

.api-docs-method-get { background: #dcfce7; color: #166534; }
.api-docs-method-post { background: #dbeafe; color: #1d4ed8; }
.api-docs-method-delete { background: #fee2e2; color: #b91c1c; }
.api-docs-method-patch { background: #fef3c7; color: #b45309; }

.api-docs-path {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    word-break: break-all;
}

.api-docs-table-wrap {
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid var(--docs-border);
    border-radius: 0.75rem;
}

.api-docs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.api-docs-table th {
    text-align: left;
    background: #f8fafc;
    padding: 0.65rem 0.85rem;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid var(--docs-border);
}

.api-docs-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
    color: #334155;
}

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

.api-docs-table code {
    font-size: 0.75rem;
    background: #f1f5f9;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
}

.api-docs-code-block {
    position: relative;
    margin: 1rem 0;
    border-radius: 0.75rem;
    background: var(--docs-code-bg);
    overflow: hidden;
}

.api-docs-code-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.api-docs-copy-btn {
    border: 1px solid #475569;
    background: transparent;
    color: #cbd5e1;
    border-radius: 0.375rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.api-docs-copy-btn:hover {
    background: #334155;
    border-color: #64748b;
}

.api-docs-code-block pre {
    margin: 0;
    padding: 1rem 1.1rem 1.15rem;
    overflow-x: auto;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.api-docs-callout {
    margin: 1.25rem 0;
    border-radius: 0.75rem;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    padding: 1rem 1.1rem;
    font-size: 0.875rem;
    color: #1e40af;
}

.api-docs-callout-warn {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.api-docs-hub-grid {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .api-docs-hub-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.api-docs-hub-card {
    display: block;
    border-radius: 1rem;
    border: 1px solid var(--docs-border);
    background: white;
    padding: 1.5rem;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.api-docs-hub-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.08);
    transform: translateY(-2px);
}

.api-docs-hub-card h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
}

.api-docs-hub-card p {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--docs-muted);
}

.api-docs-hub-card .arrow {
    margin-top: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--docs-accent);
}
