/* The Twixy Journal - public blog pages, rendered by server/lib/blog.js. */

/* ---------- list ---------- */

.blog-hero { padding: 72px 0 24px; text-align: center; }
.blog-hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
.blog-hero .section-sub { max-width: 560px; margin: 0 auto 1.4rem; }
.blog-list-section { padding-top: 24px; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}
.blog-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.blog-card-link { display: flex; flex-direction: column; height: 100%; }
.blog-card-cover { aspect-ratio: 16 / 9; background: #f3ecfb; overflow: hidden; }
.blog-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-cover-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f3ecfb, #fff3dd);
}
.blog-card-cover-fallback img { width: 40%; height: auto; object-fit: contain; border-radius: 12px; }
.blog-card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.blog-card-body h2 { font-size: 1.25rem; margin-bottom: .5rem; }
.blog-meta { color: var(--muted); font-size: .82rem; margin-bottom: .5rem; }
.blog-card-excerpt { color: var(--muted); font-size: .95rem; flex: 1; }
.blog-card-more { color: var(--purple); font-weight: 700; font-size: .9rem; }

.blog-empty {
  text-align: center;
  padding: 48px 24px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

/* ---------- article ---------- */

.post { padding: 48px 0 24px; }
.post-container { max-width: 760px; }
.post-back { display: inline-block; color: var(--purple); font-weight: 700; font-size: .9rem; margin-bottom: 28px; }
.post-back:hover { text-decoration: underline; }
.post-head h1 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); margin-bottom: .8rem; }
.post-byline { color: var(--muted); font-weight: 600; }
.post-cover { margin: 28px 0 36px; border-radius: var(--radius); overflow: hidden; background: #f3ecfb; }
.post-cover img { width: 100%; height: auto; }

.post-body { font-size: 1.08rem; line-height: 1.8; overflow-wrap: break-word; }
.post-body h2 { font-size: 1.6rem; margin: 2.2rem 0 .8rem; }
.post-body h3 { font-size: 1.25rem; margin: 1.8rem 0 .6rem; }
.post-body p { margin: 0 0 1.2rem; }
.post-body a { color: var(--purple); text-decoration: underline; text-underline-offset: 3px; }
.post-body ul, .post-body ol { margin: 0 0 1.2rem; padding-left: 1.4rem; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body li { margin-bottom: .4rem; }
.post-body li > ul, .post-body li > ol { margin: .4rem 0 0; }
.post-body blockquote {
  margin: 1.6rem 0;
  padding: 14px 22px;
  border-left: 4px solid var(--gold);
  background: #fff;
  border-radius: 0 12px 12px 0;
  font-size: 1.12rem;
  font-style: italic;
}
.post-body img { width: 100%; height: auto; border-radius: 14px; margin: 1.6rem 0; }
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 2.2rem 0; }

.post-share {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 36px 0;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.post-share span { font-weight: 700; margin-right: 6px; }

.post-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 28px 30px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--purple), var(--purple-deep));
  color: #fff;
}
.post-cta h2 { font-size: 1.5rem; margin-bottom: .3rem; }
.post-cta p { margin: 0; opacity: .85; }
.post-cta .btn-primary { background: var(--gold); color: var(--ink); box-shadow: none; }

.blog-more { padding-top: 48px; }
.blog-more-title { font-size: 1.6rem; margin-bottom: 24px; }

@media (max-width: 720px) {
  .blog-hero { padding: 48px 0 12px; }
  .blog-grid { grid-template-columns: 1fr; gap: 20px; }
  .post { padding-top: 28px; }
  .post-cover { margin: 20px 0 28px; }
  .post-body { font-size: 1.02rem; }
  .post-cta { padding: 22px; }
}
