/* =============================================
   API Guide (api_guide.html): the installer
   API's guide, a panel per section beside the
   contents, with endpoints, code examples and
   tables. Code examples are dark in both themes
   (theme.css's --in-code-*).
   ============================================= */

/* Wide screens: the contents beside the sections, kept in view */
.guide-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.guide-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    max-width: 900px;
}

@media (min-width: 1200px) {
    .guide-layout {
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 22px;
    }

    .guide-toc {
        position: sticky;
        top: 18px;
    }
}

/* The base URL, under the title */
.guide-base-url {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    max-width: 100%;
    margin: 10px 0 0;
    padding: 6px 12px;
    border: 1px solid var(--in-border);
    border-radius: 6px;
    background-color: var(--in-surface);
    font-size: 0.82rem;
}

.guide-base-url__label {
    color: var(--in-text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.guide-base-url code {
    padding: 0;
    background: none;
    color: var(--in-text);
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

/* ----- Contents ----- */
.guide-toc__list {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 16px;
    margin: 0;
    padding: 10px 16px 12px;
    list-style: none;
}

.guide-toc__list a {
    display: block;
    padding: 3px 0;
    color: var(--in-text-2);
    font-size: 0.86rem;
    text-decoration: none;
}

.guide-toc__list a:hover,
.guide-toc__list a:focus {
    color: var(--in-accent);
}

@media (min-width: 1200px) {
    .guide-toc__list {
        flex-direction: column;
    }

    .guide-toc__sub a {
        padding-left: 12px;
        color: var(--in-text-muted);
        font-size: 0.82rem;
    }
}

/* A section, or a heading in one, jumped to from the contents: clear of the
   phone top bar */
.guide-section,
.guide-body h3 {
    scroll-margin-top: 18px;
}

@media (max-width: 991.98px) {
    .guide-section,
    .guide-body h3 {
        scroll-margin-top: 72px;
    }
}

/* ----- A section's text ----- */
.guide-body {
    padding: 16px;
    color: var(--in-text-2);
    font-size: 0.9rem;
    line-height: 1.6;
}

.guide-body p,
.guide-body ul,
.guide-body ol {
    max-width: 72ch;
}

.guide-body p {
    margin: 0 0 12px;
}

.guide-body ul,
.guide-body ol {
    margin: 0 0 14px;
    padding-left: 22px;
}

.guide-body li + li {
    margin-top: 4px;
}

.guide-body > :last-child {
    margin-bottom: 0;
}

.guide-body strong {
    color: var(--in-text);
}

.guide-body a {
    color: var(--in-accent);
}

.guide-body a:hover,
.guide-body a:focus {
    color: var(--in-accent-hover);
}

.guide-body h3 {
    margin: 26px 0 10px;
    color: var(--in-text);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.guide-body h3:first-child {
    margin-top: 0;
}

/* Inline code. Bootstrap's is pink. */
.guide-body code {
    padding: 1px 5px;
    border-radius: 4px;
    background-color: var(--in-wash);
    color: var(--in-text);
    font-size: 0.86em;
    overflow-wrap: anywhere;
}

.guide-lead {
    color: var(--in-text);
    font-size: 0.98rem;
}

/* Numbered steps */
.guide-body .guide-steps {
    padding-left: 0;
    list-style: none;
    counter-reset: guide-step;
}

.guide-steps > li {
    position: relative;
    padding-left: 38px;
    counter-increment: guide-step;
}

.guide-steps > li + li {
    margin-top: 14px;
}

.guide-steps > li::before {
    content: counter(guide-step);
    position: absolute;
    top: 0;
    left: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: var(--in-accent-wash);
    color: var(--in-accent);
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 26px;
    text-align: center;
}

/* ----- Endpoints: a method and a path ----- */
.guide-endpoint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 16px 0 10px;
}

.guide-body .guide-endpoint code {
    padding: 0;
    background: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.guide-method {
    display: inline-block;
    min-width: 48px;
    padding: 1px 8px;
    border: 1px solid var(--in-accent);
    border-radius: 4px;
    color: var(--in-accent);
    font-family: SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
}

.guide-method--post {
    background-color: var(--in-accent);
    color: var(--in-surface);
}

/* ----- Code examples, each with a label and a Copy button ----- */
.guide-code {
    max-width: 100%;
    margin: 10px 0 16px;
    border-radius: 8px;
    background-color: var(--in-code-bg);
}

.guide-code__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 12px 0;
    color: var(--in-code-dim);
    font-family: SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
    font-size: 0.72rem;
}

.guide-code__copy {
    padding: 2px 8px;
    border: 1px solid var(--in-code-dim);
    border-radius: 4px;
    background: none;
    color: var(--in-code-dim);
    font-size: 0.72rem;
    cursor: pointer;
}

.guide-code__copy:hover,
.guide-code__copy:focus {
    border-color: var(--in-code-text);
    color: var(--in-code-text);
}

.guide-code pre {
    margin: 0;
    padding: 10px 14px 14px;
    overflow-x: auto;
    color: var(--in-code-text);
    font-family: SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    tab-size: 4;
}

/* Keywords and keys, strings, comments */
.guide-k {
    color: var(--in-code-key);
}

.guide-s {
    color: var(--in-code-string);
}

.guide-c {
    color: var(--in-code-dim);
}

/* A zip bundle's folders */
.guide-tree {
    margin: 10px 0 16px;
}

/* ----- Tables: the portal's, in a box of their own ----- */
.guide-table {
    margin: 10px 0 16px;
    border: 1px solid var(--in-border);
    border-radius: 8px;
}

.guide-table .data-table td {
    vertical-align: top;
}

.guide-table .data-table td:first-child code {
    white-space: nowrap;
}

.guide-required {
    margin-left: 6px;
    color: var(--in-danger);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.guide-type {
    color: var(--in-text-muted);
    font-family: SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
    font-size: 0.78rem;
    white-space: nowrap;
}

.guide-body .callout {
    margin: 12px 0 16px;
}

.guide-contact {
    margin: 0;
    color: var(--in-text-muted);
    font-size: 0.85rem;
}
