/* ===========================================================================
   blog.css — styles for the /blog/ section.
   Reuses the tokens from style.css (:root vars) so the blog matches the site.
   =========================================================================== */

/* ---------- Blog index (listing) ---------- */
.blog-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.blog-entry {
  display: grid;
  grid-template-columns: 120px 1fr;
  column-gap: 1.5rem;
  padding: 1.1rem 0 1.2rem;
  border-bottom: 1px solid var(--color-border);
}
.blog-entry:last-child { border-bottom: none; }
.blog-date {
  font-family: var(--font-serif);
  color: var(--color-accent);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  padding-top: 0.15rem;
  white-space: nowrap;
}
.blog-entry-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
}
.blog-entry-title a { color: var(--color-text); }
.blog-entry-title a:hover { color: var(--color-accent); text-decoration: none; }
.blog-excerpt {
  margin: 0;
  color: var(--color-text-soft);
  font-size: 0.95rem;
  line-height: 1.6;
}
.blog-tags { margin: 0.5rem 0 0; }
.blog-tag {
  display: inline-block;
  font-size: 0.72rem;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  margin: 0.25rem 0.25rem 0 0;
  font-weight: 500;
  letter-spacing: 0.02em;
}

@media (max-width: 560px) {
  .blog-entry { grid-template-columns: 1fr; row-gap: 0.25rem; }
  .blog-date { padding-top: 0; }
}

/* ---------- Single post ---------- */
.post {
  padding-top: 1.75rem;
  padding-bottom: 1.5rem;
}
.post-header {
  max-width: 760px;
  margin: 0 auto 1.5rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--color-border);
}
.post-back { margin: 0 0 0.75rem; font-size: 0.88rem; }
.post-title {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.55rem;
}
.post-meta {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.post-meta time { font-variant-numeric: tabular-nums; }

/* Constrained, readable measure (~68 chars) */
.post-content {
  max-width: 760px;
  margin: 0 auto;
  font-size: 1.06rem;
  line-height: 1.75;
  color: var(--color-text-soft);
}
.post-content > p:first-child { margin-top: 0; }
.post-content p { margin: 0 0 1.15rem; }
.post-content h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text);
  margin: 2.2rem 0 0.75rem;
}
.post-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 1.8rem 0 0.6rem;
}
.post-content a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.post-content ul,
.post-content ol { margin: 0 0 1.15rem; padding-left: 1.4rem; }
.post-content li { margin-bottom: 0.4rem; }
.post-content hr { border: none; border-top: 1px solid var(--color-border); margin: 2rem 0; }

/* Blockquote */
.post-content blockquote {
  margin: 1.5rem 0;
  padding: 0.6rem 1.1rem;
  border-left: 3px solid var(--color-accent);
  background: rgba(0, 0, 0, 0.025);
  color: var(--color-text);
  border-radius: 2px;
}
.post-content blockquote p:last-child { margin-bottom: 0; }

/* Images & figures */
.post-content img { max-width: 100%; height: auto; }
.post-figure {
  margin: 1.75rem 0;
  text-align: center;
}
.post-figure img {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.post-figure figcaption {
  margin-top: 0.55rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.5;
}

/* Responsive video (16:9) */
.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  margin: 1.75rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: #000;
}
.video-embed iframe,
.video-embed video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Tables */
.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 var(--color-border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.post-content th { background: var(--color-surface); font-weight: 600; color: var(--color-text); }

/* Inline + block code */
.post-content code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}
.post-content pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.5;
}
.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.86rem;
}

.post-footer {
  max-width: 760px;
  margin: 2.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.92rem;
}
.post-footer p { margin: 0 0 0.4rem; }

@media (max-width: 600px) {
  .post-title { font-size: 1.7rem; }
  .post-content { font-size: 1.02rem; }
}

/* ---------- Rouge syntax highlighting (GitHub-light palette) ---------- */
.highlight .c, .highlight .cm, .highlight .c1, .highlight .cs { color: #6a737d; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt { color: #d73a49; }
.highlight .o, .highlight .ow { color: #d73a49; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr { color: #032f62; }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .il { color: #005cc5; }
.highlight .n, .highlight .nn, .highlight .nx { color: #24292e; }
.highlight .nb, .highlight .bp { color: #005cc5; }
.highlight .nf, .highlight .nd { color: #6f42c1; }
.highlight .nc, .highlight .ne, .highlight .nl { color: #6f42c1; }
.highlight .na { color: #005cc5; }
.highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi { color: #e36209; }
.highlight .gd { color: #b31d28; background-color: #ffeef0; }
.highlight .gi { color: #22863a; background-color: #f0fff4; }
.highlight .gh { color: #005cc5; font-weight: 600; }
.highlight .p { color: #24292e; }
