/* Eviden / Cosmian branding for mdBook
   Reproduces the key visual identity from the former Material for MkDocs theme:
   Open Sans body font, Montserrat headings, brand accent colour. */

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap");

:root {
    --cosmian-accent: #e94e24;      /* Eviden/Cosmian orange */
    --cosmian-accent-dark: #c73f1b;
    --sidebar-width: 300px;
    --content-max-width: 820px;
}

html {
    font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, sans-serif;
}

.menu-title {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
}

.content h1,
.content h2,
.content h3,
.content h4,
.content h5 {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Brand accent on links and active sidebar entry */
.content a:link,
.content a:visited {
    color: var(--cosmian-accent);
}

.chapter li.chapter-item a.active {
    color: var(--cosmian-accent);
    font-weight: 600;
}

#menu-bar {
    border-bottom: 2px solid var(--cosmian-accent);
}

/* Slightly tighten code blocks to match the previous look */
.content pre code {
    font-size: 0.85em;
}

/* ---- Eviden header / menu-bar banner ------------------------------------ */

/* Taller banner: override mdBook's default 50 px menu bar height. */
:root {
    --menu-bar-height: 68px;
}

/* The header follows the active theme background (same as sidebar & content).
   Only the orange accent border is fixed. */
#menu-bar,
#menu-bar-hover-placeholder {
    border-bottom: 2px solid var(--cosmian-accent);
}

/* Orange EVIDEN logo + "Technical Documentation" label. */
.menu-bar .menu-title {
    display: flex;
    align-items: center;
    font-size: inherit;
    font-weight: normal;
}

.header-logo-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none !important;
    color: inherit;
}

.header-logo {
    height: 40px;
    width: auto;
    flex-shrink: 0;
}

/* Small label to the right of the logo: inherits theme text colour */
.header-logo-subtitle {
    font-family: "Montserrat", sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.55;
    white-space: nowrap;
}

/* ---- Dark-mode image contrast ------------------------------------------ */
/* draw.io / SVG diagrams export with hardcoded black text (color: rgb(0,0,0))
   that becomes invisible on dark page backgrounds. Give all content images a
   light card background so they are always readable. */
html.coal .content img,
html.navy .content img,
html.ayu  .content img {
    background-color: #f6f8fa;
    border-radius: 4px;
    padding: 6px;
}

/* ---- emgithub code embeds ---------------------------------------------- */
/* emgithub injects code as <table> elements directly into the page DOM.
   mdBook's global tr:nth-child(2n) zebra-striping must not apply to those
   rows — reset it unconditionally inside any emgithub container. */
.emgithub-embed table tr,
.emgithub-embed table tr:nth-child(2n) {
    background: unset;
}

/* emgithub always renders with a white/light Highlight.js theme
   (style=default or style=stackoverflow-light). In dark themes, apply the
   "night-mode" CSS filter: invert(1) darkens the background while
   hue-rotate(180deg) approximately restores syntax-highlight colours. */
html.coal .emgithub-embed,
html.navy .emgithub-embed,
html.ayu  .emgithub-embed {
    filter: invert(1) hue-rotate(180deg);
    border-radius: 4px;
    overflow: hidden;
    display: block;
    margin: 0.5em 0;
}
