/*
    API developer hub, /api-integration (FEDI-648).
    Builds on the .api-* terminal styles in main_site_min.css; everything here is prefixed hub-.
*/

.hub-h2 { font-weight: 800; font-size: 20pt; margin: 0; }
.hub-h3 { font-weight: 800; font-size: 15pt; margin: 0; }
/* The Resources label heads the sections after the endpoint reference, so it sits close to Code samples */
.hub-group.hub-group-resources { margin-top: 60px; }
.hub-group-resources + .page-section { margin-top: 15px; }
.hub-group { font-size: 11pt; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #5b6470; margin: 28px 0 10px; }
.page-hero .hub-hero-docs, .page-hero .hub-hero-docs:visited { margin-left: 10px; border-radius: 30px; border: 2px solid rgba(255, 255, 255, 0.7); color: #fff !important; padding: 6px 18px; }
/* !important only because of the site wide a { color: #000 !important } */
.page-hero .hub-hero-docs:hover { background: #fff; color: #0d1117 !important; border-color: #fff; }

/* Choose your API cards */
.hub-choice { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 24px; border: 2px solid #e3e7ec; border-radius: 12px; background: #fff; color: inherit; text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s; }
.hub-choice:hover { border-color: #00b8d0; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); color: inherit; }
.hub-choice.active { border-color: #00b8d0; background: #f2fcfd; }
.hub-choice-name { font-size: 15pt; font-weight: 800; }
.hub-choice-tag { font-weight: 700; color: #0a7f8f; }
.hub-choice-desc { font-size: 10.5pt; color: #4a525c; }
.hub-choice-go { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: 10pt; color: #0a7f8f; }

/* The site sets overflow-x:hidden on body, which turns body into a scroll container and stops
   position:sticky from working. clip still hides sideways overflow without doing that.
   Only affects this page, since only this page loads this file. html body outranks the site rule,
   which loads after this file. */
html body { overflow-x: clip; overflow-y: visible; }

/* Docs layout: sticky sidebar on the left, content on the right. 120px clears the fixed site header. */
.hub-docs { margin-top: 50px; padding: 10px 0 30px; border-top: 1px solid #e3e7ec; }
.hub-docs-row { margin-top: 10px; }
.hub-docs-row .hub-panel { padding-top: 0; }
.hub-sidebar { position: sticky; top: 120px; max-height: calc(100vh - 140px); overflow-y: auto; padding: 0 12px 20px 0; }
.hub-sidebar-col { padding-top: 50px; }
.hub-nav { display: flex; flex-direction: column; font-size: 10pt; }
.hub-nav a { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-left: 2px solid #e3e7ec; color: #4a525c; text-decoration: none; }
.hub-nav a:hover { color: #0d1117; border-left-color: #8fd3dc; }
.hub-nav a.active { color: #0a7f8f; font-weight: 700; border-left-color: #00b8d0; background: #f2fcfd; }
.hub-nav-group { font-size: 8.5pt; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #8b949e; padding: 16px 10px 6px; border-left: 2px solid #e3e7ec; }
/* Authentication and the group labels are links too, so a reader can jump to a whole group.
   !important only because of the site wide a, a:hover { color: #000 !important }. */
.hub-nav a.hub-nav-head { font-size: 8.5pt; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; padding: 6px 10px; }
.hub-nav a.hub-nav-group { display: block; padding: 16px 10px 6px; }
.hub-nav a.hub-nav-head, .hub-nav a.hub-nav-group { color: #8b949e !important; }
.hub-nav a.hub-nav-head:hover, .hub-nav a.hub-nav-group:hover { color: #0d1117 !important; }
.hub-nav a.hub-nav-head.active, .hub-nav a.hub-nav-group.active { color: #0a7f8f !important; }
.hub-nav-method { flex-shrink: 0; width: 38px; font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; font-size: 7pt; font-weight: 800; color: #238636; }
.hub-nav-method.get { color: #1f6feb; }
.hub-nav-method.delete { color: #da3633; }
.hub-nav-method.patch { color: #9e6a03; }
.hub-content-col { min-width: 0; padding-left: 30px; border-left: 1px solid #e3e7ec; }
.hub-ep, .hub-ep-body { min-width: 0; }

/* Panels */
.hub-panel { padding-top: 30px; }
.hub-panel + .hub-panel { margin-top: 60px; }
.hub-js .hub-panel + .hub-panel { margin-top: 0; }
.hub-js .hub-panel-hidden { display: none; }
.hub-panel-intro { padding: 30px 32px; border-radius: 14px; background: linear-gradient(135deg, #0d1117 0%, #0f2a3a 100%); color: #c9d1d9; }
.hub-panel-intro .hub-h2 { color: #fff; }
.hub-panel-intro .size_11 { color: #c9d1d9; }
.hub-meta { font-size: 10pt; color: #8b949e; margin: 0; }
.hub-meta .bold_600 { color: #fff; }
.hub-meta code { color: #ffa657; background: rgba(255, 255, 255, 0.06); padding: 2px 6px; border-radius: 4px; }
.hub-meta-sep { color: #30363d; margin: 0 8px; }

/* How it works */
.hub-steps { list-style: none; padding: 0; margin: 15px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; counter-reset: none; }
.hub-step { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid #e3e7ec; border-radius: 10px; background: #fafbfc; }
.hub-step-num { width: 26px; height: 26px; border-radius: 50%; background: #00b8d0; color: #fff; font-weight: 800; font-size: 9.5pt; display: flex; align-items: center; justify-content: center; }
.hub-step-name { font-weight: 800; }
.hub-step-desc { font-size: 9.5pt; color: #4a525c; }

/* Endpoint rows */
.hub-ep-list { display: flex; flex-direction: column; gap: 8px; }
.hub-ep { border: 1px solid #e3e7ec; border-radius: 10px; background: #fff; }
.hub-ep[open] { border-color: #b9dfe5; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05); }
.hub-ep-summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; }
.hub-ep-summary::-webkit-details-marker { display: none; }
.hub-ep-summary:focus-visible { outline: 2px solid #00b8d0; outline-offset: 2px; border-radius: 10px; }
.hub-ep-path { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; font-size: 10pt; word-break: break-all; }
.hub-ep-title { margin-left: auto; font-weight: 700; font-size: 10pt; color: #4a525c; text-align: right; }
.hub-errors .hub-ep-title { margin-left: 0; text-align: left; }
.hub-errors .hub-ep-chevron { margin-left: auto; }
.hub-ep-chevron { color: #8b949e; transition: transform 0.15s; }
.hub-ep[open] .hub-ep-chevron { transform: rotate(180deg); }
.hub-ep-body { padding: 0 16px 16px; border-top: 1px solid #eef1f4; }
.hub-ep-desc { margin: 14px 0 6px; }
.hub-ep-auth { font-size: 10pt; color: #4a525c; margin-bottom: 10px; }
.hub-ep-notes { margin: 14px 0 0; padding-left: 20px; font-size: 10.5pt; }
.hub-ep-notes li { margin-bottom: 6px; }
.api-endpoint-method.patch, .api-explorer-method-badge.patch { background: #9e6a03; }
.api-endpoint-method { min-width: 62px; text-align: center; }

/* Field and error tables */
.hub-table { width: 100%; border-collapse: collapse; font-size: 10pt; margin-top: 6px; }
.hub-table th { text-align: left; font-size: 9pt; text-transform: uppercase; letter-spacing: 0.5px; color: #5b6470; padding: 8px 10px; border-bottom: 2px solid #e3e7ec; }
.hub-table td { padding: 8px 10px; border-bottom: 1px solid #eef1f4; vertical-align: top; }
.hub-table td:first-child { width: 34%; overflow-wrap: anywhere; }
.hub-table code { font-size: 9.5pt; }

/* Example request and response blocks */
.hub-code-label { font-size: 8.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #5b6470; margin: 10px 0 6px; }
.hub-code { border-radius: 8px; box-shadow: none; }
.hub-key-note { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 16px 0 6px; padding: 14px 18px; border: 1px solid #b9dfe5; border-radius: 10px; background: #f2fcfd; font-size: 10.5pt; }
.hub-key-note .fa-key { color: #0a7f8f; }
.hub-key-note span { flex: 1; min-width: 200px; }
.hub-code-stack { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.hub-curl { position: relative; }
.hub-copy-inline { position: absolute; top: 8px; right: 8px; border: 1px solid #30363d; background: #161b22; color: #c9d1d9; font-size: 8.5pt; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.hub-copy-inline:hover { border-color: #00b8d0; color: #fff; }
.hub-code pre { max-height: 420px; padding: 14px 16px; }
.hub-code code, .hub-sample code { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; font-size: 9pt; line-height: 1.55; color: #c9d1d9; white-space: pre; }

.hub-samples pre { max-height: 520px; overflow: auto; }

/* Hiding: the shared .api-explorer-body sets display:grid, so these need the stronger selectors */
.hub-sample.api-code-hidden, .hub-explorer-case.api-code-hidden, .hub-response.api-code-hidden, .hub-response-placeholder.api-code-hidden { display: none; }
.hub-explorer .api-explorer-pre { max-height: 360px; overflow: auto; }
/* Plain 1fr columns grow to the longest JSON line and push the response off the page;
   minmax(0, 1fr) keeps both panes inside the box and lets long lines scroll. */
.hub-explorer .api-explorer-body { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.hub-explorer .api-explorer-pane { min-width: 0; }
@media (max-width: 991px) { .hub-explorer .api-explorer-body { grid-template-columns: minmax(0, 1fr); } }

/* Testing and Postman */
.hub-card { height: 100%; padding: 24px; border: 1px solid #e3e7ec; border-radius: 12px; background: #fafbfc; }
.hub-postman { height: 100%; color: #c9d1d9; }
.hub-postman h5 { color: #fff; }
.hub-postman code { color: #ffa657; }

/* Below desktop there is no sidebar; the cards above switch the API */
@media (max-width: 991px) {
    .hub-sidebar-col { display: none; }
    .hub-content-col { padding-left: 12px; border-left: none; }
}

@media (max-width: 767px) {
    .hub-h2 { font-size: 17pt; }
    .hub-panel-intro { padding: 22px 20px; }
    .hub-ep-summary { flex-wrap: wrap; gap: 6px 10px; }
    .hub-ep-title { margin-left: 0; width: 100%; text-align: left; }
    .hub-ep-chevron { display: none; }
    .page-hero .hub-hero-docs { margin: 10px 0 0; }
    /* Field tables stack: name and type on one line, notes under them */
    .hub-table thead { display: none; }
    .hub-table tr { display: block; padding: 8px 0; border-bottom: 1px solid #eef1f4; }
    .hub-table td { display: inline; padding: 0 6px 0 0; border: none; }
    .hub-table td:first-child { width: auto; }
    .hub-table td:last-child { display: block; padding-top: 2px; }
}
