/* Sanity-powered blog pages */
.blog-index .blog-header {
  text-align: center;
  margin-bottom: 2rem;
}
.blog-index .blog-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  margin-bottom: 1.25rem;
}
.author-filter,
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.filter-btn {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  background: var(--paper-elev);
  color: var(--ink-soft);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--pine-deep);
  border-color: var(--pine-deep);
  color: #fff;
}
.tag-draft {
  background: #5c3d1e;
  color: #fff;
  border-color: #5c3d1e;
}
.draft-notice {
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: #f8f0e8;
  border-left: 3px solid #b07d2a;
  font-size: 0.92rem;
}
.post-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .post-grid { grid-template-columns: repeat(3, 1fr); }
}
.post-card {
  border: 1px solid var(--line);
  background: var(--paper-elev);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.post-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.card-image-link {
  display: block;
  background: var(--paper-warm);
}
.card-body {
  padding: 1.25rem 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.card-meta .dot { margin: 0 0.35rem; }
.view-count {
  font-variant-numeric: tabular-nums;
}
.post-card h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}
.post-card h2 a {
  text-decoration: none;
  color: inherit;
}
.post-card h2 a:hover { color: var(--clay-deep); }
.post-card .excerpt {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.55;
  flex: 1;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.85rem;
}
.tag {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--line);
  color: var(--pine);
  text-decoration: none;
  background: rgba(45, 74, 68, 0.06);
}
.loading,
.no-posts,
.error {
  text-align: center;
  color: var(--muted);
  padding: 2rem 0;
  grid-column: 1 / -1;
}
.error { color: var(--clay-deep); }

/* Single post */
.post-single .post-hero {
  width: 100%;
  max-height: 28rem;
  object-fit: cover;
}
.post-inner {
  max-width: var(--narrow);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3rem) clamp(1.25rem, 4vw, 2.5rem) 4rem;
}
.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.post-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  line-height: 1.12;
  margin: 0.75rem 0 1.25rem;
}
.post-tags { margin-bottom: 0.5rem; }
.post-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.author-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.author-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  object-fit: cover;
}
.author-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.author-info strong {
  color: var(--ink);
  font-weight: 600;
}
.post-body {
  color: var(--ink-soft);
  line-height: 1.75;
}
.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 1.75rem 0 0.75rem;
  line-height: 1.2;
}
.post-body p { margin-bottom: 1.1rem; }
.post-body blockquote {
  border-left: 3px solid var(--clay);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--clay-deep);
}
.post-body figure {
  margin: 1.75rem 0;
}
.post-body figure img {
  width: 100%;
  height: auto;
}
.post-body figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.5rem;
}
.post-body a { color: var(--pine); }
.post-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.back-link {
  font-weight: 500;
  text-decoration: none;
  color: var(--pine);
}
.back-link:hover { color: var(--clay-deep); }
