/* This file is loaded ONLY by the docs portals (developers + support),
   so widening the shared sidebar variable here affects just those two —
   the account/admin dashboards keep the default width. */
:root {
    --sidebar-width: 264px;
}

/* ==========================================================================
   layout/developers.css — public API documentation portal
   --------------------------------------------------------------------------
   Publicly accessible, no login. Uses THE SAME design system and sidebar as
   the account dashboard (components/nav.css): no header/logo, bold
   categories, regular items, ⤿ arrow sub-items. This file only styles the
   DOCS CONTENT (sections, code panels, param tables) and the content column.

   Code samples use a dark panel with a language switcher — the ONE place a
   dark surface is allowed — but still NO monospace font (project rule):
   code is set in Inter like everything else.
   ========================================================================== */

/* ----- Content column (next to the shared .sidebar) ----------------------- */
.docs-content {
    margin-left: var(--sidebar-width);
    padding: var(--space-7) var(--space-6);
    max-width: 900px;
}

/* ----- Sidebar search — full width, magnifier inside the field ------------ */
.docs-search {
    position: relative;
    padding: 0 var(--space-3) var(--space-3);
}

.docs-search > .ph {
    position: absolute;
    left: calc(var(--space-3) + 10px);
    top: 10px;
    color: var(--color-text-muted);
    font-size: 16px;
    pointer-events: none;
}

.docs-search input {
    width: 100%;
    height: 36px;
    padding: 0 var(--space-3) 0 34px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    background: var(--color-bg);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.docs-search input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-surface);
}

/* Full-width login button below the search */
.docs-login {
    padding: 0 var(--space-3) var(--space-4);
    margin-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border);
}

/* A nav item hidden by the search filter */
.sidebar .nav-item.is-hidden {
    display: none;
}

.docs-section {
    padding-bottom: var(--space-7);
    margin-bottom: var(--space-7);
    border-bottom: 1px solid var(--color-border);
    scroll-margin-top: var(--space-5);
}

.docs-section:last-child {
    border-bottom: none;
}

.docs-section h1 {
    font-size: var(--font-size-hero);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-3);
}

.docs-section h2 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-3);
}

.docs-section h3 {
    font-size: var(--font-size-md);
    margin: var(--space-5) 0 var(--space-2);
}

.docs-section p,
.docs-section li {
    color: var(--color-text);
    line-height: 1.7;
}

.docs-section ul {
    margin: var(--space-3) 0 var(--space-3) var(--space-5);
}

.docs-lead {
    font-size: var(--font-size-md);
    color: var(--color-text-muted);
    margin-bottom: var(--space-5);
}

/* Inline token (endpoint paths, field names, ids). NOT monospace. */
.docs-token {
    padding: 1px 6px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface-alt);
    font-size: 0.92em;
}

/* HTTP method + path row */
.docs-endpoint {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: var(--space-4) 0 var(--space-2);
}

.docs-method {
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-invert);
}

.docs-method.get { background: var(--color-info); }
.docs-method.post { background: var(--color-success); }
.docs-method.delete { background: var(--color-danger); }

.docs-endpoint .docs-path {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
}

/* Parameter table */
.docs-params {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-3) 0;
    font-size: var(--font-size-sm);
}

/* Mobile: the 3-4 column parameter tables scroll inside themselves —
   the PAGE must never scroll sideways. */
@media (max-width: 640px) {
    .docs-params {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .docs-params .docs-param-name {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

.docs-params th,
.docs-params td {
    text-align: left;
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

.docs-params th {
    color: var(--color-text-muted);
    font-weight: var(--font-weight-medium);
}

.docs-params .docs-param-name {
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
}

.docs-params .docs-param-type {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
}

/* ----- Code panel (dark) with language tabs -------------------------------- */
.docs-code {
    margin: var(--space-4) 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: #1a1b25;                    /* one deliberate dark surface */
    border: 1px solid #2a2b38;
}

.docs-code .docs-code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid #2a2b38;
}

.docs-code .docs-langs {
    display: flex;
    gap: var(--space-1);
}

.docs-code .docs-lang {
    padding: 4px var(--space-3);
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: #9ea0b5;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
}

.docs-code .docs-lang.is-active {
    background: #2f3040;
    color: #ffffff;
}

.docs-code .docs-copy {
    border: none;
    background: transparent;
    color: #9ea0b5;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
}

.docs-code .docs-copy:hover {
    color: #ffffff;
}

.docs-code pre {
    margin: 0;
    padding: var(--space-4);
    overflow-x: auto;
}

/* Code text: Inter (NO monospace), light on dark, preserved whitespace */
.docs-code pre code {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    line-height: 1.6;
    color: #e6e7ee;
    white-space: pre;
    tab-size: 2;
}

.docs-code .docs-sample {
    display: none;
}

.docs-code .docs-sample.is-active {
    display: block;
}

/* Callout box (tips / warnings) */
.docs-note {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    margin: var(--space-4) 0;
    border: 1px solid var(--color-info);
    background: var(--color-info-bg);
    border-radius: var(--radius);
    color: var(--color-info);
    font-size: var(--font-size-sm);
}

/* Download row (plugins) — a quiet link, not a button */
.docs-download {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
    margin: var(--space-4) 0 var(--space-5);
}

.docs-download-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-primary);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.docs-download-link:hover {
    border-bottom-color: var(--color-primary);
}

.docs-download-link i {
    font-size: 1.15em;
}

.docs-requirements {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* Numbered steps (install / configure guides) */
.docs-steps {
    list-style: none;
    counter-reset: step;
    margin: var(--space-3) 0;
    padding: 0;
}

.docs-steps > li {
    counter-increment: step;
    position: relative;
    padding: var(--space-1) 0 var(--space-1) calc(var(--space-6) + var(--space-2));
    margin: 0 0 var(--space-3);
    min-height: var(--space-6);
    line-height: 1.7;
}

.docs-steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: var(--space-6);
    height: var(--space-6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-text-invert);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

/* Mobile hamburger bar (hidden on desktop; drawer via nav.css sidebar) */
.docs-burger {
    display: none;
}

/* ----- Mobile: content full width, sidebar becomes the shared drawer -------- */
@media (max-width: 900px) {
    .docs-content {
        margin-left: 0;
        padding: var(--space-5) var(--space-4);
    }

    .docs-burger {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
        position: sticky;
        top: 0;
        z-index: 80;
        width: 100%;
        padding: var(--space-3) var(--space-4);
        border: none;
        border-bottom: 1px solid var(--color-border);
        background: var(--color-surface);
        font-family: var(--font-family);
        font-size: var(--font-size-base);
        font-weight: var(--font-weight-semibold);
        color: var(--color-text);
        cursor: pointer;
    }

    .docs-section h1 {
        font-size: var(--font-size-xl);
    }
}
