:root {
  --text-color: #222;
  --text-light: #222222C0;
  --primary-color: #D3D3FF80;
  --link-color: #450084A0;
  --link-hover-color: #A0A0FF;
  --code-background: #D3D3FF40;
  --accent: #D3D3FF;
  --box-shadow:
    0 4px 4px rgba(11, 15, 15, 0.05),
    0 6px 12px -6px rgba(11, 15, 15, 0.2);
  --box-shadow-subtle:
    0 1px 1px rgba(11, 15, 15, 0.05),
    0 1px 2px -1px rgba(11, 15, 15, 0.2);
  --font-family: system-ui;
  --font-family-heading: "Encode Sans", system-ui, sans-serif;
  --font-family-mono: "Source Code Pro", monospace;
}

*, *:before, *:after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

h1, h2, h3, h4, h5, h6, .site-title {
  font-family: var(--font-family-heading);
  font-weight: normal;
}

body {
  height: 100%;
  display: flex;
  flex-direction: column;
  font-family: var(--font-family-heading);
  margin: 0;
  padding: 0;
  color: var(--text-color);
  font-size: 16px;
  line-height: 1.4em;
}

.container {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  padding-left: 1em;
  padding-right: 1em;

  @media screen and (min-width: 576px) {
    max-width: 540px;
  }

  @media screen and (min-width: 768px) {
    max-width: 720px;
  }

  @media screen and (min-width: 992px) {
    max-width: 970px;
    padding: 0;
  }

  @media screen and (min-width: 1200px) {
    max-width: 1170px;
  }

  @media screen and (min-width: 1400px) {
    max-width: 1370px;
  }
}

.nav-wrapper {
  background-color: var(--primary-color);
  box-shadow: var(--box-shadow-subtle);
  position: sticky;
  top: 0;
  width: 100%;
}

nav {
  display: flex;
  line-height: 3em;
  height: 3em;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  .site-title {
    font-size: 1.5em;

    @media screen and (max-width: 650px) {
      font-size: 1em;
      line-height: 1em;
    }
  }
  .nav-links {
    display: flex;
    flex-direction: row;
    width: fit-content;

    a {
      padding: 0 1em;
    }
    a:hover {
      background-color: var(--accent);
    }
  }
  a {
    display: flex;
    text-decoration: none;
    color: var(--text-color);

    &:visited {
      color: var(--text-color);
    }
    &:hover {
      color: var(--text-color);
    }
  }
}

main {
  flex-shrink: 0;
  margin-bottom: 1em;
}

.page-header {
  border-bottom: 1px solid var(--accent);
  margin-bottom: 1em;
  padding-bottom: 0.5em;
  h1 {
    font-weight: normal;
  }
}

.post-summary {
  .title {
    h2 {
      font-weight: normal;
      margin-bottom: 0;
    }
  }
  .details {
    color: var(--text-light);
    margin-top: 0.25em;
    margin-bottom: 0;
  }
  .summary {
    margin: 0;
    padding-top: 0.25em;
  }
}

.alert {
  border-radius: 0.5em;
  margin: 1em;
  box-shadow: var(--box-shadow);
  .alert-header {
    padding: 0.25em 1em;
    margin: 0;
    background-color: var(--link-hover-color);
    color: white;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
    border-bottom: none;
  }
  .alert-body {
    padding: 0.5em 1em;
    border: 2px solid var(--accent);
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
    border-top: none;
  }
}

blockquote {
  margin: 0;
  margin-left: 1em;
  border-left: 2px solid var(--accent);
  padding-left: 1em;
  font-style: italic;
}

.highlight {
  position: relative;
}

code {
  font-family: var(--font-family-mono);

  &:not(pre *) {
    background-color: var(--code-background);
    padding: 0.15em;
    border-radius: 0.25em;
    display: inline-flex;
    line-height: 1;
  }
}

pre {
  padding: 0.5em 0.75em;
  border: 2px dashed var(--accent);
  margin: 0.5em;
  border-radius: 0.5em;
  overflow-x: scroll;
}

img {
  box-shadow: var(--box-shadow);
  border: 2px solid var(--accent);
}

figure > img {
  object-fit: scale-down;
  width: auto;
  height: auto;
  max-height: 500px;
  max-width: 100%;
}

figure > figcaption {
  font-style: italic;
  width: 100%;
  color: var(--text-light);
}

figure {
  max-width: 100%;
}

a {
  color: var(--link-color);
  &:visited {
    color: var(--link-color);
  }
  &:hover {
    color: var(--link-hover-color);
  }
}

button.copy-button {
  position: absolute;
  top: 0.5em;
  right: 1em;
  background: none;
  border: none;
  padding: 0;
  font-size: 1.25em;
  cursor: pointer;
  &.copy-success {
    color: green;
  }
}

footer {
  margin-top: auto;
  padding: 0.5em;
  background-color: var(--primary-color);

  a {
    color: var(--text-color);
    text-decoration: none;
    &:visited {
      color: var(--text-color);
    }
    &:hover {
      color: var(--text-color);
    }
  }

  .footer-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
