:root { 
  --very-light-main: #dbfff2;
  --light-main: #6ef7cc;
  --main: #23e4c0;
  --dark: #005887;
  --warn-background: #F9F4CC;
  --warn-highlight: #F7E76F;
}

.katex-display {
  font-size: 80%;
}

a[href^="#"]:not(.header-anchor)::before {
  content: '# ';
  font-style: italic;
  font-size: 80%;
}

strong {
  font-weight: 600;
}

/* Header Anchors */

a.header-anchor {
  box-shadow: none;
  text-decoration: none;
  visibility: hidden;
  background-image: url('/assets/link.svg');
  background-position: center;
  background-repeat: no-repeat;
  height: 24px;
  width: 24px;
  display: inline-block;
  vertical-align: middle;
  transform: translateY(-2px);
}

main h2, main h3, main h4, main h5, main h6 {
  transform: translateX(-30px);
}

h2:hover a,
h3:hover a,
h4:hover a,
h5:hover a,
h6:hover a {
  visibility: visible;
}

main > h1 {
  margin-bottom: 10px;
}

main > p {
  margin: 20px 0;
}

.meta {
  color: #aaa;
  font-size: 80%;
  text-align: center;
}
.meta .draft {
  font-size: 200%;
  transform: scale(10);
  position: absolute;
  z-index: 0;
  opacity: 0.1;
}
main > aside {
  border: 1px solid;
  padding: 15px;
  margin: 30px 0;
  display: block;
  position: relative;
  line-height: 1.5;
  /* lighten */
  background-image: linear-gradient(
    0deg,
    rgba(255,255,255,0.75) 0%,
    rgba(255,255,255,0.75) 100%);
}

main aside.info {
  border-color: var(--highlight);
  background-color: var(--highlight-muted);
}

main aside.todo {
  border-color: var(--yellow);
  background-color: var(--yellow);
  padding-top: 20px;
}

.var {
  font-family: "Fira Mono", monospace;
  font-size: 14px;
}

/* code blocks */
pre {
  padding: 20px 20px;
  margin: 40px 0;
  border: 1px solid #ddd;
  background-color: rgba(0, 0, 0, 0.02);
  overflow: auto;
  font-size: 80%;
}

p > code, li > code {
  padding: 0 5px;
  border: 1px solid #ddd;
  background-color: rgba(0, 0, 0, 0.02);
  font-size: 90%;
}

/* quotes */

blockquote {
  background-color: rgba(0, 0, 0, 0.02);
  margin: 20px 0;
  padding: 20px;
  border: 1px solid #ddd;
  position: relative;
}
blockquote p::before {
  content: "“";
  transform: scale(10) translate(20%, 15%);
  opacity: 0.05;
  display: inline-block;
  z-index: -1;
}
blockquote cite::before {
  content: '―';
}

/* Attributed Images, similar to figure */
.attributed {
  width: 100%;
  margin: 40px 0;
  position: relative;
}

.attributed img {
  width: 80%;
  margin: 0 10%;
}

.attributed .attribution {
  position: absolute;
  left: 0;
  bottom: 0;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(50%, 1fr));
}
.row > * {
  display: inline-block;
  width: 100%;
}
/*
.row > img {
  object-fit: contain;
}
*/

/* https://fettblog.eu/blog/2013/06/16/preserving-aspect-ratio-for-embedded-iframes/ */
.preserve-aspect {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: calc(100% / var(--aspect, calc(16 / 9)));
}
.preserve-aspect iframe {
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  position: absolute;
}

main img {
  width: 100%;
}

/* figures */
figure {
  width: 100%;
  margin: 40px 0;
  line-height: 1.5;
}

figure > a,
figure > a > video, figure > video,
figure > a > img, figure > img,
figure > iframe {
  max-width: 100%;
  display: block;
  margin: 20px auto;
}
figure figcaption {
  text-align: center;
  width: 80%;
  margin: 20px auto;
  font-size: 80%;
}
figure.cover-image > img {
  object-fit: cover;	
}

/* iframes */

iframe {
  width: 100%;
  border: 0;
}

@media screen and (min-width: 1000px) {
  main img {
    width: 80%;
    margin: 40px auto;
  }
  
  figure img, figure iframe, figure video {
    width: 80%;
    margin: 20px auto;
  }
  
  figure figcaption {
    text-align: center;
    width: 60%;
    margin: 0 20%;
  }
}

.sticky {
  top: 0;
  position: -webkit-sticky;
  position: sticky;
}

main ul {
  margin: 20px 0;
}

.foreward {
  font-style: italic;
}
