/* ═══════════════════════════════════════════════════════════
   COMPANIONS API — PUBLIC DOCUMENTATION THEME
   A clean, conventional skin over Material for MkDocs (Stripe/typical-
   provider feel) — high readability, generous whitespace, prominent
   language-tabbed code samples.

   All surface colors are driven by tokens that FLIP per color scheme,
   so light and dark are both first-class: only the token block below
   changes between modes, the rules underneath are scheme-agnostic.
   ═══════════════════════════════════════════════════════════ */

/* ─── Scheme tokens ──────────────────────────────────────────
   Light (default) */
[data-md-color-scheme="default"] {
    --md-primary-fg-color: #4f46e5; /* indigo */
    --md-accent-fg-color: #4f46e5;
    --md-typeset-a-color: #4f46e5;

    --surface: #ffffff; /* cards, tab bodies        */
    --surface-sunken: #f7f8fa; /* inline code, table heads */
    --border-soft: #e6e8ec;
    --row-hover: #f4f5ff;

    --ink: #1f2430; /* body text                */
    --ink-soft: #5b6472; /* secondary text           */
    --heading: #0f1222;
    --code-ink: #b4295e; /* inline code text         */
    --field-ink: #4338ca; /* param name in tables     */

    --header-bg: #ffffff;
}

/* Dark (slate) — real dark mode: surfaces go dark, ink goes light. */
[data-md-color-scheme="slate"] {
    --md-primary-fg-color: #818cf8; /* lighter indigo reads better on dark */
    --md-accent-fg-color: #a5b4fc;
    --md-typeset-a-color: #a5b4fc;

    --md-default-bg-color: #14161f;
    --md-code-bg-color: #1b1e2b;

    --surface: #1b1e2b;
    --surface-sunken: #232838;
    --border-soft: #2c3142;
    --row-hover: #232838;

    --ink: #c7ccd8;
    --ink-soft: #8b93a4;
    --heading: #eef1f7;
    --code-ink: #ff9ec0;
    --field-ink: #b3bcff;

    --header-bg: #171a24;
}

/* ─── Typography & rhythm ────────────────────────────────── */
.md-typeset {
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--ink);
}

.md-typeset h1 {
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--heading);
    margin-bottom: 0.6em;
}

.md-typeset h2 {
    font-weight: 650;
    letter-spacing: -0.005em;
    color: var(--heading);
    margin-top: 2.4em;
    padding-top: 1.2em;
    border-top: 1px solid var(--border-soft);
}

.md-typeset h3 {
    font-weight: 600;
    color: var(--heading);
    margin-top: 1.8em;
}

.md-typeset h4 {
    font-weight: 600;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.68rem;
}

/* ─── Header & top tabs ──────────────────────────────────── */
.md-header {
    background-color: var(--header-bg);
    color: var(--ink);
    box-shadow: 0 1px 0 var(--border-soft);
}
.md-header__title {
    font-weight: 650;
}

.md-tabs {
    background-color: var(--header-bg);
    color: var(--ink-soft);
    box-shadow: 0 1px 0 var(--border-soft);
}
.md-tabs__link {
    color: var(--ink-soft);
    opacity: 1;
}
.md-tabs__link--active,
.md-tabs__link:hover {
    color: var(--md-primary-fg-color);
}

/* Search box tracks the surface tokens too. */
.md-search__input {
    background-color: var(--surface-sunken);
    color: var(--ink);
}

/* ─── Method badges (inline <span class="method post">POST</span>) ── */
.md-typeset .method {
    display: inline-block;
    padding: 0.05rem 0.5rem;
    margin-right: 0.5rem;
    border-radius: 5px;
    font-family: var(--md-code-font-family), monospace;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #ffffff;
    vertical-align: middle;
    text-transform: uppercase;
}
.md-typeset .method.get {
    background: #0d9488;
}
.md-typeset .method.post {
    background: #4f46e5;
}
.md-typeset .method.put {
    background: #b45309;
}
.md-typeset .method.delete {
    background: #dc2626;
}

/* The route path that follows a badge in an h3 endpoint header */
.md-typeset h3 code {
    font-size: 0.82em;
    background: var(--surface-sunken);
    border: 1px solid var(--border-soft);
    color: var(--heading);
}

/* ─── Inline code ────────────────────────────────────────── */
.md-typeset code {
    background-color: var(--surface-sunken);
    color: var(--code-ink);
    border-radius: 4px;
    padding: 0.1em 0.35em;
    font-size: 0.82em;
}

/* ─── Fenced code blocks ─────────────────────────────────── */
.md-typeset pre {
    border-radius: 8px;
}
.highlight {
    border-radius: 8px;
}
/* The <code> inside a <pre> carries the block's inner padding — give it
   room so the code never touches the rounded borders. (This element
   also resets the inline-code chrome above: no background/border here.) */
.md-typeset pre > code {
    background: transparent;
    color: inherit;
    border: 0;
    padding: 0.9rem 1.15rem;
    line-height: 1.6;
}

/* ─── Language-tabbed code samples (pymdownx.tabbed) ─────── */
.md-typeset .tabbed-set {
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    overflow: hidden;
    margin: 1.2em 0;
}
.md-typeset .tabbed-labels {
    background: var(--surface-sunken);
    box-shadow: inset 0 -1px 0 var(--border-soft);
    padding: 0 0.4rem;
}
.md-typeset .tabbed-labels > label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--ink-soft);
    padding: 0.7em 0.9em;
}
.md-typeset .tabbed-set > input:checked + label {
    color: var(--md-primary-fg-color);
    border-color: var(--md-primary-fg-color);
}
.md-typeset .tabbed-content {
    background: var(--md-code-bg-color);
}
/* Inside a tab, the code block is flush with the tab body (the tab set
   already provides the rounded frame), but keeps the inner padding. */
.md-typeset .tabbed-block .highlight {
    border-radius: 0;
}
.md-typeset .tabbed-block > .highlight:first-child > pre {
    margin: 0;
}

/* ─── Tables ─────────────────────────────────────────────── */
.md-typeset table:not([class]) {
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.72rem;
    background: var(--surface);
}
.md-typeset table:not([class]) th {
    background: var(--surface-sunken);
    color: var(--heading);
    font-weight: 650;
    text-transform: none;
    letter-spacing: 0;
    border-bottom: 1px solid var(--border-soft);
}
.md-typeset table:not([class]) td {
    border-top: 1px solid var(--border-soft);
    color: var(--ink);
}
.md-typeset table:not([class]) tr:hover {
    background: var(--row-hover);
}
/* First column of a params table usually carries the field name */
.md-typeset table:not([class]) td:first-child code {
    color: var(--field-ink);
}

/* ─── Admonitions ────────────────────────────────────────── */
.md-typeset .admonition,
.md-typeset details {
    border-radius: 10px;
    border-width: 1px;
    box-shadow: none;
    font-size: 0.74rem;
}

/* ─── Links ──────────────────────────────────────────────── */
.md-typeset a {
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition:
        color 0.15s,
        border-color 0.15s;
}
.md-typeset a:hover {
    border-bottom-color: var(--md-primary-fg-color);
}

/* ─── Sidebar navigation ─────────────────────────────────── */
.md-nav {
    font-size: 0.72rem;
}
.md-nav__title {
    color: var(--ink-soft);
    font-weight: 650;
}
.md-nav__link--active {
    color: var(--md-primary-fg-color) !important;
    font-weight: 600;
}

/* ─── Content width & footer ─────────────────────────────── */
.md-grid {
    max-width: 62rem;
}
.md-footer,
.md-footer-meta {
    background-color: #0f1222;
}
