/* ============================================================
   API Reference Page
   ============================================================ */

.content {
    position: relative;
    z-index: 1;
    padding: 100px 0 160px;
}

.container-narrow {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 60px;
}

.lead {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 300;
    font-style: italic;
    color: var(--text-dim);
    line-height: 1.65;
    margin-bottom: 60px;
    border-left: 2px solid var(--gold);
    padding-left: 32px;
}

/* ── Base URL banner ── */
.api-base {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 24px;
    background: rgba(212, 175, 55, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 4px;
    margin-bottom: 72px;
}

.api-base-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.7;
    white-space: nowrap;
}

.api-base code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--text-dim);
    background: none;
    padding: 0;
}

/* ── API Group ── */
.api-group {
    margin-bottom: 80px;
}

.api-group-header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.api-group-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 300;
    color: var(--text);
    margin-bottom: 10px;
    line-height: 1.1;
}

.api-group-desc {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ── Endpoint card ── */
.endpoint {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 32px;
    margin-bottom: 16px;
    transition: border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.endpoint::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    background: var(--gold);
    transition: height 0.4s ease;
}

.endpoint:hover {
    border-color: rgba(212, 175, 55, 0.3);
}

.endpoint:hover::before {
    height: 100%;
}

/* ── Endpoint header ── */
.endpoint-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* ── HTTP Method badges ── */
.method {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 3px;
    min-width: 64px;
    text-align: center;
    flex-shrink: 0;
}

.method.get    { background: transparent; color: var(--gold); border: 1px solid var(--gold); box-shadow: 0 0 8px rgba(212,175,55,0.15); }
.method.post   { background: var(--gold); color: #0a0a0a; border: 1px solid var(--gold); box-shadow: 0 0 12px rgba(212,175,55,0.3); }
.method.put    { background: transparent; color: var(--gold-dim); border: 1px solid var(--gold-dim); }
.method.patch  { background: rgba(212,175,55,0.08); color: var(--text-dim); border: 1px solid var(--border); }
.method.delete { background: transparent; color: #c06040; border: 1px solid rgba(192,96,64,0.5); }

.endpoint-path {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    color: var(--text);
    background: none;
    padding: 0;
    flex: 1;
}

.endpoint-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 2px;
}

.endpoint-desc {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 300;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 24px;
}

/* ── Endpoint details grid ── */
.endpoint-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.detail-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.7;
    margin-bottom: 4px;
}

/* ── Parameter rows ── */
.param-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.param-row:last-child { border-bottom: none; }

.param-row code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--gold);
    background: rgba(212,175,55,0.08);
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.param-row span {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 300;
    color: var(--text-muted);
}

/* ── Code blocks (request / response) ── */
.code-request,
.code-response {
    background: #0d0d0d;
    border: 1px solid rgba(212,175,55,0.15);
    border-radius: 4px;
    padding: 16px 20px;
    margin: 0;
    overflow-x: auto;
}

[data-theme="light"] .code-request,
[data-theme="light"] .code-response {
    background: #f5f0e6;
    border-color: rgba(180, 140, 20, 0.22);
}

.code-request code,
.code-response code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.8;
    background: none;
    padding: 0;
    display: block;
}

/* Dark theme syntax tokens */
.cr-brace   { color: #808080; }
.cr-bracket { color: #808080; }
.cr-key     { color: #d4af37; }
.cr-colon   { color: #606060; }
.cr-comma   { color: #606060; }
.cr-str     { color: #a8c8a0; }
.cr-num     { color: #a0b8d8; }
.cr-bool    { color: #c0a0c0; }

/* Light theme syntax tokens */
[data-theme="light"] .cr-brace   { color: #6a6050; }
[data-theme="light"] .cr-bracket { color: #6a6050; }
[data-theme="light"] .cr-key     { color: #8a6010; }
[data-theme="light"] .cr-colon   { color: #9a9080; }
[data-theme="light"] .cr-comma   { color: #9a9080; }
[data-theme="light"] .cr-str     { color: #3a6a3a; }
[data-theme="light"] .cr-num     { color: #2a4a7a; }
[data-theme="light"] .cr-bool    { color: #6a3a6a; }

/* ── Page nav ── */
.page-nav {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-top: 120px;
    padding-top: 60px;
    border-top: 1px solid var(--border);
}

.page-nav-link {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-decoration: none;
    transition: opacity 0.3s ease;
    flex: 1;
}

.page-nav-link.prev { align-items: flex-start; }
.page-nav-link.next { align-items: flex-end; text-align: right; }
.page-nav-link:hover { opacity: 0.7; }

.page-nav-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.page-nav-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 300;
    color: var(--gold);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .container-narrow { padding: 0 40px; }
    .endpoint-details { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .container-narrow { padding: 0 24px; }
    .endpoint { padding: 24px 20px; }
    .endpoint-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .endpoint-path { font-size: 13px; word-break: break-all; }
    .page-nav { flex-direction: column; gap: 20px; }
    .page-nav-link.next { align-items: flex-start; text-align: left; }
}

@media (max-width: 480px) {
    .container-narrow { padding: 0 20px; }
    .code-request code, .code-response code { font-size: 11px; }
}
