* { 
  box-sizing: border-box; 
  & > .permalink, & > .headerlink {
    color: #999999 !important;
    font-size: 0.8em;
    padding: 0 4px;
    display: none;
  }
  &:hover > .permalink, &:hover > .headerlink {
    display: inline;
  }
}

body {
  margin: 0;
  font-family: system-ui, Arial, Helvetica, sans-serif;
  color: #222222;
  scroll-padding-top: 66px;
  
  --brand-dark: #7C0094;
  --brand-light: #CC00F3;
  --off-white: #f2f2f2;
  --bigger-font: 17px;
}

nav {
  overflow: hidden;
  position: fixed;
  background-color: #333;
  display: flex;
  width: 100%;
  top: 0;
}

nav > a, nav .relcontainer {
  float: left;
  display: block;
  color: var(--off-white);
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: var(--bigger-font);
}

nav .relcontainer {
  flex-grow: 1;
}

nav div.related {
  /*padding: 14px 16px;
  color: var(--off-white);*/
  width: initial;
  text-align: initial;
  ul {
    padding: 0;
  }
  a {
    text-decoration: none;
    color: inherit;
    &:hover {
      text-decoration: underline;
    }
  }
}

@media screen and (max-width: 12var(--bigger-font)) {
  nav div.related { display: none; }
}

nav > a:hover {
  background-color: #ddd;
  color: black;
}

nav > .logo {
  font-weight: bold;
  font-family: Verdana;
  background-color: var(--brand-light);
  color: white !important;
  height: 50px;
}

nav > .logo:hover {
  background-color: var(--brand-dark);
}

nav > .icon {
  display: none;
}

nav .search-container {
  align-self: right;
}

nav input[type=text] {
  padding: 6px;
  margin-top: 8px;
  font-size: var(--bigger-font);
  border: none;
  background-color: #222;
  color: var(--off-white);
  font-family: inherit;
}

nav .search-container button {
  float: right;
  padding: 6px 10px;
  margin-top: 8px;
  margin-right: 16px;
  background: var(--brand-light);
  font-size: var(--bigger-font);
  border: none;
  cursor: pointer;
  color: var(--off-white);
  font-family: inherit;
}

nav .search-container button:hover {
  background: var(--brand-dark);
}

@media screen and (max-width: 600px) {
  nav a:not(:first-child) {display: none;}
  nav .seperator {display: none;}
  nav a.icon {
    float: right;
    display: block;
  }
  .sidenav { display: none }
  article {
    margin-left: 0 !important;
  }
  footer {
    margin-left: 0 !important;
  }
}

article :is(a, a:visited) {color: dodgerBlue;}
article a:hover {color: royalBlue;}

@media screen and (max-width: 600px) {
  nav.responsive > .icon {
    position: absolute;
    right: 0;
    top: 0;
  }
  nav.responsive > a {
    float: none;
    display: block;
    text-align: left;
  }
  nav.responsive > a.text {display: none}
}

article code:not(pre > code) {
  padding: 4px;
  border-radius: 4px;
  background-color: #efefef;
}

blockquote, .admonition {
  margin-left: 0;
  padding-left: 20px !important;
  border-left: 5px solid grey;
}

.admonition.warning {
  border-left-color: gold;
  background-color: lemonchiffon;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  border: 1px solid #ddd;
}

th, td {
  text-align: left;
  padding: 8px;
}

tr:nth-child(even) {
  background-color: #fafafa;
}

article {
  padding-inline: 12vw;
  margin-top: 66px;
  margin-left: 20vw; /* Same as the width of the sidenav */
}

footer {
  padding-block: 12px;
  padding-inline: 12vw;
  margin-top: 12px;
  background-color: #555;
  color: #ccc;
  margin-left: 20vw;
}

img {
  max-width: 100%;
}

.footnotes {
  font-size: .75em;
  counter-reset: item 1;
}

.footnotes li::marker {
  content: "[" counter(item) "] ";
}

.footnote-ref > a::before {
  content: "[";
}

.footnote-ref > a::after {
  content: "]";
}

/* Fixed sidenav, full height */
.sidenav {
  height: calc(100% - 50px);
  width: 20vw;
  position: fixed;
  z-index: 1;
  top: 50px;
  left: 0;
  background-color: #111;
  overflow-x: hidden;
  padding-top: 20px;
}

/* Style the sidenav links and the dropdown button */
.sidenav a, .dropdown-btn, .sidenav :is(h1, h2, h3, h4, h5, h6) {
  padding: 6px 8px 6px 16px;
  text-decoration: none;
  color: #818181;
  display: block;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  font-size: inherit;
}

.sidenav :is(h1, h2, h3, h4, h5, h6) {
  font-size: 20px;
  color: #f1f1f1;
  cursor: initial;
  margin: 3px 0;
}

.dropdown-btn > a {
  text-decoration: none;
  padding: 0;
  display: inline;
  color: inherit;
}

.dropdown-btn.active:hover, .dropdown-btn.active:focus {
  background-color: var(--brand-light);
}

.dropdown-btn > a:hover, .dropdown-btn > a:focus {
  text-decoration: underline;
}

/* On mouse-over */
.sidenav a:hover, .sidenav a:focus, .dropdown-btn:hover {
  color: #f1f1f1;
}

/* Add an active class to the active dropdown button */
.active {
  background-color: var(--brand-dark);
  color: white;
}

.dropdown-container {
  display: none;
  background-color: #262626;
  padding-left: 8px;
}

/* Optional: Style the caret down icon */
.fa-caret-down {
  float: right;
  padding-right: 8px;
}

/* Some media queries for responsiveness */
@media screen and (max-height: 450px) {
  .sidenav {padding-top: 15px;}
  .sidenav a {font-size: 18px;}
}

/* Hide scrollbar for Chrome, Safari and Opera */
.sidenav::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.sidenav {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

pre {
  padding: 15px;
  white-space: pre-wrap;
  line-break: anywhere;
}

.highlight {
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  background: var(--brand-light);
  color: white;
  padding: 8px;
  z-index: 1000;
}

/* Style the search field */
form.search input[type=text] {
  padding: 10px;
  font-size: var(--bigger-font);
  border: 1px solid grey;
  float: left;
  width: 80%;
  background: white;
  font-family: inherit;
  height: 42px;
  outline: none;
}

/* Style the submit button */
form.search button {
  float: left;
  width: 20%;
  padding: 10px;
  background: var(--brand-light);
  color: white;
  font-size: var(--bigger-font);
  border: 1px solid grey;
  border-left: none; /* Prevent double borders */
  cursor: pointer;
  height: 42px;
}

form.search button:hover {
  background: var(--brand-dark);
}

/* Clear floats */
form.search::after {
  content: "";
  clear: both;
  display: table;
}