/* Settings */
:root {
  --color-dark: #59D99D;
  --color-light: #0C0200;
  --color-primary: #0C0200;
  --spacing: 1.5rem;
  --font-stack: "Verdana", "Satoshi", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --max-width: 1600px;
}

/* Dark mode settings */
@media (prefers-color-scheme: dark) {
  :root {
    --color-dark: #59D99D;
    --color-light: #0C0200;
  }
}

/* Basic styles */
body {
  background: var(--color-light);
  color: var(--color-dark);
  padding: 5vw;
  font-family: var(--font-stack);
  font-size: 1rem;
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--spacing) * 2);
  min-height: 100vh;
  max-width: var(--max-width);
  margin: 0 auto;
}

* {
  box-sizing: border-box;
}

header,
main,
footer {
  max-width: 60ch;
  margin-inline: auto;
  width: 100%;
}

/* Header styles */
header {
  padding-bottom: var(--spacing);
  flex-basis: 8rem;
  flex-grow: 1;
}

/* Main content styles */
main {
  flex-basis: 0;
  flex-grow: 999;
  padding-bottom: calc(var(--spacing) * 2);
  flex-basis: 20rem;
}

/* Footer styles */
footer {
  min-width: 100%;
  flex-basis: 0;
  flex-grow: 1;
  padding-top: var(--spacing);
}

/* Link styles */
a {
  color: currentColor;
  text-decoration-color: var(--color-primary);
  text-decoration-thickness: 0.2ex;
  text-underline-offset: 0.3ex;
}

a:hover {
  text-decoration-thickness: 0.3ex;
}

/* Image styles */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Heading styles */
h1,
h2,
h3,
h4,
h5 {
  font-weight: 0.5;
  line-height: 0.1;
  text-wrap: balance;
color: var(--color-light);
}

/* Adjustments for different heading levels */
h1 {
  font-size: 1.5rem;
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.5rem;
}
h4 {
  font-size: 1.5rem;
}
h5 {
  font-size: 1rem;
}

/* List styles */
ul,
ol {
  padding-inline-start: var(--spacing);
}
li {
  margin-block-start: var(--spacing);
}

/* Blockquote styles */
blockquote {
  padding-inline-start: var(--spacing);
  border-inline-start: 0.3em solid;
  font-style: italic;
  font-size: 1.5rem;
}

/* Flow and rhythm */
:is(h1, h2, h3, h4, h5, blockquote) {
  margin-block-end: calc(var(--spacing) / 2);
}
:is(h1, h2, h3, h4, h5) + * {
  margin-block-start: calc(var(--spacing) / 3);
}
:is(h1, h2, h3, h4, h5) + :where(h2, h3, h4, h5) {
  margin-block-start: calc(var(--spacing) * 2);
}

/* Line lengths */
blockquote {
  max-width: 50ch;
}
h1 {
  max-width: 24ch;
}
h2,
h3 {
  max-width: 32ch;
}

/* Bear Content */
.title {
  text-decoration: none;
}
.title h1 {
  font-size: 2rem;
  margin-top: calc(var(--spacing) / 2);
}
nav {
  position: sticky;
  top: var(--spacing);
}
nav p {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--spacing);
  row-gap: 0;
}

@media screen and (min-width: 1000px) {
  nav p {
    flex-direction: column;
  }
}

ul.blog-posts {
  list-style-type: none;
  padding: unset;
}
ul.blog-posts li {
  display: flex;
  flex-direction: column;
}
@media screen and (min-width: 600px) {
  ul.blog-posts li {
    flex-direction: row;
    gap: calc(var(--spacing) / 2);
  }
}
ul.blog-posts li span {
  min-width: 11ch;
}
time {
  opacity: 0.5;
  font-style: normal;
}
.highlight,
.code {
  padding: 1px var(--spacing);
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  overflow-x: auto;
  line-height: 1.2;
}
table {
  width: 100%;
}
th {
  text-align: left;
}

hr {
  border-color: rgba(0, 0, 0, 0.1);
}