/*
Import Fira Code and Inter main stylesheets
This is broken when locally deploying with "mdbook serve"
because site-url is not used. Remove "/pandocs" to make it work
*/
@import "../fonts/fira_code.css";
@import "../fonts/inter.css";

html {
  font-family: "Inter", sans-serif;
}

@supports (font-variation-settings: normal) {
  html {
    font-family: "Inter var", sans-serif;
  }
}

@supports (font-variation-settings: normal) {
  code {
    font-family: "Fira Code", monospace;
  }
}

body {
  font-family: "Inter";
  /* Enable some font features for Inter (https://rsms.me/inter/#features/calt) */
  font-feature-settings: "ss01", /* Alternate (Open) digits */ "ss02",
    /* Disambiguation gliphs */ "case";
  /* Case alternates */
  letter-spacing: -0.005em;
  /* equals -0.5% */
}

button {
  font-family: inherit;
}

table {
  font-feature-settings: "tnum", /* Tabular numbers */ "ss01",
    /* Alternate (Open) digits */ "ss02", /* Disambiguation gliphs */ "case";
  /* Case alternates */
}
th {
  text-align: center;
}

code {
  /* "!important" needed because https://github.com/rust-lang/mdBook/issues/1552 */
  font-family: "Fira Code", monospace !important;
  font-size: 0.85em;
  font-weight: 500;
}

.pixelated {
  -ms-interpolation-mode: nearest-neighbor;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.header {
  font-weight: 600;
}

.menu-title {
  font-weight: 400;
  font-size: 2.75rem;
  letter-spacing: -0.02em;
  /* equals -2% */
}

.box {
  margin: 20px 0;
  padding: 1.6px 20px;
  border-left-width: 0.75rem;
  border-left-style: solid;
}

.box > .box-title {
  font-weight: 600;
  text-transform: uppercase;
}

.tip-box {
  border-color: #42b983;
  background-color: var(--quote-bg);
}

.warning-box {
  border-left-color: var(--c-warning);
  background-color: rgba(255, 229, 100, 0.2);
  color: var(--c-warning-text);
}

.warning-box > .box-title {
  color: var(--c-warning-title);
}

.danger-box {
    border-left-color: var(--c-danger);
    background-color: rgba(255, 0, 0, .15);
    color: var(--c-danger-text);
}

.danger-box > .box-title {
    color: var(--c-danger-title);
}

.spacer {
  width: 100%;
  height: 3px;
  margin: 25px 0px 25px 0px;
}

/* Global CSS variables */

:root {
    /* (Override) workaround to get hover+active sidebar links on normal links blue */
    --sidebar-active: var(--links);
    /* Warning boxes base styling */
    --c-warning: #e7c000;
    --c-warning-bg: #fffae3;
    --c-warning-title: #ad9000;
    /* Danger boxes base styling */
    --c-danger: #cc0000;
    --c-danger-text: #660000;
    --c-danger-title: #990000;
}

/* Theme-wide CSS variables */

.ayu {
    --c-warning-text: #eac100;
    --c-danger-text: #ff2929;
    --c-danger-title: #dc0000;
}

.coal {
    --c-warning-text: #eac100;
    --c-danger-text: #ff2929;
    --c-danger-title: #dc0000;
}

.light {
  --c-warning-text: #746000;
}

.navy {
    --c-warning-text: #eac100;
    --c-danger-text: #ff2929;
    --c-danger-title: #dc0000;
}

.rust {
  --c-warning-text: #ad8e00;
}

/* Avoid text being squished too much in fractions */
math[display="block"], mfrac {
  font-size: 2rem;
}
mfrac msup :not(:first-child) {
  font-size: 1.8rem;
}


.bit-descrs {
  text-align: center;
}

.bit-descrs th {
    padding: 3px 10px;
}

/* mdBook aligns the first column, but this is not desirable for those tables */
.bit-descrs.nameless td:first-child {
    text-align: center;
}

/* Improve contrast on bit-descrs borders */
.bit-descrs {
  --table-border-color: var(--table-header-bg);
}

p, .table-wrapper {
  margin-block-start: 1em;
  margin-block-end: 1em;
}
