/* Kudos:
   https://www.robinrendle.com/notes/the-smallest-css/
   https://bt.ht/safari-default-dark-mode/
   https://github.com/csstools/normalize.css
*/

body {
  padding-left: 1rem;
  padding-right: 1rem;
  padding-bottom: 2rem;
  margin-left: auto;
  margin-right: auto;
  max-width: 70ch;
  font: 107.5%/1.5 sans-serif;
}

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

/* Fix for WebKit */
@supports (color-scheme: dark light) {
  @media screen and (prefers-color-scheme: dark) {
    a:link {
      color: #9e9eff;
    }
    a:visited {
      color: #d0adf0;
    }
    a:active {
      color: red;
    }
  }
}

/**
 * From: https://github.com/csstools/normalize.css/blob/main/opinionated.css
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */
:where(code, kbd, samp, pre) {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

/* Direct Links / Markdown Headers */
.direct-link {
  font-family: sans-serif;
  text-decoration: none;
  font-style: normal;
  margin-left: 0.1em;
}
a[href].direct-link,
a[href].direct-link:visited {
  color: transparent;
}
a[href].direct-link:focus,
a[href].direct-link:focus:visited,
:hover > a[href].direct-link,
:hover > a[href].direct-link:visited {
  color: #aaa;
}

/* Unfck default styles */

@media screen and (max-width: 42em) {
  figure {
    margin-left: 0;
    margin-right: 0;
  }
}

/* Embeds */

iframe {
  max-width: 100%;
}

.embed-codesandbox > iframe {
  width: 100%;
  height: 500px;
}

/* Vanity styles */

ins {
  text-decoration: none;
  font-style: italic;
}

figure {
  margin-top: 2em;
  margin-bottom: 2em;
}
figcaption {
  font-style: italic;
}
figcaption p {
  margin-top: 0.5rem;
}

.figquote {
  margin: 2em 0;
}
blockquote {
  border-left: solid medium;
  margin: 0;
  padding: 0 1.5em;
}

.site-footer {
  margin-top: 3rem;
}

.site-nav > * {
  margin-right: 1rem;
}

.postlist {
  padding: 0;
}
.postlist-item {
  list-style: none;
  margin-bottom: 2rem;
}

.post-header {
  margin-bottom: 2rem;
}

.post-footer {
  margin-top: 2rem;
}

/** Code **/
pre {
  border: solid thin;
  padding: 0.5em;
  overflow-x: auto;
}

code {
  tab-size: 4;
}
