/*
 * docs.css — ActivityLog developer documentation
 * Supplements portal.css (design tokens defined there).
 */

/* ---- Docs shell -------------------------------------------------------- */
.docs-page {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    align-items: start;
}

@media (max-width: 820px) {
    .docs-page { grid-template-columns: 1fr; padding: 1.2rem 1rem 3rem; }
    .docs-toc   { display: none; }
}

/* ---- Table of contents ------------------------------------------------- */
.docs-toc {
    position: sticky;
    top: 1.5rem;
    padding-right: 2rem;
    font-size: 0.875rem;
}
.docs-toc h6 {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    color: var(--muted);
    margin: 0 0 0.6rem;
}
.docs-toc nav a {
    display: block;
    color: var(--muted);
    padding: 0.22rem 0;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
    margin-left: -0.75rem;
    transition: color 0.15s, border-color 0.15s;
}
.docs-toc nav a:hover,
.docs-toc nav a.active {
    color: var(--teal);
    border-left-color: var(--teal);
    text-decoration: none;
}
.docs-toc nav .toc-sub { padding-left: 1.5rem; font-size: 0.82rem; }

/* ---- Content area ------------------------------------------------------ */
.docs-content { min-width: 0; }

.docs-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    color: var(--ink);
}
.docs-content .docs-lead {
    font-size: 1.1rem;
    color: var(--muted);
    margin: 0 0 2.5rem;
}
.docs-content h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ink);
    margin: 2.8rem 0 0.8rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--paper-edge);
}
.docs-content h2:first-of-type { border-top: none; margin-top: 0; }
.docs-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    margin: 1.8rem 0 0.5rem;
}
.docs-content p  { margin: 0 0 1rem; line-height: 1.65; }
.docs-content ul { margin: 0 0 1rem 1.4rem; line-height: 1.65; }
.docs-content li { margin-bottom: 0.3rem; }

/* ---- Step callouts ----------------------------------------------------- */
.docs-step {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    align-items: flex-start;
}
.docs-step-num {
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.1rem;
}
.docs-step-body { flex: 1; min-width: 0; }
.docs-step-body h3 { margin: 0 0 0.4rem; }
.docs-step-body p  { margin: 0 0 0.7rem; }

/* ---- Code blocks ------------------------------------------------------- */
.code-tabs { margin: 1rem 0 1.5rem; }
.code-tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #2e3340;
    background: #1a1e28;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}
.code-tab-btn {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #8b92a8;
    background: transparent;
    border: none;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: background 0.15s, color 0.15s;
}
.code-tab-btn:hover  { background: #22293a; color: #c9d0e0; }
.code-tab-btn.active { background: #22293a; color: #e0e6f0; border-bottom: 2px solid var(--teal); }
.code-tab-panel { display: none; }
.code-tab-panel.active { display: block; }

pre.code-block {
    background: #1a1e28;
    color: #e0e6f0;
    border-radius: 0 0 8px 8px;
    padding: 1.1rem 1.3rem;
    overflow-x: auto;
    font-family: "SF Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;
    font-size: 0.83rem;
    line-height: 1.6;
    margin: 0;
    white-space: pre;
}
/* standalone block (no tab bar) */
pre.code-block-solo {
    border-radius: 8px;
    margin: 0.6rem 0 1.4rem;
}

code.inline {
    background: var(--paper-edge);
    border-radius: 4px;
    padding: 0.1em 0.35em;
    font-size: 0.87em;
    font-family: "SF Mono", "Fira Code", ui-monospace, monospace;
    color: var(--ink);
}

/* ---- Endpoint cards ---------------------------------------------------- */
.endpoint-card {
    border: 1px solid var(--paper-edge);
    border-radius: 10px;
    margin: 1.5rem 0;
    overflow: hidden;
    background: var(--paper);
}
.endpoint-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--paper-edge);
    background: #fafaf7;
}
.method-badge {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    flex: 0 0 auto;
}
.method-get    { background: #dcf5e8; color: #1a7a45; }
.method-post   { background: #ddeeff; color: #1a4faa; }
.method-patch  { background: #fff0d5; color: #9a5200; }
.method-delete { background: #ffe8e8; color: #b01a1a; }
.endpoint-path {
    font-family: "SF Mono", "Fira Code", ui-monospace, monospace;
    font-size: 0.9rem;
    color: var(--ink);
    font-weight: 600;
}
.endpoint-body { padding: 1rem 1.1rem; }
.endpoint-body p { margin: 0 0 0.7rem; font-size: 0.92rem; }
.endpoint-body p:last-child { margin: 0; }

/* ---- Params table ------------------------------------------------------ */
.params-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin: 0.5rem 0 1rem;
}
.params-table th {
    text-align: left;
    padding: 0.4rem 0.7rem;
    background: #f2f0e8;
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    border-bottom: 1px solid var(--paper-edge);
}
.params-table td {
    padding: 0.4rem 0.7rem;
    border-bottom: 1px solid var(--paper-edge);
    vertical-align: top;
}
.params-table tr:last-child td { border-bottom: none; }
.param-name  { font-family: "SF Mono", ui-monospace, monospace; font-weight: 600; color: var(--ink); }
.param-type  { color: var(--muted); font-family: "SF Mono", ui-monospace, monospace; font-size: 0.8rem; }
.param-desc  { color: var(--ink); }

/* ---- Alert boxes ------------------------------------------------------- */
.docs-note {
    background: #e8f4ff;
    border-left: 3px solid #4a90d9;
    padding: 0.7rem 1rem;
    border-radius: 0 6px 6px 0;
    font-size: 0.9rem;
    margin: 1rem 0 1.4rem;
}
.docs-note strong { color: #1a4faa; }

/* ---- Tab switching JS -------------------------------------------------- */
