/*
Entrypoint for the main stylesheet.

To tweak the appearence, change values in `variables.css`
*/
@import "reset.css";
@import "textFonts.css";
@import "layout.css";
@import "variables.css";
@import "authors.css";


body {
  color: var(--main-fg);
  background-color: var(--main-bg);

  text-align: justify;
  padding-bottom: var(--default-spacing);
  margin-top: var(--default-spacing);
}

body,
.normalText {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: underline;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  margin: 0;
  margin-top: calc(2.5 * var(--default-spacing));
  margin-bottom: calc(0.5 * var(--default-spacing));
  font-weight: bold;
}

:is(h1, h2, h3, h4, h5, h6) a {
  font-weight: inherit;
  text-decoration: none;
}

h1 {
  text-align: center;
  font-size: 2.2em;
  margin-top: 3rem;
}

h2 {
  font-size: 1.7em;
}

h3 {
  font-size: 1.5em;
}

h4 {
  font-size: 1.4em;
}

h5 {
  font-size: 1.3em;
}

h6 {
  font-size: 1.2em;
}

p {
  margin: var(--default-spacing) 0;
}

sub,
sup {
  font-size: .83em;
}

sup {
  vertical-align: super;
}

sub {
  vertical-align: sub;
}

.abstract::before {
  content: "Abstract";
  display: block;
  font-weight: bold;
  text-align: center;
  margin-top: calc(2 * var(--default-spacing));
}

.abstract {
  margin: 0 2rem;
}

a[data-preview-anchor] {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--main-subtle);
}

dfn {
  font-style: italic;
}

dfn>a[data-preview-anchor] {
  text-decoration: none;
}

.nowrap {
  white-space: nowrap;
}

.marginale {
  user-select: none;
  font-size: 0.85em;
  line-height: 1.2;
  margin-bottom: var(--default-spacing);

  >.sidenoteCounter {
    margin-right: 0.2rem;
  }
}

.marginale:hover {
  user-select: auto;
}

.sidenoteCounter {
  vertical-align: super;
  font-size: 0.7em;
  user-select: none;
}

.clearRight {
  clear: right;
}

.marginale>img {
  padding: 0;
  margin: 0;
}



/**************************/

@keyframes fadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.previewContainer {
  position: absolute;
  background: inherit;
  box-shadow: 5px 5px 10px 0px rgba(68, 68, 68, 0.80);
  overflow: hidden;
  animation: fadeIn 0.1s;
  width: 100%;
}

iframe {
  display: block;
  border: none;
  width: inherit;
  height: inherit;
}

.previewFadeout {
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 0.07s, opacity 0.07s linear;
}

[data-hl][data-preview-anchor] {
  padding: 0.12em;
  border-radius: 5px;
  transition: background-color 0.5s ease;
}

.isPreview {
  overflow: hidden;
}

/***********************/

em,
i {
  font-style: italic;
}

strong,
b {
  font-weight: bold;
}

code {
  font-family: var(--font-mono);
  background-color: var(--code-bg);
  border-radius: 4px;
  padding: 0.1rem;
  font-size: 0.85em;
}

ul,
ol {
  margin: var(--default-spacing) 0;
  display: block;
}

img {
  margin-top: calc(2 * var(--default-spacing));
  margin-bottom: var(--default-spacing);
  display: block;
}

li> :is(ul, ol) {
  margin-top: 0;
}

ul,
ol {
  list-style-position: outside;
  padding-left: var(--default-spacing);
}

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

li {
  margin-left: var(--default-spacing);
}

blockquote {
  border-left: solid 3px var(--main-subtle);
  padding: 1px 0.5em 1px 1em;
  background-color: #eee;
}

img {
  width: 100%;
  height: auto;
}

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

tr:nth-child(2n),
thead {
  background-color: #eeeeee;
}

td,
th {
  padding: 2px 0;
  text-align: center;
}

figure {
  margin-top: calc(2 * var(--default-spacing));
  margin-left: var(--default-spacing);
  margin-right: var(--default-spacing);
  margin-bottom: var(--default-spacing);

  >figcaption {
    text-align: center;
    font-size: 0.92em;

    >p:not(p:first-child) {
      text-align: left;
    }
  }
}

figure:not(.theoremlike)>figcaption>*:not(*:first-child) {
  margin-top: calc(0.25 * var(--default-spacing));
}

figure.theoremlike {
  display: flex;
  flex-direction: column;
  margin: 0;

  >figcaption {
    order: -1;
    text-align: left;
    font-weight: bold;
    transform: translate(-0.12em
        /*offset the highlighting margin for the title*/
        , 0);
  }

  >* {
    margin-top: calc(0.25 * var(--default-spacing));
  }

  >*:first-child {
    margin-top: 0;
  }
}

span.katex {
  font-size: 1em;
}

.katex-display {
  margin: var(--default-spacing) 0 !important;
}

.normalText {
  font-family: var(--font-body);
  font-size: 1rem;
}

.katex a {
  text-decoration: none;
}


/* Hack to prevent katex blocking mouse interaction with invisible rectangles */
/* .vlist-t.vlist-t2 > .vlist-r > .vlist:only-child {
  pointer-events: none;
  background: rgba(255, 0, 0, 0.5);
} */



.toc {
  font-size: 0.85rem;
  text-align: left;

  ol {
    margin: 0;
  }
}

.toc li {
  list-style: none;
  line-height: 1.1;
  margin-top: 0.3rem;
}

.toc li>a {
  text-decoration: none;
  color: var(--main-subtle);
  transition: color 0.5s ease-in-out;
}

li.tocVisible>a,
.toc li>a:hover {
  color: var(--main-fg);
}

.csl-bib-body.hangingindent {
  text-indent: 2em hanging;
}

.csl-bib-body {
  margin: var(--default-spacing) 0;

  a {
    text-decoration: none;
  }
}

a.bib {
  text-decoration: none;

  .bibText {
    text-decoration: underline solid;
  }

  .bibCitation {
    color: var(--main-subtle);
  }
}

.csl-bib-body:is(.flush, .margin) {
  display: grid;
  grid-template-columns: max-content 1fr;
  justify-items: start;
  column-gap: 0.5em;

  .bibBlurb {
    grid-column: 1 / 3;
  }
}

.bibBlurb {
  text-indent: initial;
  margin-top: 1em;
  font-size: 0.9rem;
  background-color: #eeeeee;
  border-radius: 2px;
  padding: 2px;

  *:first-child {
    margin-top: 0;
  }

  *:last-child {
    margin-bottom: 0;
  }
}

.dataHeading {
  text-align: center;
  font-size: 0.95em;
  margin-top: 1rem;
}

.coloredData {
  padding: 0.05em 0.2em;
  border-radius: 4px;

  .rustic.function {
    color: var(--main-fg);
  }

  code {
    background-color: inherit;
    border-radius: 0px;
    padding: 0;
    font-size: inherit;
  }
}

.clientState.compact {
  font-size: 0.9em;
}

.clientStateBox {
  display: inline-block;
  margin: 0.3rem 0.3rem;
  padding: 0 0.3rem;
  border-radius: 2px;
  border-width: 1px;
}

.compact .clientStateBox {
  margin: 0.3rem 0.15rem;
  padding: 0 0.12rem;
}

.miss {
  color: #eeeeee;
  border-color: #eeeeee;
  background-color: var(--main-bg);
  border-style: dashed;
}

.unve {
  color: #976803;
  border-color: #976803;
  border-style: dotted;

  background-image: linear-gradient(45deg, #fcd37c 25%, #ffeabd 25%, #ffeabd 50%, #fcd37c 50%, #fcd37c 75%, #ffeabd 75%, #ffeabd 100%);
  background-size: 40px 40px;
}

.veri {
  border-style: solid;
  color: #034e00;
  border-color: #034e00;
  background-color: #c0e8ae;
}

.done {
  border-style: solid;
  color: #5e6f5e;
  border-color: #ececec;
  background-color: #ececec;
}

.clientStateRow {
  margin: 2rem 0;
}

.clientStateNode.done {
  border-color: #5e6f5e;
}

.clientStateNode {
  position: absolute;
  display: inline-block;
  padding: 0 0.4rem;
  border-width: 1px;
  border-radius: 2px;
  font-size: 1.2em;
}

.clientTreeContainer {
  margin: 0 auto;
  width: 0px;
  position: relative;
}

.clientTreeComputations {
  display: inline-block;
  width: 21em;
  font-size: 0.8em;
  padding-top: 2em;
}

@media (width <= 961.64px) {
  .clientTreeComputations {
    display: none;
  }
}

.computation {
  margin: 0.2em 0;
}

.computation.old {
  color: var(--main-subtle);

  .rustic.function {
    color: var(--main-subtle);
  }
}

.computation.future {
  color: #eeeeee;

  .rustic.function {
    color: #eeeeee;
  }

  a {
    text-decoration: none;
  }
}

.computation:not(.old):not(.future) {
  background-color: #c0e8ae;
  border-radius: 2px;
}

.treeEdge {
  border-top: solid 1px rgb(207, 207, 207);
  position: absolute;
}

/* Slideshows */

.slider {
  overflow: hidden;
}

.slides {
  display: flex;
}

.slide {
  flex-shrink: 0;
  width: 100%;
}

.slideNav {
  display: flex;
  justify-content: space-evenly;
  gap: 5rem;

  >a {
    display: inline-block;
    flex-grow: 1;
    text-align: center;
    text-decoration: none;

    cursor: pointer;
    padding: 5px 16px;
    border: 1px solid;
    border-radius: 4px;
    transition: 0.2s cubic-bezier(0.3, 0, 0.5, 1);
    transition-property: color, background-color, border-color;
  }

  >a:hover {
    background-color: #e0e0e0;
  }

  >a.inactive {
    background-color: #dddddd;
    color: var(--main-subtle);
    cursor: not-allowed;
  }
}