/* ============================================
   API DOCUMENTATION PAGE
   Static reference (/api/docs) + interactive Swagger UI (/api/docs/interactive)
   ============================================ */

/* Hero offset — replaces hardcoded inline padding-top across the API docs pages */
.api-docs-hero {
    padding-top: var(--page-hero-offset, 100px);
    padding-bottom: 60px;
}

.api-docs-hero--compact {
    padding-bottom: 20px;
}

/* HTTP method badges (theme-consistent, replaces inline bg-*-600 utilities) */
.api-method {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    padding: 0.1rem 0.5rem;
    border-radius: 0.25rem;
    letter-spacing: 0.02em;
}

.api-method--get { background: #2563eb; }
.api-method--post { background: #059669; }
.api-method--put { background: #d97706; }
.api-method--delete { background: #dc2626; }

/* ── Table of contents: collapsible accordion on mobile, static on desktop ── */

.api-toc-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--theme-card-border, var(--theme-border));
    border-radius: 0.625rem;
    background: var(--theme-card-bg, var(--theme-surface));
    color: var(--theme-text);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.api-toc-toggle .api-toc-chevron {
    transition: transform 0.2s ease;
}

.api-toc-toggle[aria-expanded="true"] .api-toc-chevron {
    transform: rotate(180deg);
}

@media (max-width: 1023px) {
    .api-toc-toggle {
        display: flex;
    }

    .api-toc-nav {
        display: none;
        margin-top: 0.5rem;
    }

    .api-toc-nav.is-open {
        display: block;
    }
}

/* ── Swagger UI container (moved out of inline <style> for CSP cleanliness) ── */

.swagger-ui .topbar {
    display: none;
}

.swagger-ui .info {
    margin: 20px 0 10px;
}

.swagger-ui .scheme-container {
    padding: 15px 0;
    background: transparent;
    box-shadow: none;
}

.swagger-ui .auth-wrapper {
    display: flex;
    justify-content: flex-end;
}

.swagger-ui .btn.authorize {
    border-color: var(--brand-primary, #6366f1);
    color: var(--brand-primary, #6366f1);
}

.swagger-ui .btn.authorize svg {
    fill: var(--brand-primary, #6366f1);
}

/* Graceful fallback while/if swagger-ui.css is still loading */
.swagger-loading-note {
    text-align: center;
    color: var(--theme-text-muted);
    font-size: 0.9rem;
    padding: 2rem 0;
}
