/*!
 * from LaTeX.css (https://latex.now.sh/)
 *
 * Source: https://github.com/vincentdoerig/latex-css
 * Licensed under MIT (https://github.com/vincentdoerig/latex-css/blob/master/LICENSE)
*/


/* Theorem */
/* took out: content: 'Theorem ' counter(theorem) '. '; */
/* because counter did not increase across sections */
/* also for lemma, corollary etc. */
body {
  counter-reset: lemma theorem corollary assumption proposition definition;
}


/* Theorem */
.theorem {
  counter-increment: theorem;
  display: block;
  margin: 12px 0;
  font-style: italic;
}
.theorem::before {
  content: 'Theorem ' counter(theorem) '. ';
  font-weight: bold;
  font-style: normal;
}

/* Lemma */
.lemma {
  counter-increment: lemma;
  display: block;
  margin: 12px 0;
  font-style: italic;
}
.lemma::before {
  content: 'Lemma ' counter(lemma) '. ';
  font-weight: bold;
  font-style: normal;
}

/* Corollary */
.corollary {
  counter-increment: corollary;
  display: block;
  margin: 12px 0;
  font-style: italic;
}
.corollary::before {
  content: 'Corollary ' counter(corollary) '. ';
  font-weight: bold;
  font-style: normal;
}

/* Proposition */
.proposition {
  counter-increment: proposition;
  display: block;
  margin: 12px 0;
  font-style: italic;
}
.proposition::before {
  content: 'Proposition' counter(proposition) '. ';
  font-weight: bold;
  font-style: normal;
}

/* Assumption */
.assumption {
  counter-increment: assumption;
  display: block;
  margin: 12px 0;
  font-style: italic;
}
.assumption::before {
  content: 'Assumption' counter(assumption) '. ';
  font-weight: bold;
  font-style: normal;
}

/* Definition */
.definition {
  counter-increment: definition;
  display: block;
  margin: 12px 0;
  font-style: italic;
}
.definition::before {
  content: 'Definition ' counter(definition) '. ';
  font-weight: bold;
  font-style: normal;
}





/* Proof */
.proof {
  display: block;
  margin: 12px 0;
  font-style: normal;
  position: relative;
}
.proof::before {
  content: 'Proof. ' attr(title);
  font-style: italic;
}
.proof:after {
  content: '◾️';
  position: absolute;
  right: -12px;
  bottom: -2px;
}

/* Sidenotes */

.sidenote {
  font-size: 0.8rem;
  float: right;
  clear: right;
  width: 18vw;
  margin-right: -20vw;
  margin-bottom: 1em;
}

.sidenote.left {
  float: left;
  margin-left: -20vw;
  margin-bottom: 1em;
}

/* (WIP) add border when a sidenote is clicked on */
.sidenote:target {
  border: hsl(55, 55%, 70%) 1.5px solid;
  padding: 0 .5rem;
  scroll-margin-block-start: 10rem;
}

/* sidenote counter */
.sidenote-number {
  counter-increment: sidenote-counter;
}

.sidenote-number::after,
.sidenote::before {
  position: relative;
  vertical-align: baseline;
}

/* add number in main content */
.sidenote-number::after {
  content: counter(sidenote-counter);
  font-size: 0.7rem;
  top: -0.5rem;
  left: 0.1rem;
}

/* add number in front of the sidenote */
.sidenote-number ~ .sidenote::before {
  content: counter(sidenote-counter) ' ';
  font-size: 0.7rem;
  top: -0.5rem;
}

label.sidenote-toggle:not(.sidenote-number) {
  display: none;
}

/* sidenotes inside blockquotes are indented more */
blockquote .sidenote {
  margin-right: -24vw;
  width: 18vw;
}


label.sidenote-toggle {
  display: inline;
  cursor: pointer;
}

input.sidenote-toggle {
  display: none;
}

@media (max-width: 1050px) {
  label.sidenote-toggle:not(.sidenote-number) {
    display: inline;
  }
  .sidenote {
    display: none;
  }
  .sidenote-toggle:checked + .sidenote {
    display: block;
    margin: 0.5rem 1.25rem 1rem 0.5rem;
    float: left;
    left: 1rem;
    clear: both;
    width: 95%;
  }
  /* tweak indentation of sidenote inside a blockquote */
  blockquote .sidenote {
    margin-right: -25vw;
    width: 16vw;
  }
}

