/*
 * api-access.css
 *   /stocks/{ticker}/{income-statement|balance-sheet|...}, /estimates, /dividends,
 *   /sec-filings, /peers
 *
 * The API access card (markup: includes/api-access.php). The shell is .bq-section like
 * every other pane on these pages; the head is the .bq-io-head pattern (one 12px
 * uppercase title, controls on the right, one hairline under both) and the two
 * switches are the .bq-io-seg segmented control, restated here rather than borrowed
 * because not all five pages load ownership-pages.css. Tokens are the same values
 * as .bq-io's, under a bq-api- prefix so nothing here can reach another card.
 *
 * The code well is a light tint — nothing on these pages is dark — and reads as
 * code through its monospace and the highlighted key alone.
 */

.bq-api {
    --bq-api-ink:       #0b1f2e;
    --bq-api-text:      #37485a;
    --bq-api-muted:     #6b7a89;
    --bq-api-line-mid:  #dfe6ed;
    --bq-api-tint:      #f7fafc;
    --bq-api-tint-2:    #f1f6fa;
    --bq-api-blue:      #00529b;
    --bq-api-blue-mid:  #217ab4;
    --bq-api-blue-soft: rgba(0, 82, 155, .08);
    --bq-api-green:     #15803d;
}

.bq-api .bq-api-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 14px;
    flex-wrap: wrap;
    padding-bottom: 11px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--bq-api-line-mid);
}
/* .bq-section h2 carries its own rule, margins and 18px size — the head's hairline
   replaces them. */
.bq-api .bq-api-head h2 {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .9px;
    text-transform: uppercase;
    color: var(--bq-api-ink);
    line-height: 1.35;
}
.bq-api .bq-api-head-side {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Segmented control (same as .bq-io-seg) ── */
.bq-api .bq-api-seg {
    display: inline-flex;
    padding: 2px;
    background: var(--bq-api-tint-2);
    border: 1px solid var(--bq-api-line-mid);
    border-radius: 5px;
}
.bq-api .bq-api-seg button {
    appearance: none;
    border: 0;
    background: none;
    cursor: pointer;
    padding: 5px 11px;
    border-radius: 3px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .3px;
    color: var(--bq-api-muted);
    line-height: 1.4;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.bq-api .bq-api-seg button:hover { color: var(--bq-api-ink); }
.bq-api .bq-api-seg button.is-active {
    background: #fff;
    color: var(--bq-api-ink);
    box-shadow: 0 1px 2px rgba(0, 42, 69, .14);
}
.bq-api .bq-api-seg button:focus-visible {
    outline: 2px solid var(--bq-api-blue);
    outline-offset: 1px;
}

.bq-api .bq-api-text {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--bq-api-text);
}
.bq-api .bq-api-text code {
    font-size: 12px;
    color: var(--bq-api-ink);
    background: var(--bq-api-tint-2);
    padding: 1px 5px;
    border-radius: 3px;
}

.bq-api .bq-api-code {
    position: relative;
    background: var(--bq-api-tint);
    border: 1px solid var(--bq-api-line-mid);
    border-radius: 6px;
}
.bq-api .bq-api-snippet {
    margin: 0;
    padding: 14px 96px 14px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--bq-api-ink);
    white-space: pre;
    background: transparent;
    border: 0;
}
.bq-api .bq-api-snippet[hidden] { display: none; }
/* A bare URL has no lines to preserve — it wraps, so the key is never scrolled
   out of view. */
.bq-api .bq-api-snippet[data-api-panel="url"] { white-space: pre-wrap; word-break: break-all; }
.bq-api .bq-api-snippet code { font-size: inherit; color: inherit; background: none; padding: 0; }
.bq-api .bq-api-key {
    color: var(--bq-api-blue);
    background: var(--bq-api-blue-soft);
    padding: 1px 3px;
    border-radius: 3px;
}

/* Copy and the two links are the pages' white chrome buttons ("All peers →"). */
.bq-api .bq-api-copy,
.bq-api .bq-api-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    background: #fff;
    border: 1px solid var(--bq-api-line-mid);
    border-radius: 6px;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .3px;
    line-height: 1.4;
    color: var(--bq-api-text);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.bq-api .bq-api-copy:hover,
.bq-api .bq-api-link:hover {
    background: var(--bq-api-tint-2);
    border-color: var(--bq-api-blue-mid);
    color: var(--bq-api-blue);
    text-decoration: none;
}
.bq-api .bq-api-link svg { transition: transform .15s ease; }
.bq-api .bq-api-link:hover svg { transform: translateX(2px); }
.bq-api .bq-api-copy {
    position: absolute;
    top: 9px;
    right: 9px;
}
.bq-api .bq-api-copy.is-copied {
    color: var(--bq-api-green);
    border-color: rgba(21, 128, 61, .35);
    background: rgba(21, 128, 61, .06);
}
.bq-api .bq-api-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

/* global-styles.css forces Lato with !important on everything, so code only gets
   a monospace face by answering in kind. */
.bq-api .bq-api-text code,
.bq-api .bq-api-snippet,
.bq-api .bq-api-snippet * {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace !important;
}

@media (max-width: 768px) {
    .bq-api .bq-api-head-side { width: 100%; }
    .bq-api .bq-api-seg { flex: 1 1 auto; }
    .bq-api .bq-api-seg button { flex: 1 1 0; }
    /* The copy button leaves the well so a phone-width URL isn't hidden under it. */
    .bq-api .bq-api-snippet { padding: 12px 14px; font-size: 12px; }
    .bq-api .bq-api-copy { position: static; margin: 0 10px 10px; }
}
