/* CalQTrace user guide. Fonts: Noto Sans (text) and Source Code Pro (code),
   set in mkdocs.yml. Palette and layout follow the Wavu and pyHisto guides
   (Oxford-Zeiss Centre of Excellence), so the three sites read as one family. */
/* -- colours: Oxford-Zeiss CoE palette, as the Wavu guide (light theme only)
   Header and footer are Oxford blue (no Material purple). */
:root > * {
  --md-primary-fg-color: #002147;          /* Oxford blue: top bar */
  --md-primary-fg-color--light: #1d4f8c;
  --md-primary-fg-color--dark: #00152e;
  --md-primary-bg-color: #ffffff;           /* text/icons on the top bar */
  --md-accent-fg-color: #ef6c00;            /* orange accent */
  --md-accent-fg-color--transparent: #ef6c001a;
  --md-footer-bg-color: #002147;            /* bottom bar = top bar */
  --md-footer-bg-color--dark: #002147;
}
:root > * { --md-typeset-a-color: #1d5fae; --md-default-bg-color: #fbfcfe; }   /* links + page bg as Wavu */
/* Active/hover tab underline and nav highlights use the accent, not purple. */
.md-tabs { background-color: var(--md-primary-fg-color); }

/* -- logo + title ------------------------------------------------------- */
.md-header__title { font-weight: 700; }

/* -- diagrams: readable Mermaid labels ------------------------------------
   Material draws labels in a light grey, too faint on the pale classDef fills.
   Dark slate text, white label boxes, darker lines: WCAG AA (as Wavu). */
:root > * {
  --md-mermaid-label-fg-color: #263238;
  --md-mermaid-label-bg-color: #ffffff;
  --md-mermaid-edge-color: #37474f;
  --md-mermaid-node-fg-color: #263238;
}

/* -- footer: one row = previous | logos + licence | next (Wavu layout) -- */
.md-footer .md-footer__inner.cq-footer-row {
  box-sizing: border-box; width: 100%; display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: 1.2rem; padding: .8rem .8rem;
}
.cq-footer-side { display: flex; min-width: 0; }
.cq-footer-side--next { justify-content: flex-end; }
.cq-footer-row .md-footer__link { padding-top: .4rem; padding-bottom: .4rem; }
.cq-footer-center { text-align: center; color: var(--md-footer-fg-color--light); font-size: .64rem; }
.cq-footer-center a { color: var(--md-footer-fg-color); }
.cq-logos { display: flex; justify-content: center; align-items: center; gap: 1.4rem; margin-bottom: .45rem; }
.cq-logos img { height: 2rem; width: auto; display: block; opacity: .95; }
.cq-logos a:hover img { opacity: 1; }
.cq-credits { white-space: normal; line-height: 1.5; }
.cq-dot { margin: 0 .4em; }
@media screen and (max-width: 59.9375em) {
  .md-footer .md-footer__inner.cq-footer-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .6rem; }
  .md-footer .cq-footer-side { overflow: hidden; }
  .md-footer .cq-footer-center { grid-column: 1 / -1; order: 3; }
  .md-footer .cq-logos { flex-wrap: wrap; gap: .9rem; }
  .md-footer .cq-logos img { height: 1.6rem; }
}
.md-content .md-typeset .mermaid { text-align: center; }

/* -- top tabs: dropdown menus (guide_overrides/partials/tabs-item.html) ---
   Shown on hover and on keyboard focus (:focus-within).  Material clips the
   tab bar (overflow:auto, contain:content); from 76.25em (where tabs are
   shown at all) the bar is made overflow-visible so the panel is not cut off.
   White panel, Oxford-blue text (#002147 on #fff: 16:1, WCAG AAA). */
@media screen and (min-width: 76.25em) {
  .md-tabs, .md-tabs__list { overflow: visible; contain: none; }
  .md-tabs__item.cq-tabs-item--dropdown { position: relative; }
  .cq-tabs-dropdown {
    display: none; position: absolute; top: 100%; left: 0; z-index: 10;
    min-width: 13rem; max-width: 22rem; max-height: calc(100vh - 6rem); overflow-y: auto;
    margin: 0; padding: .4rem 0; list-style: none; white-space: normal;
    background: #ffffff; color: #002147; border-radius: .4rem;
    border: 1px solid #00214726;
    box-shadow: 0 .2rem .5rem #0000001f, 0 .6rem 1.4rem #00214726;
    font-size: .68rem; line-height: 1.35;
  }
  .cq-tabs-item--dropdown:hover > .cq-tabs-dropdown,
  .cq-tabs-item--dropdown:focus-within > .cq-tabs-dropdown { display: block; }
  .md-tabs[hidden] .cq-tabs-dropdown { display: none !important; }
  .cq-tabs-dropdown__sublist { margin: 0; padding: 0; list-style: none; }
  .cq-tabs-dropdown__link {
    display: block; padding: .3rem .9rem; color: #002147; text-decoration: none;
  }
  .cq-tabs-dropdown__sublist .cq-tabs-dropdown__link { padding-left: 1.5rem; }
  .cq-tabs-dropdown__link:hover, .cq-tabs-dropdown__link:focus-visible {
    background: #e8eef7; color: #002147; outline: none;
  }
  .cq-tabs-dropdown__link:focus-visible { box-shadow: inset 3px 0 0 var(--md-accent-fg-color); }
  .cq-tabs-dropdown__link--active { font-weight: 700; box-shadow: inset 3px 0 0 #1d5fae; }
  .cq-tabs-dropdown__heading {
    display: block; padding: .45rem .9rem .15rem; font-weight: 700; color: #4a5a70;
    font-size: .6rem; text-transform: uppercase; letter-spacing: .04em;
  }
  .cq-tabs-dropdown__item--section + .cq-tabs-dropdown__item,
  .cq-tabs-dropdown__item + .cq-tabs-dropdown__item--section { border-top: 1px solid #0021471a; margin-top: .2rem; }
}
@media screen and (max-width: 76.2344em) {
  .cq-tabs-dropdown { display: none; }
}

/* -- logo: the layers icon, big enough to read (as Wavu) ----------------- */
.md-header__button.md-logo { padding: .2rem; margin: .1rem .4rem; }
.md-header__button.md-logo img, .md-header__button.md-logo svg {
  height: 2.2rem; width: auto; border-radius: .45rem; box-shadow: 0 1px 3px #0003;
}

/* -- side-by-side: image left, table/text right (stacks on narrow screens) -- */
.md-typeset .cq-side { display: flex; gap: 1.2rem; align-items: center; margin: 1em 0; }
.md-typeset .cq-side__img { flex: 0 0 42%; }
.md-typeset .cq-side__img img { width: 100%; height: auto; margin: 0; }
.md-typeset .cq-side__body { flex: 1 1 auto; min-width: 0; }
.md-typeset .cq-side__body table:not([class]) { font-size: .7rem; }
@media screen and (max-width: 59.9375em) {
  .md-typeset .cq-side { flex-direction: column; align-items: stretch; }
  .md-typeset .cq-side__img { flex-basis: auto; }
}
.md-typeset .cq-side--wide .cq-side__img { flex: 0 0 32%; }
.md-typeset .cq-side--wide .cq-side__body img { width: 100%; height: auto; margin: 0; }
.md-typeset .cq-caption { font-size: .68rem; color: var(--md-default-fg-color--light); margin-top: -.3em; }
