@import "code-light.css" (prefers-color-scheme: light);
@import "code-dark.css" (prefers-color-scheme: dark);

:root {
  --flex-gap: 1rem;

  /* https://getbootstrap.com/docs/5.0/layout/breakpoints/ */
  --breakpoint-medium: 768px;
  --breakpoint-large: 992px;
}

@media (prefers-color-scheme: light) {
    :root {
        --background: #FFFFFF;
        --background-dim: #f5f7f9;

        --foreground: #2B303A;
        --foreground-dim: #576379;
        --foreground-heavy: #191C22;

        --primary-color: #EB5160;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: #274060;
        --background-dim: #243958;

        --foreground: #f0f2f3;
        --foreground-dim: #d5d5d5;
        --foreground-heavy: #f2f4f5;

        --primary-color: #DA4162;
    }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  font-family: sans-serif;
}

body {
  margin: 0 auto;
  max-width: 50rem;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  padding: 0rem 0.5rem;
}

aside {
    font-size: smaller;
    font-style: italic;
    color: var(--foreground-dim);
}

img {
    max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6,
strong {
    color: var(--foreground-heavy);
}

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

h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
    text-decoration: none;
}

h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover {
    text-decoration: underline;
}

nav ul {
  list-style: none;
}

nav li {
  display: inline;
}

nav li + li:before {
  content: " · ";
  margin: 0 0.5ex;
}

.article-list {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: var(--flex-gap);
  flex-wrap: wrap;
  margin: 1rem 0;
}

.article-list > article {
  flex-basis: calc(100% - var(--flex-gap));
  border: 1px solid var(--foreground);
  border-radius: 5px;
}

@media (min-width: 768px) {
  .article-list > article {
    flex-basis: calc(50% - var(--flex-gap));
  }
}

article {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

article header {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    /* margin: 1rem 0; */
}

article header time {
    white-space: nowrap;
    color: var(--foreground-dim);
    font-style: italic;
}

article header h2,
article header p {
    font-size: 1rem;
    display: inline;
}

code,
pre {
  background: var(--background-dim);
  border-radius: 0.3rem;
  font-family: monospace;
}

pre {
  padding: 1rem;
  border-left: 2px solid var(--primary-color);
  overflow: auto;
}

code {
  padding: 0.1rem 0.2rem;
}

/* reset the padding for code inside pre */
pre code {
  padding: 0;
}

blockquote {
  background: var(--background-dim);
  border-radius: 0 0.3rem 0.3rem 0;
  font-style: italic;
  border-left: 2px solid var(--primary-color);
  margin: 0;
  padding: 1rem;
}

/* reset the margin for p inside blockquotes */
blockquote p {
  margin: 0;
}

body > header {
  top: 0;
  position: sticky;
  border-bottom: 1px solid var(--foreground-heavy);
  background: var(--background);
  box-shadow: 0px 10px 10px -13px var(--foreground-heavy);
}

body footer {
  margin: 3rem 0;
  color: var(--foreground-dim);
  font-size: smaller;
  text-align: center;
}

header nav {
   display: flex;
   flex-direction: row;
   justify-content: space-between;
   align-items: center;
}

header h1 {
  margin: 0 auto;
  color: var(--primary-color);
}

header h2 {
  display: inline;
  font-size: 1.2rem;
}

/*
- https://picsvg.com/
- https://stackoverflow.com/a/65147574
*/
header svg {
  width: 80px;
  height: 80px;
}
