
body{
  display: grid;
  grid-template-columns: minmax(0, 70ch) minmax(0, 25ch);
  justify-content: start;
}

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

pre:has(code) {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid rgba(0,0,0,0.1);
  padding: 10px;
  border-radius: 3px;
}

p, h1,h2,h3, h4, ol, ul, img, pre, blockquote {
  grid-column: 1;
}

sup a {
  text-decoration: none;
}


/* Place footnotes near their anchor */
sup#loc-1 { anchor-name: --footnote-1 }
li:has(a[href="#loc-1"]) { top: anchor(--footnote-1 top) }

sup#loc-2 { anchor-name: --footnote-2 }
li:has(a[href="#loc-2"]) { top: anchor(--footnote-2 top) }

/* Styling for the footnote (complete) */
li:has(sup) {
  position: absolute;
  opacity: 70%;
  max-width: 20ch;
  font-size: 0.9em;
}

/* Styling for just the number of footnote */
sup[role="doc-backlink"] {
  opacity: 30%;
  margin-right: 2px;
  position: absolute;
  left: -10px;
  top: -5px;
}

/* Mobile Styling */
@media (max-width: 768px) {
  body {
    display: block;
  }

  /* have footnotes show up at the end of the document */
  li:has(sup) {
    position: inherit;
    max-width: 100%;
  }

  sup[role="doc-backlink"] {
    position: inherit;
    padding-right: 2px;
  }
}

