/*
 * Blog readability: overreacted.io / jvns.ca inspired.
 * Only applied when body.blog-page (blog index and post pages).
 * Keeps the rest of the site (home, contact, etc.) unchanged.
 */

/* Readable font and constrained width for all blog views */
.blog-page .content-section {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

/* ----- Blog index (list of posts) ----- */
.blog-page .blog-intro {
  color: #444;
  font-size: 1rem;
  margin-bottom: 2rem;
}

.blog-page .post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-page .post-list li {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}

.blog-page .post-list li:last-child {
  border-bottom: none;
}

.blog-page .post-list a {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
  display: inline-block;
  margin-bottom: 0.35rem;
}

.blog-page .post-date {
  display: block;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.blog-page .post-series {
  display: block;
  font-size: 0.9rem;
  color: #555;
  font-weight: normal;
  margin-bottom: 0.25rem;
}

.blog-page .post-tags {
  margin-top: 0.5rem;
}

.blog-page .post-tags .tag {
  font-family: inherit;
  font-size: 0.8rem;
  margin-right: 0.35rem;
  margin-bottom: 0.25rem;
}

/* ----- Single post (article) ----- */
.blog-page .post {
  max-width: 720px;
  margin: 0 auto;
}

.blog-page .post > h1 {
  font-family: inherit;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.blog-page .post-meta {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.blog-page .post-content {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: #222;
}

.blog-page .post-content p {
  margin-bottom: 1.25em;
}

.blog-page .post-content h2 {
  font-family: inherit;
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 0.75em;
  padding-bottom: 0.25em;
}

.blog-page .post-content h3 {
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.blog-page .post-content ul,
.blog-page .post-content ol {
  margin-bottom: 1.25em;
  padding-left: 1.5em;
}

.blog-page .post-content li {
  margin-bottom: 0.4em;
}

.blog-page .post-content hr {
  margin: 2em 0;
  border: none;
  border-top: 1px solid #ddd;
}

.blog-page .post-content code {
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  background: #f5f5f5;
  border-radius: 4px;
  font-family: ui-monospace, "JetBrains Mono", monospace;
}

.blog-page .post-content pre {
  overflow-x: auto;
  padding: 1rem;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.25em;
}

.blog-page .post-content pre code {
  padding: 0;
  background: none;
}

/* Mermaid diagrams */
.blog-page .post-content .mermaid {
  margin: 1.5rem 0;
  text-align: center;
}

.blog-page .post-content .mermaid svg {
  max-width: 100%;
  height: auto;
}

/* ----- Series navigation ----- */
.blog-page .series-nav {
  font-family: inherit;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
}

.blog-page .series-nav-heading {
  font-size: 0.9rem;
  font-weight: 600;
  color: #495057;
  margin: 0 0 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.blog-page .series-parts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid #e9ecef;
  padding-top: 0.75rem;
}

.blog-page .series-part-item {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.blog-page .series-part-item:last-child {
  margin-bottom: 0;
}

.blog-page .series-part-item a {
  text-decoration: none;
  color: #0066cc;
  display: block;
  padding: 0.35rem 0;
  border-radius: 4px;
}

.blog-page .series-part-item a:hover {
  color: #004499;
  background: #e9ecef;
}

.blog-page .series-part-label {
  font-weight: 600;
  color: #495057;
  margin-right: 0.35rem;
}

.blog-page .series-part-current .series-part-label,
.blog-page .series-part-current .series-part-title {
  color: #212529;
  font-weight: 600;
}

.blog-page .series-part-current {
  padding: 0.35rem 0;
}

/* Prev/Next row: two clear buttons */
.blog-page .series-prevnext-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
}

.blog-page .series-prevnext-link {
  font-size: 0.9rem;
  text-decoration: none;
  color: #0066cc;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  background: #fff;
}

.blog-page .series-prevnext-link:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  color: #004499;
}

.blog-page .series-prevnext-disabled {
  color: #adb5bd;
  border-color: #e9ecef;
  background: #f8f9fa;
  cursor: default;
}

.blog-page .series-next {
  margin-left: auto;
}

@media (max-width: 768px) {
  .blog-page .content-section,
  .blog-page .post,
  .blog-page .post-content {
    max-width: 100%;
    padding: 0 0.5rem;
  }

  .blog-page .post-list a {
    font-size: 1.2rem;
  }
}
