/* AstroTheme — blog listing (/blog) and topic pages (/blog/category/<slug>).
   Loaded after base.css + pages.css. */

/* ── Hero ────────────────────────────────────────────────────────────────── */
.as-blog-hero { text-align: center; padding: 38px 0 30px;
  background: radial-gradient(640px 240px at 50% 0%, rgba(255, 214, 160, .5), transparent 70%), linear-gradient(180deg, #fdf3e6, var(--as-bg)); }
.as-blog-hero h1 { font-family: var(--as-display); font-size: clamp(32px, 4.6vw, 50px); line-height: 1.08; margin: 6px 0 10px; }
.as-blog-hero p { max-width: 620px; margin: 0 auto; color: var(--as-muted); }

/* ── Topic bar ───────────────────────────────────────────────────────────── */
/* Wraps onto more lines on desktop; a sticky sideways-scrolling strip on phones. */
.as-topics { border-bottom: 1px solid var(--as-line-soft); }
.as-topics-scroll { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-top: 14px; padding-bottom: 14px; }
.as-topics-scroll::-webkit-scrollbar { display: none; }
.as-topic { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 30px;
  background: #fff; border: 1px solid var(--as-line); color: var(--as-ink); font-size: 14px; font-weight: 500; text-decoration: none;
  white-space: nowrap; transition: border-color .15s, background .15s; }
.as-topic small { min-width: 26px; padding: 2px 8px; border-radius: 20px; background: var(--as-gold-soft); color: #9a5d0a; font-size: 12px; font-weight: 600; text-align: center; }
.as-topic:hover { border-color: var(--as-gold); }
.as-topic.is-active { background: var(--as-ink); border-color: var(--as-ink); color: #fff; }
.as-topic.is-active small { background: rgba(255, 255, 255, .18); color: #fff; }

/* ── Body ────────────────────────────────────────────────────────────────── */
.as-blog-body { padding-top: 26px; padding-bottom: 48px; }
.as-blog-sub { font-size: 22px; margin: 0 0 14px; }
.as-blog-sub + .as-post-grid { margin-bottom: 8px; }

/* Browse-by-topic cards */
.as-topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 34px; }
.as-topic-card { display: flex; align-items: center; gap: 14px; padding: 10px 16px 10px 10px; background: #fff; border: 1px solid var(--as-line);
  border-radius: 16px; text-decoration: none; transition: transform .15s, border-color .15s, box-shadow .15s; }
.as-topic-card:hover { transform: translateY(-2px); border-color: var(--as-gold); box-shadow: var(--as-shadow); }
.as-topic-art { display: grid; place-items: center; flex-shrink: 0; width: 56px; height: 56px; border-radius: 14px; overflow: hidden;
  font: 700 26px var(--as-display); color: #fff; }
.as-topic-art img { width: 100%; height: 100%; object-fit: cover; }
.as-topic-tone-0 { background: linear-gradient(145deg, #f8c25a, #d98a15); }
.as-topic-tone-1 { background: linear-gradient(145deg, #a58cf0, #6c4fd1); }
.as-topic-tone-2 { background: linear-gradient(145deg, #f7788f, #d9435d); }
.as-topic-tone-3 { background: linear-gradient(145deg, #6aa8f5, #2f6fd6); }
.as-topic-tone-4 { background: linear-gradient(145deg, #63cf8e, #2f9e5c); }
.as-topic-body { display: flex; flex-direction: column; min-width: 0; }
.as-topic-body strong { font: 700 16px var(--as-serif); color: var(--as-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-topic-body small { font-size: 12.5px; color: var(--as-muted); }
.as-topic-go { margin-left: auto; color: var(--as-gold); font-weight: 700; }

.as-pager { align-items: center; }
.as-pager-info { font-size: 13px; color: var(--as-muted); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) { .as-topic-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .as-topics { position: sticky; top: 74px; z-index: 40; background: rgba(253, 250, 246, .94); backdrop-filter: blur(8px); }
  .as-topics-scroll { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding-top: 10px; padding-bottom: 10px; }
  .as-topic-grid { gap: 8px; }
  .as-topic-card { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .as-topic-art { width: 42px; height: 42px; border-radius: 12px; font-size: 20px; }
  .as-topic-go { display: none; }
}
