/* ============================================
   Blog page specifics
   ============================================ */

/* Allow scrolling on blog pages */
body.blog-page {
  overflow-y: auto;
  overflow-x: hidden;
  height: auto;
  min-height: 100vh;
}

body.blog-page #ascii-canvas {
  height: 35vh;
  bottom: 0;
}

/* Reading progress bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.08s linear;
  box-shadow: 0 0 8px var(--accent);
}

/* Main blog area */
.blog-main {
  position: relative;
  z-index: 2;
  padding: clamp(80px, 14vh, 140px) clamp(28px, 8vw, 140px) 50vh;
  min-height: 100vh;
}

.blog-container,
.post-container {
  max-width: 720px;
  width: 100%;
}

.post-container {
  max-width: 680px;
}

.blog-h1 {
  font-size: clamp(2.5rem, 4.5vw, 3.6rem);
  font-weight: 200;
  letter-spacing: -0.04em;
  line-height: 1.0;
  margin-bottom: 0.4em;
  color: var(--fg);
}

.blog-sub {
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 3em;
}

body.light .blog-sub { color: rgba(0, 0, 0, 0.55); }

/* ============================================
   Post list
   ============================================ */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 3em;
}

.post-list .loading {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
}
body.light .post-list .loading { color: rgba(0, 0, 0, 0.4); }

.post-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: baseline;
  gap: 1.6em;
  padding: 1.1em 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none;
  color: inherit;
  transition: padding 0.25s ease;
  cursor: none;
}

body.light .post-row { border-bottom-color: rgba(0, 0, 0, 0.07); }

.post-row:hover {
  padding-left: 8px;
}

.post-row .date {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: rgba(74, 142, 255, 0.55);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.post-row .row-title {
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: -0.01em;
  transition: color 0.25s ease;
}
body.light .post-row .row-title { color: rgba(0, 0, 0, 0.88); }

.post-row:hover .row-title { color: var(--accent); }

.post-row .row-excerpt {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.3em;
  line-height: 1.5;
  font-weight: 300;
}
body.light .post-row .row-excerpt { color: rgba(0, 0, 0, 0.5); }

.post-row .row-readtime {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.04em;
}
body.light .post-row .row-readtime { color: rgba(0, 0, 0, 0.4); }

/* ============================================
   Single post
   ============================================ */
.post-meta-top {
  display: flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.04em;
  margin-bottom: 1.2em;
}
body.light .post-meta-top { color: rgba(0, 0, 0, 0.5); }

.post-meta-top .separator { color: rgba(74, 142, 255, 0.4); }

.post-title {
  font-family: 'Fraunces', 'Inter', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 0.5em;
  color: var(--fg);
}
body.light .post-title { color: #0a0a0a; }

.post-excerpt {
  font-size: clamp(0.9rem, 1.4vw, 1.05rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  margin-bottom: 1.4em;
}
body.light .post-excerpt { color: rgba(0, 0, 0, 0.6); }

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin-bottom: 3em;
}

.post-tags span {
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 0.25em 0.65em;
  border-radius: 20px;
  border: 1px solid rgba(74, 142, 255, 0.2);
  color: rgba(74, 142, 255, 0.7);
  letter-spacing: 0.03em;
}

/* ============================================
   Post body — Markdown
   ============================================ */
.post-body {
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 300;
}
body.light .post-body { color: rgba(0, 0, 0, 0.78); }

.post-body > * + * {
  margin-top: 1.2em;
}

.post-body h2 {
  font-family: 'Fraunces', 'Inter', serif;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-top: 2.2em;
  margin-bottom: 0.5em;
  color: var(--fg);
}
body.light .post-body h2 { color: #0a0a0a; }

.post-body h3 {
  font-family: 'Fraunces', 'Inter', serif;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-top: 1.8em;
  margin-bottom: 0.3em;
  color: rgba(255, 255, 255, 0.92);
}
body.light .post-body h3 { color: rgba(0, 0, 0, 0.92); }

.post-body p { font-weight: 300; }

.post-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(74, 142, 255, 0.3);
  transition: border-color 0.2s, color 0.2s;
  cursor: none;
}
.post-body a:hover {
  border-bottom-color: var(--accent);
}

.post-body strong { font-weight: 500; color: var(--fg); }
body.light .post-body strong { color: #0a0a0a; }

.post-body em { font-style: italic; }

.post-body ul, .post-body ol {
  padding-left: 1.4em;
  margin-top: 1em;
}
.post-body li { margin-bottom: 0.4em; }
.post-body li::marker { color: var(--accent); }

.post-body blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.2em 0 0.2em 1.4em;
  margin-left: 0;
  color: rgba(255, 255, 255, 0.55);
  font-style: italic;
}
body.light .post-body blockquote { color: rgba(0, 0, 0, 0.6); }

.post-body code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 0.12em 0.4em;
  background: rgba(74, 142, 255, 0.08);
  border: 1px solid rgba(74, 142, 255, 0.15);
  border-radius: 4px;
  color: rgba(120, 180, 255, 0.95);
}
body.light .post-body code {
  background: rgba(74, 142, 255, 0.06);
  border-color: rgba(74, 142, 255, 0.2);
  color: rgba(40, 90, 200, 1);
}

.post-body pre {
  font-family: var(--mono);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 1.1em 1.3em;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.6;
  margin: 1.6em 0;
}
body.light .post-body pre {
  background: rgba(245, 248, 255, 0.7);
  border-color: rgba(0, 0, 0, 0.08);
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: rgba(220, 230, 250, 0.92);
}
body.light .post-body pre code { color: rgba(20, 30, 60, 0.95); }

.post-body img {
  max-width: 100%;
  border-radius: 6px;
  margin: 1.5em 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.post-body hr {
  border: none;
  border-top: 1px solid rgba(74, 142, 255, 0.18);
  margin: 2.5em auto;
  width: 100px;
}

.post-footer {
  margin-top: 3em;
  padding-top: 2em;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
body.light .post-footer { border-top-color: rgba(0, 0, 0, 0.07); }

.back-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.25s, padding-left 0.25s;
  cursor: none;
}
body.light .back-link { color: rgba(0, 0, 0, 0.6); }
.back-link:hover {
  color: var(--accent);
  padding-left: 4px;
}

.meta-line {
  margin-top: 2em;
}

/* Hide blob and ascii-quote cleanly on blog */
body.blog-page #blob-canvas { opacity: 0.4; }

@media (max-width: 600px) {
  .blog-main { padding: 80px 24px 50vh; }
  .post-row {
    grid-template-columns: 1fr;
    gap: 0.4em;
  }
  .post-row .date { font-size: 0.66rem; }
  .post-row .row-readtime { display: none; }
  .reading-progress { height: 1.5px; }
  .back-link { cursor: default; }
  .post-row { cursor: default; }
  .post-body a { cursor: default; }
}
