/*
 * assets/docs.css — public documentation front end (landing + API viewer).
 * Vendored, no CDN dependencies. Matches the Offset Open API look: light
 * gray landing, dark slate sidebar, navy headings, orange brand accents.
 */

@font-face {
    font-family: 'Inter';
    src: url('/assets/inter-var.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --docs-bg: #f7f8fa;
    --docs-ink: #2a2f56;
    --docs-body: #3d4152;
    --docs-muted: #7b7f8e;
    --docs-border: #e6e8ee;
    --docs-brand: #c6513c;
    --docs-side-bg: #45485e;
    --docs-side-hover: #3b3e52;
    --docs-side-active: #565a73;
    --docs-code-bg: #f2f3f7;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    font-size: 15px;
    color: var(--docs-body);
    background: var(--docs-bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--docs-brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.docs-logo {
    height: 40px; width: 40px;
    display: block;
    object-fit: cover;
    border-radius: 4px;
    flex: none;
}

/* ------------------------------------------------------------------ */
/* Landing page                                                         */
/* ------------------------------------------------------------------ */

.docs-landing { min-height: 100vh; padding: 16px; }
.docs-landing .docs-logo { margin: 0 0 40px; }
.docs-landing-col { max-width: 640px; margin: 0 auto; padding-bottom: 80px; }
.docs-landing h1 {
    font-size: 40px;
    font-weight: 800;
    color: var(--docs-ink);
    letter-spacing: -0.02em;
    margin: 0 0 8px;
}
.docs-landing .sub { color: var(--docs-muted); font-size: 17px; margin: 0 0 44px; }

.docs-card {
    display: block;
    background: #fff;
    border: 1px solid var(--docs-border);
    border-radius: 12px;
    padding: 28px 26px;
    margin-bottom: 22px;
    box-shadow: 0 1px 2px rgba(35, 40, 70, 0.04);
    transition: box-shadow 0.15s, transform 0.15s;
}
.docs-card:hover { text-decoration: none; box-shadow: 0 6px 18px rgba(35, 40, 70, 0.08); transform: translateY(-1px); }
.docs-card h2 { margin: 0 0 8px; font-size: 21px; font-weight: 700; color: var(--docs-ink); }
.docs-card .view { color: var(--docs-muted); font-size: 15px; }

/* ------------------------------------------------------------------ */
/* API viewer: sidebar                                                  */
/* ------------------------------------------------------------------ */

.docs-shell { display: flex; min-height: 100vh; background: #fff; }

.docs-side {
    position: fixed;
    left: 0; top: 0;
    height: 100vh;
    width: 340px;
    background: var(--docs-side-bg);
    color: #fff;
    overflow-y: auto;
    padding: 22px 14px 40px;
}
.docs-side-head { display: flex; align-items: center; gap: 12px; padding: 0 8px 6px; }
.docs-side-head .docs-logo { height: 34px; width: 34px; }
.docs-side-head .name { font-weight: 700; font-size: 16px; color: #fff; }
.docs-public-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    font-size: 11.5px;
    padding: 3px 11px;
    margin: 8px 0 22px 8px;
}
.docs-side a { color: inherit; }
.docs-side a:hover { text-decoration: none; }

.docs-intro-link {
    display: block;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14.5px;
    color: rgba(255, 255, 255, 0.92);
    background: var(--docs-side-active);
    margin-bottom: 22px;
}

.docs-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.92);
    font-family: var(--font);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 12px;
    cursor: pointer;
    border-radius: 8px;
}
.docs-group-toggle:hover { background: var(--docs-side-hover); }
.docs-group-toggle .chev { transition: transform 0.15s; opacity: 0.6; font-size: 11px; }
.docs-group.open .docs-group-toggle .chev { transform: rotate(180deg); }
.docs-group-items { display: none; padding: 2px 0 8px; }
.docs-group.open .docs-group-items { display: block; }

.docs-ep-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.78);
}
.docs-ep-link:hover { background: var(--docs-side-hover); color: #fff; }
.docs-ep-link .ep-name {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.docs-method {
    display: inline-block;
    border-radius: 5px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 3px 7px;
    color: #fff;
    flex: none;
}
.dm-get { background: #22a06b; }
.dm-post { background: #2f6fd0; }
.dm-put { background: #d08a2f; }
.dm-patch { background: #8a5fd0; }
.dm-delete { background: #d04b3f; }
.dm-other { background: #5b8aa0; }

/* ------------------------------------------------------------------ */
/* API viewer: content                                                  */
/* ------------------------------------------------------------------ */

.docs-main { flex: 1; padding: 26px 48px 100px 388px; max-width: 1354px; }

.docs-topbar { display: flex; justify-content: flex-end; gap: 12px; margin-bottom: 28px; }
.docs-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--docs-border);
    background: #fff;
    color: var(--docs-body);
    border-radius: 8px;
    height: 38px;
    padding: 0 15px;
    font-family: var(--font);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
}
.docs-btn:hover { background: var(--docs-bg); text-decoration: none; }
.docs-btn.brand { color: var(--docs-brand); border-color: #ecc4bb; }
.docs-btn.brand:hover { background: #fdf5f3; }
.docs-btn svg { height: 14px; width: 14px; }

.docs-main h1 {
    font-size: 36px;
    font-weight: 800;
    color: var(--docs-ink);
    letter-spacing: -0.02em;
    margin: 0 0 22px;
}

.docs-baseurl {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--docs-code-bg);
    border: 1px solid var(--docs-border);
    border-radius: 10px;
    padding: 13px 18px;
    margin-bottom: 30px;
}
.docs-baseurl .label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--docs-muted);
    flex: none;
}
.docs-baseurl .url { font-family: var(--mono); font-size: 14.5px; color: var(--docs-brand); word-break: break-all; }

.docs-prose { line-height: 1.65; }
.docs-prose p { margin: 0 0 14px; }
.docs-prose h2, .docs-section-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--docs-ink);
    margin: 40px 0 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--docs-border);
}
.docs-prose h3, .docs-prose h4 { color: var(--docs-ink); margin: 24px 0 8px; }
.docs-prose ul, .docs-prose ol { margin: 0 0 14px; padding-left: 26px; }
.docs-prose li { margin-bottom: 4px; }
.docs-prose code {
    font-family: var(--mono);
    font-size: 0.9em;
    background: var(--docs-code-bg);
    border-radius: 4px;
    padding: 1px 5px;
}
.docs-prose pre {
    background: var(--docs-code-bg);
    border: 1px solid var(--docs-border);
    border-radius: 10px;
    padding: 14px 18px;
    overflow-x: auto;
    margin: 0 0 16px;
}
.docs-prose pre code { background: none; padding: 0; font-size: 13px; line-height: 1.55; }

/* Endpoint blocks */
.docs-endpoint {
    margin: 26px 0;
    border: 1px solid var(--docs-border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.docs-ep-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--docs-code-bg);
    border-bottom: 1px solid var(--docs-border);
}
.docs-ep-uri {
    font-family: var(--mono);
    font-size: 15px;
    font-weight: 600;
    color: var(--docs-ink);
    word-break: break-all;
    min-width: 0;
}
.docs-ep-uri .uri-var { color: var(--docs-brand); }
.docs-ep-title {
    margin-left: auto;
    color: var(--docs-muted);
    font-size: 14.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.docs-tryit {
    flex: none;
    border: 1.5px solid var(--docs-brand);
    color: var(--docs-brand);
    background: #fff;
    font-family: var(--font);
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 999px;
    padding: 6px 18px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.docs-tryit:hover { background: #fdf5f3; }
.docs-tryit.open { background: var(--docs-brand); color: #fff; }

.docs-ep-body { padding: 6px 18px 20px; }

/* Side-by-side examples */
.docs-examples { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 1100px) { .docs-examples { grid-template-columns: 1fr; } }
.docs-example-label { font-weight: 700; color: var(--docs-ink); font-size: 15px; margin: 4px 0 10px; }
.docs-example-sub { font-size: 12px; color: var(--docs-muted); margin: 10px 0 6px; }

/* ------------------------------------------------------------------ */
/* Try It panel                                                         */
/* ------------------------------------------------------------------ */

.docs-try-panel {
    background: #23252f;
    color: #dfe2ec;
    padding: 20px;
}
.try-modes {
    display: inline-flex;
    background: #2e3040;
    border: 1px solid #3b3e50;
    border-radius: 9px;
    padding: 3px;
    margin-bottom: 18px;
}
.try-mode {
    border: none;
    background: none;
    color: #9aa0b8;
    font-family: var(--font);
    font-size: 13.5px;
    font-weight: 600;
    padding: 7px 20px;
    border-radius: 7px;
    cursor: pointer;
}
.try-mode.active { background: var(--docs-brand); color: #fff; }

.try-section {
    background: #2a2c39;
    border: 1px solid #3b3e50;
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
}
.try-section-head {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9aa0b8;
    padding: 12px 16px;
    border-bottom: 1px solid #3b3e50;
}
.try-section-head svg { height: 13px; width: 13px; }

.try-row {
    display: grid;
    grid-template-columns: 170px 1fr;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
}
.try-row label { font-family: var(--mono); font-size: 13px; color: #c9cddc; }
.try-loc {
    display: inline-block;
    background: #3b4d78;
    color: #aabdec;
    font-family: var(--font);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-radius: 4px;
    padding: 2px 6px;
    margin-left: 6px;
    vertical-align: 1px;
}
.try-input, .try-body {
    width: 100%;
    background: #23252f;
    border: 1px solid #3b3e50;
    border-radius: 8px;
    color: #e8eaf2;
    font-family: var(--mono);
    font-size: 13px;
    padding: 9px 12px;
}
.try-input::placeholder, .try-body::placeholder { color: #6b7089; }
.try-input:focus, .try-body:focus { outline: none; border-color: #5a5f7a; }
.try-body { display: block; border: none; border-radius: 0; resize: vertical; }

.try-actions { display: flex; align-items: center; gap: 14px; }
.try-send {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--docs-brand);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    padding: 11px 20px;
    cursor: pointer;
}
.try-send:hover { background: #b04532; }
.try-send:disabled { opacity: 0.6; cursor: default; }
.try-send svg { height: 14px; width: 14px; }
.try-status { color: #9aa0b8; font-size: 13.5px; }

.try-response { margin-top: 16px; }
.try-response-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.try-status-pill {
    display: inline-block;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    color: #fff;
}
.try-status-pill.ok { background: #22a06b; }
.try-status-pill.err { background: #d04b3f; }
.try-status-pill.other { background: #d08a2f; }
.try-meta-text { color: #9aa0b8; font-size: 12.5px; word-break: break-all; }
.try-response-body {
    background: #1b1d25;
    border: 1px solid #3b3e50;
    border-radius: 10px;
    color: #e8eaf2;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.6;
    padding: 14px 18px;
    overflow-x: auto;
    max-height: 480px;
    overflow-y: auto;
    margin: 0;
    white-space: pre;
}

.docs-endpoint h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--docs-ink);
    margin: 18px 0 12px;
}
.docs-uri {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--docs-code-bg);
    border: 1px solid var(--docs-border);
    border-radius: 8px;
    padding: 9px 14px;
    margin-bottom: 14px;
}
.docs-uri .path { font-family: var(--mono); font-size: 13.5px; color: var(--docs-ink); word-break: break-all; }

.docs-subhead {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--docs-muted);
    margin: 18px 0 8px;
}

table.docs-params {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border: 1px solid var(--docs-border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 6px;
}
.docs-params th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--docs-muted);
    background: var(--docs-code-bg);
    padding: 8px 12px;
    border-bottom: 1px solid var(--docs-border);
}
.docs-params td { padding: 9px 12px; border-bottom: 1px solid var(--docs-border); vertical-align: top; }
.docs-params tr:last-child td { border-bottom: none; }
.docs-params .pname { font-family: var(--mono); font-size: 13px; color: var(--docs-ink); font-weight: 600; }
.docs-params .ptype { color: var(--docs-muted); font-size: 13px; }
.docs-req { color: #c04040; font-size: 12px; font-weight: 600; }
.docs-opt { color: var(--docs-muted); font-size: 12px; }

.docs-example { margin-bottom: 14px; }
.docs-example pre {
    background: #2e3040;
    color: #e8eaf2;
    border-radius: 10px;
    padding: 14px 18px;
    overflow-x: auto;
    margin: 0;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.6;
}
.docs-example .hdrs { color: #9aa0b8; }

.docs-group-section { border-top: 3px solid var(--docs-border); margin-top: 46px; padding-top: 8px; }
.docs-group-section > h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--docs-ink);
    margin: 22px 0 6px;
}
.docs-group-desc { color: var(--docs-muted); margin: 0 0 10px; }

.docs-copied {
    position: fixed;
    bottom: 24px; right: 24px;
    background: var(--docs-ink);
    color: #fff;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13.5px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.docs-copied.show { opacity: 1; }

@media (max-width: 900px) {
    .docs-side { display: none; }
    .docs-main { padding-left: 24px; padding-right: 24px; }
}

/* API key instructions page */
.docs-keypath {
    display: inline-block;
    font-family: var(--mono);
    font-size: 14px;
    color: var(--docs-ink);
    background: var(--docs-code-bg);
    border: 1px solid var(--docs-border);
    border-radius: 8px;
    padding: 9px 14px;
    margin: 4px 0 0;
}
.docs-keypath span { color: var(--docs-brand); margin: 0 6px; }

/* Private-API badge (only rendered for signed-in editors) */
.docs-private-badge {
    display: inline-block;
    vertical-align: 3px;
    background: #fdf5f3;
    color: var(--docs-brand);
    border: 1px solid #ecc4bb;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 2px 10px;
    margin-left: 8px;
}
