/*
 * SimScale styling for the Workflows documentation site.
 *
 * Pairs mkdocs-material's built-in white-header palette (set via
 * `palette.primary: white` in mkdocs.yml) with a custom accent that matches
 * the simkit web app's primary blue. Header chrome stays white — the simkit
 * app uses a white header bar too, so the docs and the app share an
 * identity — and SimScale-blue surfaces on the interactive parts (tabs
 * indicator, links, hover/focus highlights).
 */

:root {
    /* Accent — the SimScale blue, applied to links, the active-tab indicator,
       hover/focus rings, and other interactive emphasis. Tracks the
       `--primary-blue` token used in src/main/resources/static/simkit/styles/simkit.css. */
    --md-accent-fg-color:              #0066cc;
    --md-accent-fg-color--transparent: rgba(0, 102, 204, 0.1);

    --md-typeset-a-color: #0066cc;
}

[data-md-color-scheme="slate"] {
    --md-accent-fg-color:              #4d9ae0;
    --md-accent-fg-color--transparent: rgba(77, 154, 224, 0.15);
    --md-typeset-a-color:              #4d9ae0;
}

/* Logo — the SimScale mark is square and sized to read cleanly against the
   header height. */
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
    height: 1.8rem;
    width: auto;
}

/* The canonical mark is navy, so render it white against the dark header. */
[data-md-color-scheme="slate"] .md-header__button.md-logo img,
[data-md-color-scheme="slate"] .md-header__button.md-logo svg {
    filter: brightness(0) invert(1);
}

/*
 * Sidebar section headers — make them visually distinct from individual items.
 *
 * The default mkdocs-material weight/colour for `navigation.sections` headers
 * (Concepts, How-to, Reference, …) is barely different from the items below
 * them, so the grouping is hard to read at a glance, especially in dark mode.
 * Treat them as small uppercase labels with a top border, the way most doc
 * sites visually anchor a group.
 */

.md-sidebar--primary .md-nav__item--section > .md-nav__link {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.66rem;
    letter-spacing: 0.05em;
    color: var(--md-default-fg-color--light);
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--md-default-fg-color--lightest);
}

.md-sidebar--primary .md-nav__list > .md-nav__item--section:first-child > .md-nav__link {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Dark mode: lift the colour to nearly full-foreground and use an opaque
   separator since `--md-default-fg-color--lightest` is too dim on slate. */
[data-md-color-scheme="slate"] .md-sidebar--primary .md-nav__item--section > .md-nav__link {
    color: var(--md-default-fg-color);
    border-top-color: rgba(255, 255, 255, 0.12);
}

/*
 * Commands vs. command output.
 *
 * A shell command lives in a normal, copyable code block. The console output
 * it produces goes in a separate block tagged
 * `{ .command-output title="Output" }` in the Markdown — so the copy button
 * only ever grabs the command, never the prompt or the output. The output
 * block is labelled "Output", set off with a muted left border, and carries
 * no copy button, so at a glance it reads as a result rather than something
 * to paste back into a terminal.
 */
.md-typeset .command-output.highlight {
    /* A slightly different code background than command blocks. Material drives
       the code surface from --md-code-bg-color, so overriding it here tints the
       whole output block (body + label) in one place. */
    --md-code-bg-color: #eaeff5;
    border-left: 0.15rem solid var(--md-default-fg-color--light);
}

.md-typeset .command-output > .filename {
    background-color: var(--md-default-fg-color--lightest);
    color: var(--md-default-fg-color--light);
    border-bottom: none;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Output is a result to read, not something to paste back. The `.no-copy`
   class on the fence is what actually suppresses the copy button (Material
   skips it for any block inside `.no-copy`); this rule is a defensive catch
   for the current button class in case the fence class is ever omitted. */
.md-typeset .command-output .md-code__button {
    display: none;
}

[data-md-color-scheme="slate"] .md-typeset .command-output.highlight {
    /* Slate code bg is hsla(--md-hue, 15%, 18%); lift a few points so the
       output block reads as a distinct surface in dark mode too. */
    --md-code-bg-color: hsla(var(--md-hue), 15%, 23%, 1);
    border-left-color: rgba(255, 255, 255, 0.24);
}
