/*==============================
  Global Styles
==============================*/
html {
  overflow-y: scroll;
}

body {
  width: 100%;
  max-width: 800px;
  margin: 20px auto;
  padding: 0 16px;
  font: 1rem/1.5 monospace;
  color: var(--fontcolor);
  background: var(--bgcolor);
}

article {
  padding: 15px 0 0 0;
}

/* Links */
a:link {
  color: var(--linkcolor);
}
a:visited,
a:active {
  color: var(--visitedcolor);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  margin: 3px 0;
}

article img {
  width: 100%;
}

/*==============================
  Header
==============================*/
header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 10px;
  padding: 16px 0;
}

#brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

header hr {
  border: none;
  border-top: 2px solid rgba(0, 255, 0, 0.2);
  width: 80%;
  margin: 12px auto;
}

/*==============================
  Footer
==============================*/
footer {
  margin-top: 30px;
  text-align: center;
}

/*==============================
  Responsive
==============================*/
@media (max-width: 768px) {
  header {
    align-items: center;
    text-align: center;
  }

  #brand {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  #brand .icon {
    width: 60px;
  }

  header nav {
    flex-direction: row;
    gap: 4px;
  }

  .post-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

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

  pre {
    font-size: 0.9rem;
    overflow-x: auto;
  }
}

@media (min-width: 768px) {
  #root {
    margin-top: 25px;
  }

  #brand {
    flex-direction: row;
    text-align: unset;
  }

  #brand .text {
    margin-left: 10px;
  }

  #brand h1 {
    font-size: 35px;
  }

  #brand h3 {
    font-size: 25px;
  }
}

/*==============================
  Post & Navigation
==============================*/
#postsByDate {
  list-style: none;
}
#postsByDate .date {
  width: 60px;
}
#postsByDate div,
#postsInOneGroup div {
  display: inline-block;
}

#terms {
  list-style: none;
}

.post-nav {
  width: 100%;
  margin: 25px 0 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-nav-left {
  display: block;
}

.post-nav-right {
  display: block;
  text-align: right;
}

/*==============================
  Preformatted text
==============================*/
pre {
  white-space: pre-wrap;
  word-break: break-word;
}

/*==============================
  Footnotes
==============================*/
.footnotes hr {
  border-top: 1px dashed;
  margin: 15px 10%;
}

.footnote-ref {
  text-decoration: none;
}
.footnote-ref::before {
  content: '[';
}
.footnote-ref::after {
  content: ']';
}

.footnotes ol {
  margin: 0;
}

.footnotes p {
  line-height: normal;
  font: 1rem/1.5 monospace;
  padding: 0;
  margin: 0;
}

/*==============================
  Table of Contents / ASCII TOC
==============================*/
.asciitoc {
  font-family: inherit;
  white-space: pre;
  margin: 0.6em 0;
  padding: 0.3em;
  color: var(--asciitoc-color);
}
.asciitoc a {
  color: var(--asciitoc-color);
  text-decoration: none;
}
.asciitoc a:hover {
  text-decoration: underline;
}

/*==============================
  404 Error Page
==============================*/
.error-page {
  text-align: center;
  padding: 40px;
}

.error-image {
  max-width: 500px;
  width: 100%;
  margin-top: 20px;
  border-radius: 8px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/*==============================
  Article headings
==============================*/
article h1,
article h2,
article h3,
article h4,
article h5,
article h6 {
  color: var(--headingcolor);
  font-weight: bold;
}
