/* ============================================================================
 * mosaic-developer.css
 *
 * Public developer-portal styling for hub.mosaic.co.za/mosaic-hub-developer.php
 * and its sub-pages. Deliberately self-contained - the portal CSS is only
 * loaded for authenticated portal pages, so this file repeats the small
 * subset of typography / colours / resets that the public site needs.
 * Kebab-case selectors throughout per Mosaic coding standards.
 * ========================================================================== */

:root {
    --mosaic-developer-primary: #0f172a;
    --mosaic-developer-primary-dark: #000000;
    --mosaic-developer-bg: #f8fafc;
    --mosaic-developer-surface: #ffffff;
    --mosaic-developer-text: #0f172a;
    --mosaic-developer-text-muted: #475569;
    --mosaic-developer-border: #e2e8f0;
    --mosaic-developer-code-bg: #0f172a;
    --mosaic-developer-code-text: #e2e8f0;
    --mosaic-developer-pill-method-get-bg: #e2e8f0;
    --mosaic-developer-pill-method-get-text: #0f172a;
    --mosaic-developer-pill-method-post-bg: #0f172a;
    --mosaic-developer-pill-method-post-text: #f8fafc;
    --mosaic-developer-callout-bg: #f1f5f9;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--mosaic-developer-bg);
    color: var(--mosaic-developer-text);
    font-family: "Helvetica", "Arial", sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

a {
    color: var(--mosaic-developer-primary);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

code, pre {
    font-family: "Consolas", "Menlo", "Courier New", monospace;
    font-size: 13px;
}

/* Prevent long inline tokens (URLs, hashes, JSON keys) overflowing the
   viewport on narrow screens. Block-level <pre> keeps its own overflow. */
p code,
li code,
td code,
th code,
.mosaic-developer-endpoint code,
.mosaic-developer-callout code {
    word-break: break-word;
    overflow-wrap: anywhere;
}

img { max-width: 100%; height: auto; }

/* ---- Layout ---------------------------------------------------------------*/
.mosaic-developer-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}
.mosaic-developer-sidebar {
    background: var(--mosaic-developer-primary-dark);
    color: #ffffff;
    padding: 24px 18px;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    overflow-y: auto;
}
.mosaic-developer-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    font-weight: 700;
    font-size: 16px;
}
.mosaic-developer-sidebar-brand-link {
    color: #ffffff;
    text-decoration: none;
}
.mosaic-developer-sidebar-brand-link:hover {
    text-decoration: none;
}
.mosaic-developer-sidebar-brand img { height: 28px; }

/* Hamburger toggle - hidden on desktop, shown on mobile via media query. */
.mosaic-developer-sidebar-toggle {
    display: none;
    margin-left: auto;
    width: 38px;
    height: 38px;
    padding: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.mosaic-developer-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.16);
}
.mosaic-developer-sidebar-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
}

.mosaic-developer-sidebar-nav {
    display: block;
}

.mosaic-developer-sidebar-section {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.6);
    margin: 18px 0 6px;
}
.mosaic-developer-sidebar a {
    display: block;
    padding: 6px 8px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
}
.mosaic-developer-sidebar a:hover,
.mosaic-developer-sidebar a.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    text-decoration: none;
}

.mosaic-developer-sidebar-back {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 64px;
    padding: 10px 14px !important;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px !important;
    color: rgba(255, 255, 255, 0.92) !important;
    font-size: 13px !important;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-align: center;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.mosaic-developer-sidebar-back:hover {
    background: #ffffff !important;
    border-color: #ffffff;
    color: var(--mosaic-developer-primary) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
    text-decoration: none;
}
.mosaic-developer-sidebar-back:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.mosaic-developer-main {
    padding: 32px 48px 64px;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
}

/* ---- Headers --------------------------------------------------------------*/
.mosaic-developer-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 11px;
    color: var(--mosaic-developer-text-muted);
    margin-bottom: 6px;
}
.mosaic-developer-title {
    font-size: 30px;
    line-height: 1.2;
    margin: 0 0 8px;
}
.mosaic-developer-subtitle {
    color: var(--mosaic-developer-text-muted);
    margin: 0 0 24px;
}
.mosaic-developer-main h2 {
    font-size: 20px;
    margin: 32px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--mosaic-developer-border);
}
.mosaic-developer-main h3 { font-size: 16px; margin: 24px 0 8px; }

/* ---- Cards ----------------------------------------------------------------*/
.mosaic-developer-card {
    background: var(--mosaic-developer-surface);
    border: 1px solid var(--mosaic-developer-border);
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 18px;
}
.mosaic-developer-card-title { font-size: 16px; margin: 0 0 8px; }
.mosaic-developer-card p { margin: 0 0 8px; }
.mosaic-developer-card p:last-child { margin-bottom: 0; }

/* ---- Endpoint header ------------------------------------------------------*/
.mosaic-developer-endpoint {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--mosaic-developer-surface);
    border: 1px solid var(--mosaic-developer-border);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 18px;
    font-family: "Consolas", monospace;
    font-size: 14px;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.mosaic-developer-method-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.mosaic-developer-method-pill-get  { background: var(--mosaic-developer-pill-method-get-bg);  color: var(--mosaic-developer-pill-method-get-text); }
.mosaic-developer-method-pill-post { background: var(--mosaic-developer-pill-method-post-bg); color: var(--mosaic-developer-pill-method-post-text); }

/* ---- Tables ---------------------------------------------------------------*/
.mosaic-developer-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 20px;
    font-size: 14px;
}
.mosaic-developer-table th,
.mosaic-developer-table td {
    border-bottom: 1px solid var(--mosaic-developer-border);
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}
.mosaic-developer-table th {
    background: var(--mosaic-developer-bg);
    font-weight: 600;
    font-size: 13px;
}
.mosaic-developer-table code { background: var(--mosaic-developer-bg); padding: 1px 5px; border-radius: 4px; }

/* ---- Code blocks ----------------------------------------------------------*/
.mosaic-developer-code {
    background: var(--mosaic-developer-code-bg);
    color: var(--mosaic-developer-code-text);
    padding: 14px 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0 20px;
}
.mosaic-developer-code pre { margin: 0; white-space: pre; }
.mosaic-developer-code-label {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 11px;
    color: var(--mosaic-developer-text-muted);
    margin-bottom: 4px;
}

/* ---- Buttons --------------------------------------------------------------*/
.mosaic-developer-button {
    display: inline-block;
    background: var(--mosaic-developer-primary);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.mosaic-developer-button:hover { background: var(--mosaic-developer-primary-dark); text-decoration: none; }

/* ---- Status callout -------------------------------------------------------*/
.mosaic-developer-callout {
    border-left: 4px solid var(--mosaic-developer-primary);
    background: var(--mosaic-developer-callout-bg);
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    margin: 12px 0 18px;
    font-size: 14px;
}

/* ---- Footer ---------------------------------------------------------------*/
.mosaic-developer-footer {
    margin-top: 48px;
    padding-top: 18px;
    border-top: 1px solid var(--mosaic-developer-border);
    font-size: 12px;
    color: var(--mosaic-developer-text-muted);
}

/* ============================================== */
/* MEDIA QUERIES                                  */
/* ============================================== */

/* Tablet & small laptops - turn the sidebar into a compact top bar with a
   hamburger toggle so the main article isn't shoved a full screen down by
   the vertical nav. */
@media (max-width: 900px) {
    .mosaic-developer-shell {
        grid-template-columns: 1fr;
    }
    .mosaic-developer-sidebar {
        position: sticky;
        top: 0;
        z-index: 20;
        height: auto;
        max-height: 100vh;
        overflow-y: auto;
        padding: 10px 14px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .mosaic-developer-sidebar-brand {
        display: flex;
        align-items: center;
        margin-bottom: 0;
        font-size: 15px;
    }
    .mosaic-developer-sidebar-toggle {
        display: flex;
    }
    .mosaic-developer-sidebar-nav {
        display: none;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }
    .mosaic-developer-sidebar-nav[data-open="true"] {
        display: block;
    }
    .mosaic-developer-sidebar-section {
        margin: 10px 0 4px;
    }
    .mosaic-developer-sidebar a {
        padding: 10px 12px;
        font-size: 14px;
    }
    .mosaic-developer-sidebar-back {
        margin-top: 16px;
        padding: 12px 14px !important;
    }
    .mosaic-developer-main {
        padding: 24px 20px 48px;
        max-width: 100%;
    }
    .mosaic-developer-title {
        font-size: 26px;
    }
}

/* Phones - tighten spacing, downsize hero, allow tables and code blocks to
   scroll within their own container instead of bursting the viewport. */
@media (max-width: 600px) {
    html, body { font-size: 14px; }

    .mosaic-developer-sidebar {
        padding: 8px 12px;
    }
    .mosaic-developer-sidebar a {
        padding: 10px 10px;
    }
    .mosaic-developer-sidebar-back {
        margin-top: 12px;
    }

    .mosaic-developer-main {
        padding: 18px 14px 32px;
    }
    .mosaic-developer-eyebrow { font-size: 10px; }
    .mosaic-developer-title { font-size: 22px; }
    .mosaic-developer-subtitle { margin-bottom: 18px; }
    .mosaic-developer-main h2 {
        font-size: 18px;
        margin: 24px 0 10px;
    }
    .mosaic-developer-main h3 { font-size: 15px; }

    .mosaic-developer-card {
        padding: 14px 16px;
        border-radius: 8px;
    }
    .mosaic-developer-card-title { font-size: 15px; }

    .mosaic-developer-endpoint {
        font-size: 12px;
        padding: 10px 12px;
    }
    .mosaic-developer-method-pill {
        font-size: 10px;
        padding: 2px 8px;
    }

    .mosaic-developer-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        font-size: 13px;
    }
    .mosaic-developer-table th,
    .mosaic-developer-table td {
        padding: 8px 10px;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    .mosaic-developer-table th { font-size: 12px; }

    .mosaic-developer-code {
        padding: 12px 12px;
        font-size: 12px;
        border-radius: 6px;
    }
    .mosaic-developer-code pre { font-size: 12px; }

    .mosaic-developer-callout {
        padding: 10px 12px;
        font-size: 13px;
    }

    .mosaic-developer-button {
        display: block;
        width: 100%;
        text-align: center;
        padding: 12px 16px;
    }

    .mosaic-developer-footer {
        margin-top: 32px;
        font-size: 11px;
    }
}

/* Very small phones - keep nav links tappable and stop the H1 from
   wrapping awkwardly under the eyebrow label. */
@media (max-width: 380px) {
    .mosaic-developer-title { font-size: 20px; }
    .mosaic-developer-main { padding: 14px 12px 28px; }
    .mosaic-developer-card { padding: 12px 14px; }
}
