/* ==========================================================================
   OCTOLEARN DOCS — Custom Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   FONTS
   -------------------------------------------------------------------------- */
@font-face {
    font-family: 'Shantell Sans';
    src: url('../fonts/ShantellSans-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Shantell Sans';
    src: url('../fonts/ShantellSans-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Shantell Sans';
    src: url('../fonts/ShantellSans-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
}

/* --------------------------------------------------------------------------
   DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
    --md-primary-fg-color: #E43636;
    --md-primary-fg-color--light: #E43636;
    --md-primary-fg-color--dark: #b82b2b;
    --md-primary-bg-color: #000000;
    --md-default-bg-color: #000000;
    --md-default-fg-color: #F6EFD2;
    --md-default-fg-color--light: #E2DDB4;
    --md-default-fg-color--lighter: #E2DDB4;
    --md-default-fg-color--lightest: rgba(226, 221, 180, 0.5);
    --md-text-font: "Shantell Sans", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
    --md-code-font: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace;
}

/* --------------------------------------------------------------------------
   TYPOGRAPHY
   -------------------------------------------------------------------------- */
body,
.md-typeset {
    font-family: var(--md-text-font);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--md-default-fg-color);
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
    font-family: "Shantell Sans";
    font-weight: 800;
    color: #F6EFD2;
    letter-spacing: -0.01em;
    margin-top: 1.5rem;
}

/* --------------------------------------------------------------------------
   NAV SIDEBAR — Active link
   -------------------------------------------------------------------------- */
.md-nav__link--active {
    font-weight: 800 !important;
    color: #E43636 !important;
}

/* --------------------------------------------------------------------------
   ADMONITIONS / DETAILS
   -------------------------------------------------------------------------- */
.admonition,
details {
    border-radius: 12px;
    border-left-width: 0;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background-color: #111111;
    border: 1px solid #E2DDB4;
    box-shadow: none;
}

.admonition-title,
summary {
    background-color: transparent !important;
    font-weight: 800 !important;
    color: #E43636 !important;
    padding-left: 2.5rem !important;
    cursor: pointer;
}

.admonition.info,
details.info {
    border-top: 4px solid #E43636;
}

/* --------------------------------------------------------------------------
   CODE BLOCKS
   -------------------------------------------------------------------------- */
.highlight {
    border-radius: 12px;
    background-color: #1a1a1a !important;
    border: 1px solid rgba(246, 239, 210, 0.1);
}

/* --------------------------------------------------------------------------
   CTA BUTTONS
   -------------------------------------------------------------------------- */
.md-button {
    font-family: "Shantell Sans";
    border-radius: 30px;
    padding: 0.6em 1.8em;
    font-weight: 800;
    font-size: 0.85rem;
    background-color: #E43636 !important;
    color: #F6EFD2 !important;
    border: none !important;
    transition: opacity 0.2s ease;
}

.md-button:hover {
    opacity: 0.85;
}

/* --------------------------------------------------------------------------
   DARK SCHEME
   -------------------------------------------------------------------------- */
[data-md-color-scheme="slate"] {
    --md-primary-fg-color: #E43636;
    --md-default-bg-color: #000000;
}

[data-md-color-scheme="slate"] body,
[data-md-color-scheme="slate"] .md-typeset {
    color: #F6EFD2;
}

[data-md-color-scheme="slate"] .admonition,
[data-md-color-scheme="slate"] details {
    background-color: #0a0a0a;
    border: 1px solid #E2DDB4;
}

/* --------------------------------------------------------------------------
   TABLES
   -------------------------------------------------------------------------- */
.md-typeset table {
    width: 100% !important;
    display: table !important;
    margin: 1rem 0 !important;
}

/* --------------------------------------------------------------------------
   RESPONSIVE — Mobile, Tablet, Desktop
   -------------------------------------------------------------------------- */
@media screen and (max-width: 76.1875em) {
    .md-typeset h1 {
        font-size: 1.8rem;
    }

    .md-typeset h2 {
        font-size: 1.5rem;
    }

    .md-typeset h3 {
        font-size: 1.25rem;
    }

    .md-typeset .admonition {
        padding: 0.8rem;
        font-size: 0.8rem;
    }
}

@media screen and (max-width: 44.9375em) {

    /* Typography */
    .md-typeset h1 {
        font-size: 1.4rem;
    }

    .md-typeset h2 {
        font-size: 1.2rem;
    }

    .md-typeset h3 {
        font-size: 1.05rem;
    }

    /* Header */
    .md-header__inner {
        height: 3rem !important;
        padding: 0 0.5rem !important;
    }

    .md-logo img {
        height: 32px !important;
    }

    .md-header__title {
        font-size: 1.1rem !important;
    }

    /* On mobile, SHOW the hamburger and search buttons (needed for nav) */
    label[for="__drawer"],
    label[for="__search"] {
        display: inline-flex !important;
    }

    /* Layout helpers */
    .grid {
        display: block;
    }

    .grid>* {
        margin-top: 1rem;
    }

    .md-button {
        display: block;
        width: 100%;
        text-align: center;
        margin: 0.5rem 0;
    }

    .md-typeset table {
        font-size: 0.75rem;
        overflow-x: auto;
        display: block;
    }

    /* Improve code block readability on mobile */
    .highlight pre {
        font-size: 0.72rem;
    }
}


/* ==========================================================================
   ██╗  ██╗███████╗ █████╗ ██████╗ ███████╗██████╗
   ██║  ██║██╔════╝██╔══██╗██╔══██╗██╔════╝██╔══██╗
   ███████║█████╗  ███████║██║  ██║█████╗  ██████╔╝
   ██╔══██║██╔══╝  ██╔══██║██║  ██║██╔══╝  ██╔══██╗
   ██║  ██║███████╗██║  ██║██████╔╝███████╗██║  ██║
   ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚═════╝ ╚══════╝╚═╝  ╚═╝
   Black background, Red brand, Cream icons
   ========================================================================== */

/* ── Outer shell ─────────────────────────────────────────────────────────── */
.md-header {
    background-color: #000000 !important;
    color: #E2DDB4 !important;
    box-shadow: 0 1px 0 rgba(226, 221, 180, 0.15) !important;
}

/* ── Inner flex row — logo | title | spacer | icons ─────────────────────── */
.md-header__inner {
    display: flex !important;
    align-items: center !important;
    /* perfect vertical centering */
    height: 3.2rem !important;
    /* fixed row height */
    gap: 0.25rem !important;
    padding: 0 0.75rem !important;
    box-sizing: border-box !important;
}

/* ── Logo ────────────────────────────────────────────────────────────────── */
.md-logo {
    display: flex !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    line-height: 0 !important;
    /* removes phantom line-height gap */
}

.md-logo img {
    height: 40px !important;
    width: auto !important;
    display: block !important;
}

/* ==========================================================================
   HAMBURGER + DUPLICATE SEARCH ICON — Hide on desktop
   MkDocs Material shows label[for="__drawer"] (hamburger) and
   label[for="__search"] (mobile search toggle) on all widths.
   On desktop the tabs + inline search already handle nav, so hide them.
   ========================================================================== */

/* Desktop and above (≥ 60em = 960px) */
@media screen and (min-width: 60em) {

    /* Hide hamburger drawer toggle */
    label[for="__drawer"],
    .md-header__button.md-icon[for="__drawer"] {
        display: none !important;
    }

    /* Hide the mobile search icon button — search box is already visible */
    label[for="__search"],
    .md-header__button[for="__search"] {
        display: none !important;
    }
}

/* Tablet (≥ 76.25em = 1220px) — Material's standard desktop breakpoint */
@media screen and (min-width: 76.25em) {
    label[for="__drawer"] {
        display: none !important;
    }
}


/* ── Site title ──────────────────────────────────────────────────────────── */
.md-header__title {
    flex: 1 1 auto !important;
    margin: 0 0.5rem !important;
    padding: 0 !important;
    font-size: 1.45rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    color: #E43636 !important;
    /* Red brand title */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    letter-spacing: -0.02em !important;
    /* align-self keeps it centered in the flex row */
    align-self: center !important;
}

/* ── Icon buttons (search, source link, hamburger) ───────────────────────── */
.md-header__button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    color: #E2DDB4 !important;
    border-radius: 8px !important;
    padding: 6px !important;
    margin: 0 !important;
    /* Subtle cream tint on hover only — no size/shape/position change */
    transition: background-color 150ms ease !important;
}

.md-header__button:hover {
    background-color: rgba(226, 221, 180, 0.12) !important;
    color: #E2DDB4 !important;
}

.md-header__button:focus-visible {
    outline: 2px solid rgba(228, 54, 54, 0.5) !important;
    outline-offset: 2px !important;
}

/* ── Header SVG icons: cream ─────────────────────────────────────────────── */
.md-header svg {
    fill: #E2DDB4 !important;
    flex-shrink: 0 !important;
}

/* ── Search form overlay/input ───────────────────────────────────────────── */
/* The search <form> lives in the header overlay; keep bg consistent */
.md-search__form {
    background-color: #1a1a1a !important;
}

.md-search__form:hover {
    background-color: #222222 !important;
}

.md-search__input {
    color: #E2DDB4 !important;
    caret-color: #E43636 !important;
    background-color: transparent !important;
}

.md-search__input::placeholder {
    color: rgba(226, 221, 180, 0.45) !important;
    opacity: 1 !important;
}

/* Kill any focus outline that changes the header layout */
.md-search__input:focus {
    outline: none !important;
}

/* The search icon itself */
.md-search__icon {
    color: #E2DDB4 !important;
}

.md-search__icon svg {
    fill: #E2DDB4 !important;
}

/* ==========================================================================
   NAV TABS (tier-2 row)
   Black bar matching header, tabs with hover pill + red active
   ========================================================================== */
.md-tabs,
.md-tabs__scrollwrap {
    background-color: #0d0d0d !important;
    border-top: 1px solid rgba(226, 221, 180, 0.1) !important;
    overflow: visible !important;
    contain: none !important;
}

.md-tabs__list {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 2px !important;
    padding: 0 0.5rem !important;
    white-space: normal !important;
}

.md-tabs__item {
    line-height: 1 !important;
}

.md-tabs__link {
    display: inline-block !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    color: rgba(226, 221, 180, 0.6) !important;
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
    border-radius: 6px !important;
    padding: 0.4rem 0.7rem !important;
    transition: color 120ms ease, background-color 120ms ease !important;
    opacity: 1 !important;
}

.md-tabs__link:hover {
    color: #E2DDB4 !important;
    background-color: rgba(226, 221, 180, 0.08) !important;
}

.md-tabs__item--active .md-tabs__link,
.md-tabs__item--active .md-tabs__link:hover {
    color: #E43636 !important;
    background-color: transparent !important;
    font-weight: 800 !important;
}

/* ==========================================================================
   BACK-TO-TOP — no position change on hover, only color tint
   MkDocs Material base: transform: translate(-50%) for horizontal centering.
   We lock that transform so hover NEVER shifts position.
   ========================================================================== */
.md-top {
    transition: color 150ms ease, background-color 150ms ease !important;
}

.md-top:hover,
.md-top:focus,
.md-top:active {
    transform: translate(-50%) !important;
    /* lock: same as base, no Y shift */
    background-color: #E43636 !important;
    color: #F6EFD2 !important;
    box-shadow: var(--md-shadow-z2) !important;
}

[dir=rtl] .md-top:hover,
[dir=rtl] .md-top:focus,
[dir=rtl] .md-top:active {
    transform: translate(50%) !important;
}

/* ==========================================================================
   MERMAID DIAGRAMS
   The mermaid-dark theme renders node labels as <foreignObject> HTML divs
   with inline style="color: <light-gray>" set by JS. We override with
   !important on both the foreignObject content AND SVG text paths.
   ========================================================================== */

/* Enlarge diagrams and normalize text sizes to match document body */
.md-typeset .mermaid {
    text-align: center;
    margin: 2em 0;
}

.md-typeset .mermaid svg {
    max-width: 100% !important;
    width: 90% !important;     /* Force diagrams to span most of the page width */
    height: auto !important;
}

.md-typeset .mermaid text,
.md-typeset .mermaid .label,
.md-typeset .mermaid .nodeLabel,
.md-typeset .mermaid .edgeLabel,
pre.mermaid foreignObject>div {
    font-size: 16px !important;    /* Match standard readable text size */
    line-height: 1.4 !important;
}

/* SVG native text (edge labels, subgraph titles, state labels) */
pre.mermaid svg text,
pre.mermaid svg tspan,
.mermaid svg text,
.mermaid svg tspan {
    fill: #1a1a1a !important;
}

/* HTML-based node labels (flowchart TD / LR) */
pre.mermaid foreignObject>div,
pre.mermaid foreignObject>div *,
.mermaid foreignObject>div,
.mermaid foreignObject>div *,
.mermaid-dark foreignObject>div,
.mermaid-dark foreignObject>div * {
    color: #1a1a1a !important;
    font-weight: 600 !important;
}

/* Mermaid v10 class-based label selectors */
.mermaid .nodeLabel,
.mermaid .nodeLabel *,
.mermaid .edgeLabel .label,
.mermaid .cluster-label text,
.mermaid .cluster-label span {
    color: #1a1a1a !important;
    fill: #1a1a1a !important;
}