/* ============================================================
   Blog styles — reuses the design tokens from styles.css
   (--bg, --accent, --font-display, etc.). Load AFTER styles.css.
   ============================================================ */

.blog-main {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 88px) var(--pad-x) 40px;
  min-height: 60vh;
}

/* ---------- Blog listing page ---------- */

.blog-index-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 600;
  line-height: 1.05;
  margin: 0.2em 0 0.3em;
  letter-spacing: -0.01em;
}

.blog-index-sub {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 52ch;
  margin: 0 0 48px;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-soft);
}

.post-list-item {
  border-bottom: 1px solid var(--line-soft);
}

.post-list-item > a {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 24px 8px;
  color: var(--text);
  transition: background var(--t), padding var(--t);
}

.post-list-item > a:hover {
  background: var(--accent-soft);
  padding-left: 16px;
  padding-right: 16px;
  opacity: 1;
}

.post-list-date {
  flex: 0 0 auto;
  width: 96px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-soft);
  padding-top: 0.35em;
}

.post-list-body { flex: 1 1 auto; min-width: 0; }

.post-list-title {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.post-list-excerpt {
  display: block;
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-top: 4px;
}

.post-list-arrow {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 1.1rem;
  transform: translateX(-4px);
  opacity: 0;
  transition: transform var(--t), opacity var(--t);
  align-self: center;
}
.post-list-item > a:hover .post-list-arrow {
  transform: translateX(0);
  opacity: 1;
}

.post-list-empty {
  padding: 32px 8px;
  color: var(--text-soft);
}

@media (max-width: 560px) {
  .post-list-item > a { flex-direction: column; gap: 6px; }
  .post-list-date { width: auto; padding-top: 0; }
  .post-list-arrow { display: none; }
}

/* ---------- Single post ---------- */

.post-back {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 28px;
}
.post-back:hover { color: var(--accent); }

.post-head {
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line-soft);
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-soft);
  margin: 16px 0 0;
  letter-spacing: 0.02em;
}
.post-author { color: var(--text-dim); }

.post-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.01em;
}

.post-subtitle {
  color: var(--text-dim);
  font-size: 1.15rem;
  margin: 16px 0 0;
}

/* ---------- Markdown content typography ---------- */

.post-content {
  font-size: 1.05rem;
  line-height: 1.75;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.post-content > * + * { margin-top: 1.25em; }

/* Headings read better left-aligned, even when the body is justified */
.post-content h2,
.post-content h3 { text-align: left; }

.post-content h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  margin-top: 1.8em;
  line-height: 1.2;
}
.post-content h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 1.6em;
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(34, 211, 238, 0.4);
}
.post-content a:hover { text-decoration-color: var(--accent); }

.post-content ul,
.post-content ol { padding-left: 1.4em; }
.post-content li { margin-top: 0.4em; }

.post-content blockquote {
  margin: 1.5em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent);
  color: var(--text-dim);
  font-style: italic;
}

.post-content img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin: 1.5em 0;
}

.post-content pre {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
}
.post-content pre code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--line-soft);
  margin: 2.5em 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.post-content th,
.post-content td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.post-content th { color: var(--text); font-weight: 600; }

.post-foot {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}

.post-contact {
  color: var(--text-dim);
  font-size: 1rem;
  margin: 0 0 20px;
}
.post-contact a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(34, 211, 238, 0.4);
}
.post-contact a:hover { text-decoration-color: var(--accent); }

/* ---------- Footer ---------- */

.blog-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px var(--pad-x) 56px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-soft);
  font-size: 0.9rem;
}
.blog-footer a { color: var(--accent); }
