@media (prefers-color-scheme: light) {
  body {
    --body: #333739;
    --background: #fffffe;
    --header-dot: #e10f0f;
    --header: #1e2426;
    --topic-header: #e10f0f;
    --entry-tag-bg: #e9ebeb;
    --entry-tag-fg: #0e1e24;
    --seperation-border: #e1e1e1;
    --entry-text-link: #217fb0;
    --entry-source: #5c7080;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    --body: #e6e6e6;
    --background: #202122;
    --header-dot: #f45757;
    --header: #eaecf0;
    --topic-header: #f45757;
    --entry-tag-bg: #3d4343;
    --entry-tag-fg: #e6e6e6;
    --seperation-border: #3e4042;
    --entry-text-link: #69b8e2;
    --entry-source: #a6b4bf;
  }
}

body {
  max-width: 800px;
  margin: auto;
  font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir,
    helvetica neue, helvetica, Ubuntu, roboto, noto, segoe ui, arial, sans-serif;
  line-height: 1.3;
  color: var(--body);
  background: var(--background);
}

header {
  text-align: center;

  h1 {
    font-size: 50px;
    font-weight: 900;
    letter-spacing: 1px;

    .header-dot {
      color: var(--header-dot);
    }
  }
}

h1,
h2,
h3,
h4,
h5 {
  color: var(--header);
}

a {
  color: inherit;
}

main {
  padding: 0 10px;

  .day-header {
    font-size: 30px;
  }

  .topic-header {
    font-size: 20px;
    font-weight: initial;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    color: var(--topic-header);
  }

  .topic {
    margin-bottom: 40px;
  }

  .entry-tag {
    display: inline-block;
    margin-top: 10px;
    margin-right: 5px;
    padding: 5px 10px;
    background: var(--entry-tag-bg);
    border-radius: 5px;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    color: var(--entry-tag-fg);
    white-space: pre-line;
  }

  .entry {
    display: flex;
    margin-top: 20px;
    padding-bottom: 20px;

    div:first-child {
      flex-grow: 1;
    }

    &:not(:last-child) {
      border-bottom: 1px solid var(--seperation-border);
    }

    .entry-part-link {
      text-decoration: none;
    }

    &:hover {
      .entry-part-link {
        color: var(--entry-text-link);

        &:focus,
        &:hover {
          text-decoration: underline;
        }
      }
    }

    .entry-url {
      margin-top: 10px;
      font-size: 14px;
      color: var(--entry-source);
    }

    .entry-img-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: start;
      margin-left: 20px;

      .entry-img {
        width: 250px;
        border-radius: 3px;
      }
    }
  }
}

footer {
  margin-bottom: 40px;
  padding: 10px;
  font-size: 12px;
  font-style: italic;
}

@media only screen and (max-width: 600px) {
  header {
    h1 {
      font-size: 40px;
    }
  }

  main {
    .day-header {
      font-size: 25px;
      line-height: 40px;
    }

    .topic-header {
      font-size: 18px;
    }

    .topic {
      margin-bottom: 20px;
    }

    .entry {
      flex-direction: column-reverse;

      .entry-part-link {
        pointer-events: none;
        touch-action: none;

        &:focus,
        &:hover {
          text-decoration: none;
        }
      }

      &:hover {
        .entry-part-link {
          touch-action: initial;
          pointer-events: initial;
          color: var(--entry-text-link);

          &:focus,
          &:hover {
            text-decoration: underline;
          }
        }
      }

      .entry-img-container {
        margin-left: 0;
        margin-bottom: 5px;

        .entry-img {
          width: 100%;
        }
      }
    }
  }
}
