/*
 * Webis style for MkDocs Material (mkdocs-webis).
 *
 * Follows the style of the Webis homepage (https://webis.de/): a dark gray
 * navigation bar with the Webis logo and uppercase links, "Product Sans" and
 * "Noto Sans" fonts, plain headings, blue links and buttons, flat tables with
 * thin row dividers, and a light gray footer.
 */

:root {
  /* Colors of webis.de. */
  --webis-dark: #323232;
  --webis-dark-border: #727272;
  --webis-text: #222222;
  --webis-heading: #333333;
  --webis-muted: #666666;
  --webis-muted-bg: #f8f8f8;
  --webis-border: #e5e5e5;
  --webis-border-strong: #b2b2b2;
  --webis-link: #0645ad;
  --webis-blue: #1e87f0;
  --webis-blue-dark: #0f7ae5;
  --webis-green: #32d296;
  --webis-orange: #faa05a;
  --webis-red: #f0506e;

  /* Text size of webis.de: 13px, or 14px on high-resolution screens. */
  --webis-font-size: 0.65rem;
  --webis-line-height: 1.5;
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  :root {
    --webis-font-size: 0.7rem;
    --webis-line-height: 1.6;
  }
}

body {
  /* Like webis.de, without Material's (thinner) antialiased font smoothing. */
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  /* Like webis.de, use Product Sans or Noto Sans if installed. */
  --md-text-font-family: "Product Sans", "Noto Sans", Verdana, sans-serif;
  --md-code-font-family: Consolas, monaco, monospace;
}

/* The colors of webis.de (light only, like webis.de). */
[data-md-color-scheme="webis"] {
  color-scheme: light;

  --md-default-fg-color: var(--webis-text);
  --md-default-fg-color--light: var(--webis-muted);
  --md-default-fg-color--lighter: #999999;
  --md-default-fg-color--lightest: var(--webis-border);
  --md-default-bg-color: #ffffff;

  --md-primary-fg-color: var(--webis-dark);
  --md-primary-fg-color--light: var(--webis-dark);
  --md-primary-fg-color--dark: var(--webis-dark);
  --md-primary-bg-color: #ffffff;
  --md-primary-bg-color--light: rgba(255, 255, 255, 0.7);

  --md-accent-fg-color: var(--webis-blue);
  --md-accent-fg-color--transparent: rgba(30, 135, 240, 0.1);
  --md-accent-bg-color: #ffffff;

  --md-typeset-color: var(--webis-text);
  --md-typeset-a-color: var(--webis-link);
  --md-typeset-mark-color: #ffffdd;

  --webis-heading-color: var(--webis-heading);
  --webis-rule-color: var(--webis-border);
  --webis-surface-color: var(--webis-muted-bg);

  --md-code-fg-color: #454545;
  --md-code-bg-color: var(--webis-muted-bg);
  --md-code-hl-color: rgba(255, 255, 221, 1);
  --md-code-hl-keyword-color: #0645ad;
  --md-code-hl-function-color: #1c79cc;
  --md-code-hl-string-color: #1f8a5e;
  --md-code-hl-number-color: #c4621b;
  --md-code-hl-constant-color: #c4621b;
  --md-code-hl-special-color: #d42f50;
  --md-code-hl-name-color: var(--md-code-fg-color);
  --md-code-hl-operator-color: var(--webis-muted);
  --md-code-hl-punctuation-color: var(--webis-muted);
  --md-code-hl-comment-color: #999999;
  --md-code-hl-generic-color: var(--webis-muted);
  --md-code-hl-variable-color: #411ef0;

  --md-footer-fg-color: var(--webis-text);
  --md-footer-fg-color--light: var(--webis-muted);
  --md-footer-fg-color--lighter: #999999;
  --md-footer-bg-color: var(--webis-muted-bg);
  --md-footer-bg-color--dark: var(--webis-muted-bg);
}

/* ------------------------------------------------------------------------
 * Header: the dark gray navigation bar of webis.de (70px high, logo and
 * site name, uppercase navigation links, then palette, repository, search).
 * Font sizes follow webis.de (see --webis-font-size; Material's 1rem is 20px).
 * --------------------------------------------------------------------- */

.md-header {
  box-shadow: none;
  border-bottom: 1px solid var(--webis-dark-border);
}

/* Unlike Material, webis.de does not scale its text up on wide screens. */
html {
  font-size: 125%;
}

/*
 * Page width of webis.de: at most 1200px of content, with 40px padding from
 * 960px (Material's 60em breakpoint) up, for the header and the main area.
 */
.md-grid {
  max-width: 1280px;
}

@media screen and (min-width: 60em) {
  .md-grid,
  .md-header__inner.md-grid {
    padding-left: 40px;
    padding-right: 40px;
  }
}

/* Like webis.de, the content starts right at the left edge (or sidebar). */
@media screen and (min-width: 60em) {
  [dir="ltr"] .md-content > .md-content__inner,
  [dir="ltr"] .md-sidebar--primary:not([hidden]) ~ .md-content > .md-content__inner {
    margin-left: 0;
  }

  [dir="rtl"] .md-content > .md-content__inner,
  [dir="rtl"] .md-sidebar--primary:not([hidden]) ~ .md-content > .md-content__inner {
    margin-right: 0;
  }
}

.md-header[data-md-state="shadow"],
.md-header--shadow {
  box-shadow: none;
}

.md-header__inner {
  height: 3.5rem;
}

/* The logo starts at the content's edge, 15px before the site name. */
.md-header__button.md-logo {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 15px;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: calc(1.9 * var(--webis-font-size));
}

.md-header__title {
  height: 3.5rem;
  line-height: 3.5rem;
  font-size: calc(1.02 * var(--webis-font-size));
  font-weight: 400;
  text-transform: uppercase;
}

.md-header__topic:first-child {
  font-weight: 400;
}

/* The header is higher than Material's, so sticky sidebars and anchors move. */
.md-sidebar {
  top: 3.5rem;
}

.md-typeset :target {
  --md-scroll-margin: 4.7rem;
}

/* Site name and navigation links, like the links of the webis.de navbar. */
/* The title fills the space, which moves everything else to the right. */
[dir] .webis-header .md-header__title {
  flex-grow: 1;
  margin-left: 0.25em;
  margin-right: 0.75rem;
}

.webis-header__site-name,
.webis-header__nav-link {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: color 0.1s ease-in-out;
}

.webis-header__site-name:hover,
.webis-header__site-name:focus {
  color: #ffffff;
}

.webis-header__nav {
  display: none;
  gap: 0.75rem;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}

@media screen and (min-width: 76.25em) {
  .webis-header__nav {
    display: flex;
  }

  /* Pushes the navigation to the right, like on webis.de. */
  [dir] .webis-header .md-header__title {
    margin-right: 0;
  }
}

.webis-header__nav-item {
  display: flex;
  align-items: center;
}

.webis-header__nav-link {
  color: rgba(255, 255, 255, 0.75);
  font-size: calc(1.02 * var(--webis-font-size));
  line-height: 3.5rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.webis-header__nav-link:hover,
.webis-header__nav-link:focus {
  color: #ffffff;
}

.webis-header__nav-item--active .webis-header__nav-link {
  color: #ffffff;
  text-decoration: underline;
  text-underline-position: under;
}

.webis-header__nav + .webis-header__source {
  margin-left: 0.75rem;
}

/* Small icon button for the repository (icon only). */
.webis-header .md-header__button.md-icon {
  margin: 0.2rem 0.1rem;
  padding: 0.3rem;
}

.webis-header .md-header__button.md-icon svg {
  width: 1rem;
  height: 1rem;
}

.webis-header__source {
  color: rgba(255, 255, 255, 0.7);
}

.webis-header__source:hover,
.webis-header__source:focus {
  color: #ffffff;
}

/* Compact search box at the end of the header line. */
.md-search__form {
  border-radius: 0;
  background-color: rgba(255, 255, 255, 0.1);
}

.md-search__form:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

@media screen and (min-width: 60em) {
  .webis-header .md-search {
    margin-left: 0.4rem;
  }

  .webis-header .md-search__inner {
    width: 8rem;
  }

  [data-md-toggle="search"]:checked ~ .webis-header .md-search__inner {
    width: 20rem;
  }

  .webis-header .md-search__form {
    height: 1.5rem;
  }

  .webis-header .md-search__input,
  .webis-header .md-search__suggest {
    font-size: 0.7rem;
  }

  [dir="ltr"] .webis-header .md-search__input,
  [dir="ltr"] .webis-header .md-search__suggest {
    padding-left: 1.8rem;
  }

  [dir="rtl"] .webis-header .md-search__input,
  [dir="rtl"] .webis-header .md-search__suggest {
    padding-right: 1.8rem;
  }

  .webis-header .md-search__icon[for="__search"] {
    top: 0.2rem;
  }

  [dir="ltr"] .webis-header .md-search__icon[for="__search"] {
    left: 0.4rem;
  }

  [dir="rtl"] .webis-header .md-search__icon[for="__search"] {
    right: 0.4rem;
  }

  .webis-header .md-search__icon svg {
    width: 1rem;
    height: 1rem;
  }

  .webis-header .md-search__options {
    top: 0.15rem;
  }

  .webis-header .md-search__output {
    top: 1.5rem;
  }
}

/* ------------------------------------------------------------------------
 * Navigation sidebars: gray links, the current page in black.
 * --------------------------------------------------------------------- */

.md-nav {
  font-size: calc(0.875 * var(--webis-font-size));
}

.md-nav__link--active,
.md-nav__item .md-nav__link--active {
  color: var(--md-typeset-color);
  font-weight: 700;
}

/* ------------------------------------------------------------------------
 * Typography: plain, normal-weight headings and blue links.
 * --------------------------------------------------------------------- */

.md-typeset {
  font-size: var(--webis-font-size);
  line-height: var(--webis-line-height);
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  color: var(--webis-heading-color);
  font-weight: 400;
  letter-spacing: normal;
}

.md-typeset h1 {
  font-size: 2.625em;
  line-height: 1.2;
  margin: 0 0 0.6em;
}

.md-typeset h2 {
  font-size: 1.7em;
  line-height: 1.3;
}

.md-typeset h3 {
  font-size: 1.2em;
  line-height: 1.4;
}

/* Bold instead of webis.de's 1.25rem, so that h4 is not larger than h3. */
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  font-size: 1em;
  line-height: 1.4;
  font-weight: 700;
  text-transform: none;
}

.md-typeset h6 {
  font-size: 0.875em;
}

/* A subtitle directly below a page title. */
.md-typeset .subtitle {
  color: var(--md-default-fg-color--light);
  font-size: 1.2em;
  margin-top: -0.8em;
}

.md-typeset a {
  text-decoration: none;
}

.md-typeset a:hover,
.md-typeset a:focus {
  color: var(--md-typeset-a-color);
  text-decoration: underline;
}

.md-typeset .headerlink:hover,
.md-typeset .md-button:hover,
.md-typeset .tabbed-labels a:hover {
  text-decoration: none;
}

.md-typeset .headerlink:hover,
.md-typeset .headerlink:focus {
  color: var(--md-accent-fg-color);
}

.md-typeset blockquote {
  border-left-color: var(--webis-rule-color);
  color: var(--md-default-fg-color--light);
}

.md-typeset hr {
  border-bottom-color: var(--webis-rule-color);
}

/* ------------------------------------------------------------------------
 * Citations and references.
 * --------------------------------------------------------------------- */

/* Gray citations in brackets, e.g., "[Fang et al., 2004]", as on the slides. */
.md-typeset .citation {
  color: var(--md-default-fg-color--light);
}

.md-typeset .citation a {
  color: inherit;
  white-space: nowrap;
}

.md-typeset .citation a:hover,
.md-typeset .citation a:focus {
  color: var(--md-accent-fg-color);
}

/* References: plain entries, like the publications list of webis.de. */
.md-typeset .reference {
  margin: 0 0 2.5ex;
  line-height: 1.6;
}

.md-typeset .reference .venue {
  font-style: italic;
}

.md-typeset .reference-links label {
  color: var(--md-typeset-a-color);
  cursor: pointer;
}

.md-typeset .reference-links label:hover {
  text-decoration: underline;
}

/* The checkbox toggling the BibTeX is hidden, but stays keyboard-accessible. */
.md-typeset .reference-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.md-typeset .reference-toggle:focus-visible + .reference-links label {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 2px;
}

.md-typeset .reference-bibtex {
  display: none;
  margin: 0.6em 0 0;
}

.md-typeset .reference-toggle:checked ~ .reference-bibtex {
  display: block;
}

/* ------------------------------------------------------------------------
 * Tables: no outer border, thin row dividers, uppercase gray headers.
 * --------------------------------------------------------------------- */

.md-typeset table:not([class]) {
  font-size: 1em;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.md-typeset table:not([class]) th {
  background-color: transparent;
  color: var(--md-default-fg-color--light);
  font-size: 0.875em;
  font-weight: 700;
  text-transform: uppercase;
  vertical-align: bottom;
  border-bottom: 1px solid var(--webis-rule-color);
}

.md-typeset table:not([class]) td {
  border-top: 1px solid var(--webis-rule-color);
  vertical-align: top;
}

.md-typeset table:not([class]) tbody tr:first-child td {
  border-top: none;
}

.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td {
  padding: 0.8em 0.6em;
}

.md-typeset table:not([class]) tbody tr:hover {
  background-color: var(--webis-surface-color);
  box-shadow: none;
}

/* ------------------------------------------------------------------------
 * Admonitions: flat, lightly tinted boxes, like the alerts of webis.de.
 * --------------------------------------------------------------------- */

.md-typeset .admonition,
.md-typeset details {
  --webis-admonition-color: var(--md-default-fg-color--lighter);

  border: none;
  border-left: 3px solid var(--webis-admonition-color);
  font-size: 1em;
  border-radius: 0;
  box-shadow: none;
  background-color: color-mix(
    in srgb,
    var(--webis-admonition-color) 10%,
    var(--md-default-bg-color)
  );
}

.md-typeset .admonition:focus-within,
.md-typeset details:focus-within {
  box-shadow: none;
}

.md-typeset .admonition > .admonition-title,
.md-typeset details > summary {
  background-color: transparent;
  color: var(--md-typeset-color);
}

.md-typeset .admonition > .admonition-title::before,
.md-typeset details > summary::before,
.md-typeset details > summary::after {
  background-color: var(--webis-admonition-color);
}

.md-typeset .admonition.note,
.md-typeset details.note,
.md-typeset .admonition.info,
.md-typeset details.info,
.md-typeset .admonition.question,
.md-typeset details.question {
  --webis-admonition-color: var(--webis-blue);
}

.md-typeset .admonition.tip,
.md-typeset details.tip,
.md-typeset .admonition.success,
.md-typeset details.success {
  --webis-admonition-color: var(--webis-green);
}

.md-typeset .admonition.warning,
.md-typeset details.warning {
  --webis-admonition-color: var(--webis-orange);
}

.md-typeset .admonition.failure,
.md-typeset details.failure,
.md-typeset .admonition.danger,
.md-typeset details.danger,
.md-typeset .admonition.bug,
.md-typeset details.bug {
  --webis-admonition-color: var(--webis-red);
}

/* abstract, example, and quote (used for BibTeX blocks): gray. */
.md-typeset .admonition.abstract,
.md-typeset details.abstract,
.md-typeset .admonition.example,
.md-typeset details.example,
.md-typeset .admonition.quote,
.md-typeset details.quote {
  --webis-admonition-color: var(--md-default-fg-color--lighter);
}

.md-typeset .admonition.quote,
.md-typeset details.quote {
  background-color: var(--webis-surface-color);
}

.md-typeset .quote > summary {
  color: var(--md-default-fg-color--light);
}

/* ------------------------------------------------------------------------
 * Code: Consolas, light gray inline code, outlined code blocks.
 * --------------------------------------------------------------------- */

.md-typeset code {
  border-radius: 0;
  font-size: 0.875em;
}

.md-typeset pre > code {
  background-color: var(--md-default-bg-color);
  border: 1px solid var(--webis-rule-color);
  border-radius: 3px;
}

.md-typeset .admonition pre > code,
.md-typeset details pre > code {
  background-color: var(--md-code-bg-color);
}

/* ------------------------------------------------------------------------
 * Buttons: uppercase, square, blue primary buttons.
 * --------------------------------------------------------------------- */

.md-typeset .md-button {
  padding: 0.5em 2em;
  border: 1px solid var(--webis-rule-color);
  border-radius: 0;
  color: var(--md-typeset-color);
  font-size: 0.875em;
  font-weight: 400;
  text-transform: uppercase;
}

.md-typeset .md-button:hover,
.md-typeset .md-button:focus {
  background-color: transparent;
  border-color: var(--webis-border-strong);
  color: var(--md-typeset-color);
}

.md-typeset .md-button--primary {
  background-color: var(--webis-blue);
  border-color: transparent;
  color: #ffffff;
}

.md-typeset .md-button--primary:hover,
.md-typeset .md-button--primary:focus {
  background-color: var(--webis-blue-dark);
  border-color: transparent;
  color: #ffffff;
}

/* Badges: small labels, e.g., for names or acronyms. */
.md-typeset .badge {
  display: inline-block;
  padding: 0 0.6em;
  border-radius: 2px;
  background-color: var(--webis-blue);
  color: #ffffff;
  font-size: 0.8em;
  line-height: 1.6;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}

/* Cards: flat, with a thin border. */
.md-typeset .grid.cards > ul > li,
.md-typeset .grid > .card {
  border: 1px solid var(--webis-rule-color);
  border-radius: 0;
  box-shadow: none;
}

.md-typeset .grid.cards > ul > li:hover,
.md-typeset .grid > .card:hover {
  border-color: var(--webis-border-strong);
  box-shadow: none;
}

/* ------------------------------------------------------------------------
 * Footer: light gray, with small gray text.
 * --------------------------------------------------------------------- */

.md-footer {
  border-top: 1px solid var(--webis-rule-color);
}

.md-footer-meta {
  border-top: 1px solid var(--webis-rule-color);
}

.md-footer-meta,
.md-copyright,
.md-social {
  font-size: calc(0.875 * var(--webis-font-size));
}

.md-footer-meta,
.md-copyright {
  color: var(--md-footer-fg-color--light);
}

.md-footer-meta.md-typeset a,
.md-copyright__highlight {
  color: var(--md-footer-fg-color--light);
}

.md-footer-meta.md-typeset a:hover,
.md-footer-meta.md-typeset a:focus {
  color: var(--md-accent-fg-color);
}

/* Definition lists: bold terms. */
.md-typeset dt {
  font-weight: 700;
}
