$color-primary: hsl(0, 0%, 10%);
$color-text: hsl(0, 0%, 80%);
$color-subtext: hsl(0, 0%, 70%);
$color-border: hsl(0, 0%, 30%);
$color-box-background: #0c0003;
$color-background: #31010e;
$border-radius: 4px;
$font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial,
  sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;

body {
  box-sizing: content-box;
  font-family: $font-family;
  margin: 0 auto;
  line-height: 1.7;
  padding: 4vh 6vw;
  overflow-x: hidden;
  color: $color-text;
  font-size: 1rem;
  max-width: 63em;

  background-color: #31010e;

  @media (min-width: 820px) {
    font-size: 1.2rem;
  }
}

time {
  display: block;
  color: $color-subtext;
  margin: 0.5em 0 1em;
}

footer {
  margin: 2em 0;
  font-size: 0.8em;
  color: $color-subtext;
  padding-top: 1em;
}

img {
  max-width: 100%;
  display: block;
  margin: 0 auto;
  max-height: 75vh;
  border-radius: $border-radius;
}

blockquote {
  padding: 1.5em;
  margin: 0;
  font-size: 0.88em;
  background: $color-box-background;
  border-radius: $border-radius;

  p {
    margin: 0;
  }
}

hr {
  width: 100%;
  border: 0;
  height: 1px;
  margin: 1.5em 0;
  background: $color-border;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.3;
  margin-bottom: 0;
  padding-bottom: 0;
}

a {
  transition: background 300ms;
  padding: 0 0.1em;
  text-decoration: none;
  border-bottom: 1px solid $color-border;
  color: mix($color-background, $color-text, 10%);
  &:hover {
    color: white !important;
    background: #6f0320;
  }
  &:after {
    position: relative;
    top: -0.5em;
    font-size: 0.7em;
    content: "↗";
    color: #aaaaaa;
  }
  &.internal-link:after,
  &.footnote:after,
  &.reversefootnote:after {
    content: "";
  }
}

nav {
  margin: 1em 0 3em;
}

#notes-entry-container {
  display: grid;
  grid-gap: 2em;
  grid-template-areas:
    "content"
    "side";

  @media (min-width: 700px) {
    grid-template-columns: 3fr 1fr;
    grid-template-areas: "content side";
  }
}

.backlink-box, .search-result-box {
  background: $color-box-background;
  padding: 1em;
  border-radius: $border-radius;
}

.search-result-box {
  margin-bottom: 1em;
}

#search-input {
  width: 100%;
  background: $color-box-background;
  border: 0px;
  border-radius: 4px;
  padding: 0.5em;
  color: $color-text;
}

code {
  background: #f5f5f5;
  padding: 0.1em 0.2em;
  border-radius: 4px;
}

.invalid-link {
  color: #6f0320;
  cursor: help;
  background: $color-subtext;
  padding: 0 0.1em;
}

.invalid-link-brackets {
  color: #6f0320;
  cursor: help;
}
