:root {
  --bg: #fdf6e3;
  --text: #073642;
  --heading: #586e75;
  --link: #268bd2;
  --rule: #93a1a1;
  --muted: #839496;
  --card: #eee8d5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #002b36;
    --text: #93a1a1;
    --heading: #eee8d5;
    --link: #4aa3e0;
    --rule: #586e75;
    --muted: #657b83;
    --card: #073642;
  }
  img.header {
    filter: invert(0.92);
  }
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: monospace;
  max-width: 640px;
  margin: 40px auto;
  padding: 0 20px 40px 20px;
  line-height: 1.6;
}
h1, h2, h3 {
  color: var(--heading);
  line-height: 1.3;
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 30px 0;
}
img.header {
  width: 50%;
  height: auto;
  display: block;
  margin-bottom: 20px;
}
.meta {
  color: var(--muted);
}

/* Post content */
article img,
article video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px 0;
}
article pre {
  background: var(--card);
  padding: 12px;
  overflow-x: auto;
}
article blockquote {
  margin: 20px 0;
  padding-left: 16px;
  border-left: 3px solid var(--rule);
}

/* Link preview card */
a.link-preview {
  display: flex;
  gap: 14px;
  margin: 20px 0;
  padding: 12px;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--text);
}
a.link-preview:hover {
  text-decoration: none;
  border-color: var(--link);
}
a.link-preview img {
  width: 140px;
  height: 90px;
  object-fit: cover;
  margin: 0;
  flex-shrink: 0;
}
.link-preview-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.link-preview-text small {
  color: var(--muted);
}
@media (max-width: 480px) {
  a.link-preview {
    flex-direction: column;
  }
  a.link-preview img {
    width: 100%;
    height: auto;
  }
}

/* Share button */
#share {
  font: inherit;
  color: var(--bg);
  background: var(--link);
  border: none;
  padding: 8px 16px;
  cursor: pointer;
}
#share:hover {
  opacity: 0.85;
}

/* Blog overview */
.post-list {
  list-style: none;
  padding: 0;
}
.post-list li {
  margin-bottom: 30px;
}
.post-list time {
  display: block;
  color: var(--muted);
}
.post-list a {
  font-size: 1.2em;
  font-weight: bold;
}
.post-list p {
  margin: 4px 0 0 0;
}
