/* Blog: post grid, cards, article page, prose. */

/* ---------- Cards ---------- */

.post-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }

.post-card {
  position: relative;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); overflow: hidden; transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.post-card:hover { box-shadow: var(--shadow); border-color: var(--line-strong); transform: translateY(-2px); }

/* Stretched link: the title link covers the whole card via an overlay. */
.post-card-link { color: inherit; text-decoration: none; }
.post-card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.post-card:hover .post-card-link { color: var(--accent); }

.post-card-art { position: relative; border-bottom: 1px solid var(--line); background: var(--bg-alt); }
.post-art { width: 100%; height: 11rem; object-fit: cover; }
.post-card-fig {
  position: absolute; top: 0.6rem; left: 0.75rem;
  font-family: var(--mono); font-size: 0.7rem; color: var(--ink-faint);
  background: rgba(255, 255, 255, 0.85); border: 1px solid var(--line);
  border-radius: 4px; padding: 0.1rem 0.45rem;
}

.post-card-body { padding: 1.25rem 1.25rem 1.4rem; }
.post-card-title { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
.post-card:hover .post-card-title { color: var(--accent); }
.post-card-excerpt { margin: 0 0 0.9rem; color: var(--ink-soft); font-size: 0.92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.post-card-categories { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; position: relative; z-index: 2; }

.category-tag {
  display: inline-block; font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 0.2rem 0.6rem; line-height: 1.5;
}
.category-tag:hover { background: #e2e0ff; text-decoration: none; }

@media (min-width: 40rem) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 64rem) {
  .post-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Article page ---------- */

.post-page { padding-top: 2rem; }

.post-head { max-width: 46rem; margin-inline: auto; }
.post-title {
  font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em;
  font-size: clamp(2rem, 6vw, 3.1rem); line-height: 1.12; margin: 0 0 0.9rem;
  text-wrap: balance;
}
.post-excerpt { font-size: 1.12rem; color: var(--ink-soft); margin: 0 0 1.5rem; line-height: 1.55; text-wrap: pretty; }

.post-meta { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-block: 1rem; display: grid; gap: 0.55rem; }
.post-meta-row { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.75rem; align-items: baseline; }
.post-meta-label { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.post-meta-value { font-size: 0.95rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: baseline; }

@media (max-width: 30rem) {
  .post-meta-row { grid-template-columns: 1fr; gap: 0.15rem; }
}

.post-hero { margin-block: 2.5rem; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.post-hero .post-art { width: 100%; height: clamp(12rem, 34vw, 22rem); }

.post-content { max-width: 46rem; margin-inline: auto; }

/* Prose (rendered markdown) */
.prose { font-size: 1.06rem; line-height: 1.75; color: var(--ink-soft); }
.prose > * + * { margin-top: 1.25em; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--serif); color: var(--ink); line-height: 1.25; letter-spacing: -0.01em; margin-top: 2em; margin-bottom: 0.5em; text-wrap: balance; }
.prose h1 { font-size: 1.9rem; }
.prose h2 { font-size: 1.55rem; }
.prose h3 { font-size: 1.25rem; }
.prose strong { color: var(--ink); }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }
.prose del { color: var(--ink-soft); }
.prose blockquote {
  margin-inline: 0; padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--accent); color: var(--ink);
  font-family: var(--serif); font-size: 1.12em; font-style: italic;
}
.prose code {
  font-family: var(--mono); font-size: 0.85em;
  background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: 4px; padding: 0.1em 0.35em; color: var(--ink);
}
.prose pre {
  background: #0a2540; color: #e6edf3; border-radius: var(--radius);
  padding: 1rem 1.25rem; overflow-x: auto; font-size: 0.85rem; line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.prose img { border-radius: var(--radius); border: 1px solid var(--line); margin-inline: auto; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.5rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95em; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.5rem 0.75rem; text-align: left; }
.prose th { background: var(--bg-alt); color: var(--ink); }

/* Author card */
.author-card { max-width: 46rem; margin: 3rem auto 0; border-top: 1px solid var(--line); padding-top: 2rem; }
.author-inner { display: flex; gap: 1rem; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; background: var(--bg-inset); }
.author-avatar {
  flex-shrink: 0; width: 3.25rem; height: 3.25rem; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  font-family: var(--serif); font-size: 1.4rem; font-weight: 600;
}
.author-name { margin: 0 0 0.15rem; font-family: var(--serif); font-size: 1.15rem; }
.author-bio { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }

/* Related */
.related { max-width: none; margin-top: 3.5rem; border-top: 1px solid var(--line); padding-top: 2rem; }
.post-back { max-width: 46rem; margin: 3rem auto 0; font-family: var(--mono); font-size: 0.85rem; }

/* Share links */
.share-links { display: inline-flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.share-link {
  font-family: var(--mono); font-size: 0.75rem; color: var(--ink-soft);
  border: 1px solid var(--line-strong); border-radius: 4px;
  padding: 0.15rem 0.5rem; background: var(--bg); cursor: pointer;
}
.share-link:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
