/* ------------------------------------------------------------------ */
/* Brand palette, derived from the ADIRO favicon/logo:                  */
/*   navy   #16305f  (border / I-beam)                                  */
/*   teal   #159ca4  (graph nodes)                                      */
/*   orange #f58a1f  (graph node)                                       */
/* Material's palette is set to "custom" in mkdocs.yml, so these        */
/* variables drive the theme colours.                                   */
/* ------------------------------------------------------------------ */
:root {
  --md-primary-fg-color:          #16305f;
  --md-primary-fg-color--light:   #2a4a80;
  --md-primary-fg-color--dark:    #0e2247;
  --md-primary-bg-color:          #ffffff;
  --md-primary-bg-color--light:   rgba(255, 255, 255, 0.7);
  --md-accent-fg-color:           #f58a1f;
  --md-accent-fg-color--transparent: rgba(245, 138, 31, 0.1);
}

/* Light scheme: navy links on white content. */
[data-md-color-scheme="default"] {
  --md-typeset-a-color: #16305f;
}

/* Dark scheme: use the brighter teal for links so they stay legible on
   the dark content background, while the header stays brand navy. */
[data-md-color-scheme="slate"] {
  --md-typeset-a-color: #3fb6bf;
}

/* Note: the dependency-diagram node label colours are set via Mermaid's own
   `themeCSS` (see scripts/generate_docs.py), because Material scopes its Mermaid
   label styling to the diagram's SVG id and out-specifies plain extra.css rules. */

/* OntoCanvas branding icon inside the "Open in OntoCanvas" buttons on the
   landing page. Sized to sit inline with the button label, matching the look
   of the previous HTML documentation page. */
.md-button img.ontocanvas-icon {
  height: 1.25em;
  width: auto;
  vertical-align: text-bottom;
  margin-right: 0.45em;
}

/* Banner image at the top of the landing page. Centered with a sensible
   maximum size so it looks balanced on wide screens. */
img.adiro-banner {
  display: block;
  margin: 0 auto 1.5rem;
  max-width: 320px;
  width: 100%;
  height: auto;
}

/* The version selector and the three buttons under an ontology page's title share one row (#124). */
.md-typeset .adiro-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.md-typeset .adiro-actions .md-button,
.md-typeset .adiro-actions details.adiro-version {
  margin: 0;
}
/* The content column is only about 690px wide, so the four buttons use a tighter padding and a slightly smaller
   text than a lone .md-button to fit on one row (they still wrap on a narrow screen). */
.md-typeset .adiro-actions .md-button {
  padding: 0.5em 0.9em;
  font-size: 0.66rem;
}

/* Version selector at the top of each ontology page (#124). A <details> element, so it needs no script: the
   <summary> is the button (it carries .md-button) and the list is a panel below it. The selectors are specific
   because Material styles every <details> as a collapsible admonition (border, icon, arrow) and we want none of that. */
.md-typeset details.adiro-version {
  position: relative;
  display: inline-block;
  margin: 0 0.5rem 0.5rem 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
}
.md-typeset details.adiro-version > summary {
  list-style: none;
  cursor: pointer;
  margin: 0;
  padding: 0.5em 0.9em;
  font-size: 0.66rem;
  /* Material's collapsible-block look (pale fill, heavy left border) is reset to the plain outlined .md-button. */
  background-color: transparent;
  border: 0.1rem solid;
  border-radius: 0.1rem;
}
.md-typeset details.adiro-version > summary:hover,
.md-typeset details.adiro-version > summary:focus {
  background-color: var(--md-accent-fg-color);
  border-color: var(--md-accent-fg-color);
  color: var(--md-accent-bg-color);
}
.md-typeset details.adiro-version > summary::-webkit-details-marker {
  display: none;
}
.md-typeset details.adiro-version > summary::before {
  display: none;
}
.md-typeset details.adiro-version > summary::after {
  content: "\25BE";
  position: static;
  display: inline-block;
  width: auto;
  height: auto;
  margin-left: 0.6em;
  background: none;
  -webkit-mask: none;
  mask: none;
  transform: none;
}
.md-typeset details.adiro-version[open] > summary::after {
  content: "\25B4";
  transform: none;
}
.md-typeset details.adiro-version > ul {
  position: absolute;
  z-index: 5;
  top: 100%;
  left: 0;
  min-width: 100%;
  max-height: 16rem;
  overflow-y: auto;
  margin: 0.25rem 0 0;
  padding: 0.25rem 0;
  list-style: none;
  background: var(--md-default-bg-color);
  border: 0.05rem solid var(--md-default-fg-color--lighter);
  border-radius: 0.1rem;
  box-shadow: var(--md-shadow-z2);
}
.md-typeset details.adiro-version > ul > li {
  margin: 0;
  padding: 0;
}
.md-typeset details.adiro-version > ul a {
  display: block;
  padding: 0.35rem 1rem;
  white-space: nowrap;
}
.md-typeset details.adiro-version > ul a:hover {
  background: var(--md-accent-fg-color--transparent);
}
.md-typeset details.adiro-version > ul a.adiro-version-current {
  font-weight: 700;
}
