/* Blog: the posts page, archives and posts. Loaded on blog views only (inc/blog.php). Mobile first. */

/* ── Listing ─────────────────────────────────────────────────────────── */
.blog-main, .post-body, .post-more { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.blog-main { padding-top: var(--after-hero); padding-bottom: var(--section); }

/* Topic chips under the title, on the sky: the current one filled navy */
.blog-chips .chip { background: var(--white); border-color: var(--white); }
.blog-chips .chip[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
@media (hover: hover) { .blog-chips .chip:not([aria-current="page"]):hover { border-color: var(--ink); } }

.blog-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px 24px; }
@media (min-width: 700px) { .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; } }
@media (min-width: 1024px) { .blog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 28px; } }

/* Post card: the title link covers the whole card; the category label sits above it as its own link */
.post-card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.post-card-photo {
  display: grid; place-items: center; aspect-ratio: 3 / 2; border-radius: var(--r-photo); overflow: hidden;
  background: var(--tint); color: var(--sky);
}
.post-card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms cubic-bezier(0.2, 0, 0, 1); }
.post-card-body { display: flex; flex-direction: column; flex: 1; padding-top: 14px; }
.post-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 0.8125rem; font-weight: 700; color: var(--ink-soft); }
.post-card-cat {
  position: relative; z-index: 1; display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px;
  border-radius: var(--r-pill); background: var(--sun); color: var(--ink); text-decoration: none;
}
@media (hover: hover) { .post-card-cat:hover { background: var(--ink); color: var(--white); } }
.post-card-title { margin-top: 10px; font-size: 1.375rem; line-height: 1.12; letter-spacing: -0.02em; }
.post-card-link { text-decoration: none; }
.post-card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-photo); }
.post-card-link:focus-visible { outline: none; }
.post-card-link:focus-visible::after { outline: 3px solid var(--ink); outline-offset: 4px; }
.post-card-excerpt {
  margin-top: 8px; color: var(--ink-soft); font-size: 1rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-date { margin-top: auto; padding-top: 12px; font-size: 0.875rem; font-weight: 600; color: var(--ink-soft); }
@media (hover: hover) {
  .post-card:hover .post-card-link { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
  .post-card:hover .post-card-photo img { transform: scale(1.03); }
}
@media (prefers-reduced-motion: reduce) { .post-card-photo img { transition: none; } }

/* The newest post leads: photo beside the text, across the grid */
@media (min-width: 700px) {
  .post-card.is-lead { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: center; }
  .post-card.is-lead .post-card-photo { aspect-ratio: 4 / 3; border-radius: var(--r-card); }
  .post-card.is-lead .post-card-body { padding-top: 0; }
  .post-card.is-lead .post-card-title { font-size: clamp(1.75rem, 3.4vw, 2.5rem); line-height: 1.04; }
  .post-card.is-lead .post-card-excerpt { font-size: 1.125rem; -webkit-line-clamp: 4; }
  .post-card.is-lead .post-card-date { margin-top: 0; padding-top: 16px; }
}

/* Pages */
.blog-main .pagination { margin-top: 48px; }
.blog-main .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.blog-main .page-numbers {
  display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: var(--r-pill);
  border: 2px solid var(--line); font-weight: 700; text-decoration: none;
}
.blog-main .page-numbers.current { background: var(--ink); border-color: var(--ink); color: var(--white); }
.blog-main .page-numbers.dots { border-color: transparent; }
@media (hover: hover) { .blog-main a.page-numbers:hover { border-color: var(--ink); } }

/* Nothing yet */
.blog-empty { padding: 40px 20px; border-radius: var(--r-card); background: var(--tint); text-align: center; }
.blog-empty h2 { font-size: clamp(1.5rem, 5vw, 2rem); }
.blog-empty p { margin: 10px auto 0; max-width: 46ch; color: var(--ink-soft); }
.blog-empty-actions { margin-top: 20px; display: flex; justify-content: center; }

/* ── Post ────────────────────────────────────────────────────────────── */
.post-hero .page-hero-title { max-width: 22ch; font-size: clamp(2rem, 6.5vw, 3.25rem); }
.post-back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin-bottom: 6px;
  font-weight: 700; font-size: 0.9375rem; text-decoration: none;
}
@media (hover: hover) { .post-back:hover { text-decoration: underline; text-underline-offset: 4px; } }
.post-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 14px; font-weight: 700; font-size: 0.9375rem; }

.post-body { padding-top: var(--after-hero); }
.post-photo { margin: 0 0 32px; }
.post-photo img { width: 100%; max-height: 620px; object-fit: cover; border-radius: var(--r-card); }
.post-photo figcaption { margin-top: 8px; font-size: 0.875rem; color: var(--ink-soft); }
@media (min-width: 1024px) { .post-photo { margin-bottom: 48px; } }

/* The post itself: one readable column */
.post-content { max-width: 68ch; padding-top: 0; padding-bottom: 0; font-size: 1.125rem; line-height: 1.65; }
@media (min-width: 700px) { .post-content { font-size: 1.1875rem; } }
.post-content > :first-child { margin-top: 0; }
.post-content figure { margin: 1.6em 0 0; }
.post-content figcaption { margin-top: 8px; font-size: 0.875rem; color: var(--ink-soft); }
.post-content li + li { margin-top: 0.35em; }

/* Planning a party? A sun card after the post */
.post-cta {
  max-width: 68ch; margin-top: 48px; padding: 24px; border-radius: var(--r-card); background: var(--sun);
  display: grid; gap: 16px;
}
.post-cta h2 { font-size: clamp(1.5rem, 4.5vw, 1.875rem); }
.post-cta p { margin-top: 6px; font-weight: 600; }
.post-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.post-cta .btn-ghost { min-height: 52px; background: transparent; }
@media (hover: hover) { .post-cta .btn-ghost:hover { background: rgba(255, 255, 255, 0.5); } }
@media (min-width: 700px) { .post-cta { padding: 32px; } }

/* More from the blog */
.post-more { padding-top: var(--section); padding-bottom: var(--section); }
.post-more-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 24px; padding-top: 40px; border-top: 1px solid var(--line); }
.post-more-head h2 { font-size: clamp(1.5rem, 5vw, 2rem); }
.post-more-all { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; text-underline-offset: 4px; }
