/* =========================================================
   ZoroMail — API documentation page
   Builds on the variables/theme defined in style.css
   ========================================================= */

.btn-sm { padding: 8px 14px; font-size: .86rem; }

.docs-main { padding: 48px 24px 40px; }

/* ---------- Hero ---------- */
.docs-hero { max-width: 760px; margin-bottom: 40px; }
.docs-hero h1 {
    font-size: clamp(2rem, 5vw, 2.9rem);
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--text);
    margin-top: 8px;
}
.docs-hero p {
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}
.docs-hero strong { color: var(--text); }

.docs-baseurl {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xs);
}
.docs-baseurl-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-dim);
}
.docs-baseurl code {
    flex: 1;
    min-width: 200px;
    font-family: var(--font-mono);
    font-size: .9rem;
    color: var(--primary);
    word-break: break-all;
}

/* ---------- Layout ---------- */
.docs-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 40px;
    align-items: start;
}

/* ---------- Sidebar TOC ---------- */
.docs-toc {
    position: sticky;
    top: 92px;
}
.docs-toc-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-dim);
    margin-bottom: 12px;
}
.docs-toc nav { display: flex; flex-direction: column; gap: 4px; }
.docs-toc a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: background .15s, color .15s;
}
.docs-toc a:hover { background: var(--surface-2); color: var(--text); }

/* method pill (sidebar) */
.m {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .03em;
    padding: 2px 6px;
    border-radius: 5px;
    min-width: 34px;
    text-align: center;
    color: #fff;
}
.m.get  { background: var(--success); }
.m.post { background: var(--primary); }
.m.del  { background: var(--danger); }

/* ---------- Content blocks ---------- */
.docs-content { min-width: 0; }
.docs-block {
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 22px;
    scroll-margin-top: 92px;
}
.docs-block > h2 { font-size: 1.35rem; color: var(--text); }
.docs-block-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.docs-block-head h2 { font-size: 1.35rem; color: var(--text); }
.step-chip {
    display: grid;
    place-items: center;
    width: 32px; height: 32px;
    flex-shrink: 0;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: .95rem;
    box-shadow: var(--shadow-primary);
}
.docs-text {
    color: var(--text-muted);
    font-size: .96rem;
    line-height: 1.7;
    margin-bottom: 18px;
}
.docs-text code,
.docs-block > p code {
    font-family: var(--font-mono);
    font-size: .85rem;
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 6px;
    color: var(--text-soft);
}

/* ---------- Endpoint blocks ---------- */
.endpoint { margin-top: 18px; }
.endpoint:first-of-type { margin-top: 0; }
.endpoint-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-dim);
    margin-bottom: 8px;
}
.endpoint-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}
.endpoint-row.plain { background: transparent; border-style: dashed; }

.method {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 5px 10px;
    border-radius: 7px;
    min-width: 54px;
    text-align: center;
    color: #fff;
}
.method.get    { background: var(--success); }
.method.post   { background: var(--primary); }
.method.del    { background: var(--danger); }

.endpoint-url {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: .86rem;
    color: var(--text);
    word-break: break-all;
}
.endpoint-url .ph { color: var(--accent); font-weight: 600; }

.docs-copy {
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 6px 11px;
    border-radius: 7px;
    transition: color .15s, border-color .15s, background .15s;
}
.docs-copy:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.docs-copy.sm { padding: 5px 9px; }

/* ---------- Code blocks ---------- */
.code-block {
    margin: 0;
    background: #0f1729;
    color: #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    font-family: var(--font-mono);
    font-size: .84rem;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre;
}
.tok-key     { color: #7dd3fc; }
.tok-str     { color: #86efac; }
.tok-bool    { color: #fca5a5; }
.tok-null    { color: #c4b5fd; }
.tok-punc    { color: #94a3b8; }
.tok-comment { color: #cbd5e1; }
.tok-url     { color: #7dd3fc; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .docs-layout { grid-template-columns: 1fr; gap: 24px; }
    .docs-toc { position: static; }
    .docs-toc nav { flex-direction: row; flex-wrap: wrap; }
    .docs-toc a { background: var(--surface); border: 1px solid var(--border); }
}
@media (max-width: 540px) {
    .docs-block { padding: 20px; }
    .endpoint-row { flex-wrap: wrap; }
    .docs-copy { order: 3; }
}
