/* Blog styles - based on update.html styling */
/* Reset base styles from index.css that break the blog layout */
html, body {
  display: block;
  min-height: auto;
  justify-content: initial;
  align-items: initial;
  background: #fff;
  color: #333;
}
body {
  padding: 0;
}
/* Override the green heading styles from index.css */
h1, h3 {
  background: none;
  padding: 0;
  display: block;
  color: #222;
}
h2, h4 {
  color: #222;
}
a {
  color: #0066cc;
}
a:hover {
  color: #004499;
}
.blog-header {
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.blog-header .logo {
  position: static;
  top: auto;
  left: auto;
  width: auto;
  opacity: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  line-height: 0;
  z-index: auto;
  color: inherit;
}
.blog-header .logo img {
  height: 40px;
  width: auto;
  display: block;
  vertical-align: middle;
  margin: 0;
  max-width: none;
}
.blog-header nav {
  display: flex;
  align-items: center;
}
.blog-header nav a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: #555;
  font-size: 0.9rem;
}
.blog-header nav a:hover {
  color: #000;
}

/* Article content */
article {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}
.category {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #aad604;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
article h1 {
  font-size: 2.25rem;
  line-height: 1.2;
  margin: 0 0 1.25rem 0;
  color: #222;
  background: none;
  padding: 0;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e0e0e0;
}
.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #aad604, #7a9a00);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
}
.author-info {
  font-size: 0.9rem;
  line-height: 1.4;
}
.author-info .name {
  font-weight: 600;
  color: #333;
}
.author-info .meta {
  color: #666;
}

/* Markdown content styling */
.post-content p {
  font-size: 1.125rem;
  line-height: 1.8;
  margin: 0 0 1.5rem 0;
  color: #444;
}
.post-content h2 {
  font-size: 1.35rem;
  margin: 2.5rem 0 1rem 0;
  color: #222;
  background: none;
  padding: 0;
  line-height: 1.4;
}
.post-content h3 {
  font-size: 1.15rem;
  margin: 2rem 0 0.75rem 0;
  color: #222;
}
.post-content ul, .post-content ol {
  font-size: 1.125rem;
  line-height: 1.8;
  margin: 0 0 1.5rem 0;
  color: #444;
  padding-left: 1.5rem;
}
.post-content li {
  margin-bottom: 0.5rem;
}
.post-content blockquote {
  background: #f8f9fa;
  border-left: 4px solid #aad604;
  padding: 1rem 1.25rem;
  margin: 2rem 0;
  font-style: italic;
}
.post-content blockquote p {
  margin: 0;
}
.post-content code {
  background: #f4f4f4;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
.post-content pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 0.85rem;
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.post-content th, .post-content td {
  border: 1px solid #e0e0e0;
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.post-content th {
  background: #f5f5f5;
  font-weight: 600;
}
.post-content strong {
  font-weight: 600;
}
.post-content hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 2rem 0;
}

/* Lede and TL;DR styling */
.lede, .post-content > p:first-child {
  font-size: 1.25rem;
  font-weight: 500;
  color: #333;
}
.tldr {
  background: #f8f9fa;
  border-left: 4px solid #aad604;
  padding: 1rem 1.25rem;
  margin: 2rem 0;
  font-style: italic;
}
.tldr em {
  font-style: normal;
  font-weight: 600;
}

/* Post footer */
.post-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e0e0e0;
}
.post-footer .cta {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}
.post-footer .cta p {
  margin: 0;
  font-size: 1rem;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tags span {
  font-size: 0.8rem;
  color: #666;
  background: #eee;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
}
.share-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: #999;
}

/* Blog index page */
.blog-index {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}
.blog-index h1 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #222;
}
.blog-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.blog-list-item {
  border-bottom: 1px solid #e0e0e0;
  padding: 1.5rem 0;
}
.blog-list-item:first-child {
  padding-top: 0;
}
.blog-list-item:last-child {
  border-bottom: none;
}
.blog-list-item .category {
  margin-bottom: 0.5rem;
}
.blog-list-item h2 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}
.blog-list-item h2 a {
  color: #222;
  text-decoration: none;
}
.blog-list-item h2 a:hover {
  color: #0066cc;
}
.blog-list-item .excerpt {
  font-size: 1rem;
  color: #666;
  margin: 0 0 0.75rem 0;
  line-height: 1.6;
}
.blog-list-item .post-meta {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 0.85rem;
  color: #999;
}
.blog-list-item .tags {
  margin-top: 0.75rem;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  html, body {
    background: #1a1a1a;
    color: #ddd;
  }
  h1, h2, h3, h4 {
    color: #eee;
  }
  a {
    color: #6cb3ff;
  }
  a:hover {
    color: #99ccff;
  }
  .blog-header {
    background: #111;
    border-color: #333;
  }
  .blog-header nav a {
    color: #aaa;
  }
  .blog-header nav a:hover {
    color: #fff;
  }
  .category {
    color: #c4e830;
  }
  article h1, article h2, .blog-index h1 {
    color: #eee;
  }
  .post-content p, .post-content ul, .post-content ol {
    color: #bbb;
  }
  .post-content h2, .post-content h3 {
    color: #eee;
  }
  .lede, .post-content > p:first-child {
    color: #ddd;
  }
  .tldr, .post-content blockquote {
    background: #2a2a2a;
    color: #ccc;
  }
  .post-meta, .post-footer, .blog-list-item {
    border-color: #444;
  }
  .author-info .name {
    color: #eee;
  }
  .author-info .meta {
    color: #999;
  }
  .post-footer .cta {
    background: #2a2a2a;
  }
  .post-footer .cta p {
    color: #ccc;
  }
  .tags span {
    background: #333;
    color: #aaa;
  }
  .share-row {
    color: #777;
  }
  .post-content code {
    background: #333;
    color: #f8f8f2;
  }
  .post-content th {
    background: #2a2a2a;
  }
  .post-content th, .post-content td {
    border-color: #444;
  }
  .blog-list-item h2 a {
    color: #eee;
  }
  .blog-list-item h2 a:hover {
    color: #6cb3ff;
  }
  .blog-list-item .excerpt {
    color: #999;
  }
}
@media (max-width: 600px) {
  article h1, .blog-index h1 {
    font-size: 1.75rem;
  }
  article, .blog-index {
    padding: 2rem 1rem;
  }
  .blog-list-item h2 {
    font-size: 1.25rem;
  }
}
