/* InIT-Lab V3.0 theme: sober, white, ZHAW-blue accents, square shapes.
   Shared by the public and the admin site; the admin site overrides the --init-primary* colours. */

:root {
  --init-primary: #0064a6;
  --init-primary-dark: #00477a;
  --init-primary-light: #e6f0f7;
  --init-grey-900: #1e1e1e;
  --init-grey-700: #4a4a4a;
  --init-grey-200: #e3e3e3;
  --init-grey-100: #f4f4f4;
  --init-font: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  --init-mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

[data-md-color-scheme="default"] {
  --md-primary-fg-color: var(--init-primary);
  --md-primary-fg-color--light: #3383b8;
  --md-primary-fg-color--dark: var(--init-primary-dark);
  --md-primary-bg-color: #ffffff;
  --md-accent-fg-color: var(--init-primary-dark);
  --md-typeset-a-color: var(--init-primary);
  --md-default-fg-color: var(--init-grey-900);
  --md-footer-bg-color: #2b2b2b;
  --md-footer-bg-color--dark: #1f1f1f;
}

[data-md-color-scheme="slate"] {
  --md-hue: 210;
  --md-primary-fg-color: #4d9fd6;
  --md-primary-fg-color--dark: var(--init-primary-dark);
  --md-accent-fg-color: #7dbbe6;
  --md-typeset-a-color: #6fb3e3;
  --init-primary-light: #16324a;
  --init-grey-200: #2f3a44;
  --init-grey-100: #1d252c;
}

body, input, .md-typeset { font-family: var(--init-font); }
code, kbd, pre { font-family: var(--init-mono); }

/* ---------------------------------------------------------------- header */

.md-header {
  background: #ffffff;
  color: var(--init-grey-900);
  box-shadow: none;
  border-bottom: 1px solid var(--init-grey-200);
}
[data-md-color-scheme="slate"] .md-header { background: #141a1f; color: #e8e8e8; }

.md-header__inner { height: 4rem; }
.md-header__button.md-logo { margin: 0 .6rem 0 0; padding: 0; }
.md-header__button.md-logo img { height: 2.6rem; width: auto; }
.md-header__title { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.md-header__topic:first-child { font-weight: 700; }

.init-subtitle {
  display: block;
  font-size: .62rem;
  font-weight: 400;
  color: var(--init-grey-700);
  letter-spacing: .02em;
  line-height: 1.1;
}
[data-md-color-scheme="slate"] .init-subtitle { color: #a9b4bd; }

.md-search__form { background: var(--init-grey-100); border-radius: 0; }
.md-search__form:hover { background: var(--init-grey-200); }
[data-md-color-scheme="default"] .md-search__input::placeholder,
[data-md-color-scheme="default"] .md-search__icon { color: var(--init-grey-700); }

/* ---------------------------------------------------------------- tabs: the blue institute bar */

.md-tabs { background: var(--init-primary); color: #ffffff; }
.md-tabs__link { font-size: .78rem; opacity: .85; margin-top: .55rem; }
.md-tabs__link:hover, .md-tabs__item--active .md-tabs__link { opacity: 1; color: #ffffff; }
.md-tabs__item--active .md-tabs__link { border-bottom: 3px solid #ffffff; padding-bottom: .2rem; }

/* ---------------------------------------------------------------- hero (home page only) */

.init-hero {
  background: linear-gradient(120deg, var(--init-primary) 0%, var(--init-primary-dark) 100%);
  color: #ffffff;
}
.init-hero__inner { padding: 2.4rem .8rem 2.6rem; }
.init-hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .62rem;
  opacity: .85;
  margin: 0 0 .4rem;
}
.init-hero h1 { color: #ffffff; font-size: 2.2rem; font-weight: 700; margin: 0 0 .5rem; letter-spacing: -.02em; }
.init-hero p { margin: 0; max-width: 38rem; font-size: .85rem; line-height: 1.5; opacity: .95; }
.init-hero__links { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.init-hero__links a {
  color: var(--init-primary-dark);
  background: #ffffff;
  padding: .45rem .9rem;
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
}
.init-hero__links a:hover { background: var(--init-primary-light); }
@media screen and (max-width: 44.9375em) {
  .init-hero h1 { font-size: 1.6rem; }
}

/* ---------------------------------------------------------------- content */

.md-typeset h1 { font-weight: 700; color: var(--md-default-fg-color); letter-spacing: -.015em; }
.md-typeset h2 {
  font-weight: 700;
  border-top: 1px solid var(--init-grey-200);
  padding-top: .9rem;
  margin-top: 2rem;
}
.md-typeset h3 { font-weight: 700; }
.md-typeset a { text-decoration: none; }
.md-typeset a:hover { text-decoration: underline; }

/* square, flat admonitions with a strong left bar */
.md-typeset .admonition, .md-typeset details {
  border-radius: 0;
  border-width: 0 0 0 4px;
  box-shadow: none;
  background: var(--init-grey-100);
  font-size: .78rem;
}
.md-typeset .admonition-title, .md-typeset summary { border-radius: 0; font-weight: 700; }

/* tables */
.md-typeset table:not([class]) { border-radius: 0; font-size: .74rem; }
.md-typeset table:not([class]) th { background: var(--init-primary-light); }
.md-typeset .dw-table { overflow-x: auto; }
.md-typeset .dw-table table {
  border-collapse: collapse;
  font-size: .74rem;
  margin: 1em 0;
}
.md-typeset .dw-table th, .md-typeset .dw-table td {
  border: 1px solid var(--init-grey-200);
  padding: .45em .8em;
  vertical-align: top;
  text-align: left;
}
.md-typeset .dw-table th { background: var(--init-primary-light); }
.md-typeset .dw-table img { max-width: 100%; height: auto; }

/* images coming from DokuWiki ({{ :img |}} alignment) */
.md-typeset img { max-width: 100%; height: auto; }
.md-typeset .img-center { display: block; margin: .6em auto; }
.md-typeset .img-left { display: block; margin: .6em 0; }
.md-typeset .img-right { float: right; margin: 0 0 .8em 1.2em; }

.md-typeset .video-embed { position: relative; aspect-ratio: 16 / 9; max-width: 100%; }
.md-typeset .video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* links that still point to the old wiki (pages not yet migrated) */
.md-typeset a.external-wiki::after { content: " ↗"; font-size: .8em; }

.md-typeset code { border-radius: 0; }
.md-typeset pre > code { border-left: 3px solid var(--init-primary); }

/* ---------------------------------------------------------------- footer */

.md-footer-meta { background: #1f1f1f; }
.md-copyright { font-size: .64rem; }
.md-copyright a { color: #cfe3f2; }

/* rows of Grafana graphs (service status, GPU pages): wrap on narrow screens */
.md-typeset .graph-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.md-typeset .graph-row > a { min-width: 0; }
.md-typeset .graph-row img { display: block; width: 100%; height: auto; }

/* coloured text from the old wiki (<color ...>): readable in dark mode */
[data-md-color-scheme="slate"] .md-typeset .dw-color { filter: brightness(1.6) saturate(0.8); }

/* a horizontal rule right before a section heading: the heading's own top border is enough */
.md-typeset hr + h2 { border-top: none; padding-top: 0; }
