html,
body {
  height: 100vh;
  margin: 0;
  padding: 0;
}

html {
  font-size: 20px;
}

body {
  background-color: #232425;
  color: #d2d2da;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding: 0;
  margin: 0;
  height: 100vh;
  container-type: size;
}

a {
  color: #a9a9b3;

  &:visited {
    color: #a9a9b3;
  }
}

body>nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem 2rem 1rem 2rem;
  align-items: end;

  box-shadow: -10px 0px 50px inset black;

  &>a {
    display: block;
    position: relative;

    &:first-child {
      font-size: 1.5rem;
      padding-left: 2.5rem;

      &::before {
        content: "🍳";
        font-size: 1.5rem;
        position: absolute;
        left: 0;
      }
    }
  }
}

body>main {
  flex: 1;
  padding: 3rem;
  overflow-y: auto;
  position: relative;
}

@media (min-width: 981px) {
  body>main {
    margin-right: auto;
    max-width: 50em;
  }
}

@media (max-width: 980px) {
  body {
    flex-direction: column;
  }

  body>nav {
    flex-direction: row;
    padding: 1rem 2rem 1rem 2rem;
    box-shadow: 0px -10px 50px inset black;
  }

  body>nav>a:first-child {
    font-size: inherit;
  }

}

body>main>h1:first-child {
  margin-top: 0;
  padding-bottom: 0.5em;
  border-bottom: 1px solid silver;
}

main>aside {
  position: absolute;
  right: 2rem;
  top: 1rem;
  font-size: 0.5rem;

  .timestamps {
    margin: 0;
  }
}

main>.links {
  margin: 0;
  padding: 0;
}

main p,
main ul {
  line-height: 1.75em;
}

main h1,
main h2,
main h3,
main h4,
main h5,
main h6 {
  &>a:first-child[href^="#"] {
    text-decoration: none;
  }
}

main pre {
  box-shadow: 0 0 0.5em inset black;
  padding: 1em;
  overflow-x: auto;
}

/*
When rendering markdown, triple-backtick blocks are rendered as `pre` tag with
a `code` tag inside, but we want to apply this styling only to inline `code`
texts, hence the `:not()`
*/
main code:not(pre > code) {
  background-color: #161616;
  color: #f1f1f1;
  padding: 2px;
  border: 1px solid #3a3a3a;
}

main .links {
  .link {
    display: grid;
    grid-template-columns: 64px auto min-content;
    grid-template-rows: min-content 1fr;
    gap: 1em 1em;
    grid-template-areas:
      "favicon-start title thumbnail-start"
      "favicon-end description thumbnail-end";
    margin-bottom: 1em;
    padding: 1em;

    .title {
      grid-area: title;
      display: flex;
      flex-direction: row;
      gap: 0.5em;

      .feed-link {
        text-decoration: none;
      }
    }

    .favicon {
      grid-row-start: favicon-start;
      grid-row-end: favicon-end;
      grid-column-start: favicon-start;
      grid-column-end: favicon-end;
      width: 100%;
    }

    .description {
      grid-area: description;
      margin: 0;
    }

    .thumbnail {
      grid-row-start: thumbnail-start;
      grid-row-end: thumbnail-end;
      grid-column-start: thumbnail-start;
      grid-column-end: thumbnail-end;
      max-width: 10em;
    }
  }
}