/* CSS Variables for theming */
@media (prefers-color-scheme: light) {
  :root {
    --bg-color: #f4f4f4;
    --text-color: #24292f;
    --link-color: #005cc5;
    --visited: #6f42c1;
    --hover: #c11e7a;
    --grey: #ccc;
    --grey-light: #6a708e;
    --white-dark: #6c6a6a;
    --code: #52576f;
    --pre: #e1e7ee;
    --blockquote: #005cc5;
    --blockquote-bg: #cfe0f4;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #3d434f;
    --text-color: #f2f2f2;
    --link-color: #7dd3e8;
    --visited: #7dd3e8;
    --hover: #a0e7f5;
    --grey: #4a5260;
    --grey-light: #8a8e9b;
    --white-dark: #e8e8e8;
    --code: #4a5260;
    --pre: #2d3139;
    --blockquote: #7dd3e8;
    --blockquote-bg: #4a5260;
  }
}

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

html {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-size: 16px;
  line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  max-width: 720px;
  padding: 1rem 1rem 0;
}

h1, h2, h3 {
  font-weight: bold;
  margin: 0;
  padding: 0.5rem 0 0 0;
  /*text-transform: uppercase;*/
}

h1 {
  font-size: 1.3rem;
  line-height: 1.3;
}

h2 {
  font-size: 1.15rem;
  line-height: 1.3;
  margin-bottom: 0;
  margin-top: 0;
}

h3 {
  font-size: 1rem;
  color: var(--white-dark);
}

a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover,
a:visited:hover {
  text-decoration: underline;
  color: var(--hover);
}

a:visited {
  color: var(--visited);
}

p {
  margin: 0.5rem 0;
}

main > section p {
  margin: 0.5rem 0;
}

main > section p:last-child {
  margin-bottom: 0;
}

hr {
  color: inherit;
  border: 0;
  height: 1px;
  background: var(--grey);
  margin: 1.5rem auto;
  opacity: 0.5;
}

.wrapper {
  max-width: 720px;
  margin: 0 auto;
}

.site-header {
  text-align: center;
  margin: 1.5rem auto 1rem;
}

.site-header nav {
  margin: 1rem 0 0;
  line-height: 1.8;
}

.site-header nav a {
  margin: 0;
  padding: 0;
  font-size: 1rem;
  text-transform: none;
}

.site-title h1 {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0 0 0.25rem 0;
  /*text-transform: uppercase;*/
  letter-spacing: 0.05em;
  font-family: monospace;
}

.site-subtitle {
  font-size: 1.1rem;
  color: var(--text-color);
  margin: 0;
  font-weight: normal;
}

ul.index {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.index li {
  margin: 0;
  display: flex;
  align-items: center;
}

.index time {
  width: 110px;
  font-size: 0.875rem;
}

.index .post-title {
  font-size: 1.15rem;
  flex: 1;
  margin: 0;
  text-transform: none;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 90%;
  border: 2px solid var(--code);
  border-radius: 0.3rem;
  padding: 0.1rem 0.3rem;
}

pre {
  font-size: 14px;
  border-radius: 5px;
  padding: 1rem;
  margin: 1rem 0;
  overflow-x: auto;
  background-color: var(--pre) !important;
}

pre code {
  background-color: inherit;
  padding: 0;
  border: none;
  white-space: pre-wrap;
}

blockquote {
  border-left: 5px solid var(--blockquote);
  background-color: var(--blockquote-bg);
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0;
}

ul, ol {
  padding: 0 0 0 1rem;
  list-style-position: outside;
}

li {
  margin: 0.5rem 0;
}

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

table {
  display: block;
  max-width: fit-content;
  margin: 0 auto;
  overflow-x: auto;
  white-space: nowrap;
  border-spacing: 10px;
  border-collapse: separate;
}

footer {
  text-align: center;
  margin-top: 3rem;
  margin-bottom: 0;
  padding-top: 2rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--grey);
}

.footer {
  text-align: center;
}

.footer p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.screenshot {
  border: 2px solid var(--grey);
  border-radius: 5px;
}

.text-center {
  text-align: center;
}

section {
  margin-bottom: 1.5rem;
}

section:last-child {
  margin-bottom: 0;
}

main section:first-of-type {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

article {
  overflow-wrap: break-word;
}

@media only screen and (max-width: 40em) {
  body {
    padding: 0 0.5rem;
  }

  .site-header {
    margin: 1rem auto;
  }

  header {
    margin: 0;
  }

  main > h1 {
    padding-top: 0.5rem;
  }

  .index time {
    width: 90px;
  }
}
