/* Blog pages (blog.php, post.php) and the homepage latest-posts cards. Uses the tokens from site.css. */

.blog-hero > .container, .post-hero > .container { position: relative; z-index: 1; }
.blog-hero { padding-bottom: clamp(28px, 4vw, 48px); }
.blog-hero .section-head { max-width: 820px; margin-inline: auto; justify-items: center; text-align: center; }
.blog-section { padding-top: clamp(24px, 4vw, 48px); }

/* card grid */
.blog-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: clamp(28px, 4vw, 48px); }
.blog-section .blog-grid { margin-top: 0; }
.blog-grid > li { display: flex; }
.blog-card {
  display: flex; flex-direction: column; width: 100%;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden;
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.blog-card-img { display: block; aspect-ratio: 16 / 9; background: linear-gradient(150deg, var(--pale), var(--mint)); overflow: hidden; }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.blog-card:hover .blog-card-img img { transform: scale(1.04); }
.blog-card-body { display: flex; flex-direction: column; gap: 10px; padding: 24px 24px 26px; flex: 1; }
.blog-date { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; color: var(--green-ink); }
.blog-card-title { font-family: var(--font-display); font-size: 1.28rem; line-height: 1.22; letter-spacing: -.025em; font-weight: 650; }
.blog-card-title a { color: inherit; text-decoration: none; }
.blog-card-title a:hover { color: var(--green-ink); }
.blog-card-desc { color: var(--muted); font-size: .96rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog-more { margin-top: auto; align-self: flex-start; }
.blog-more svg { width: 16px; height: 16px; }

.blog-all { margin-top: clamp(28px, 4vw, 40px); }

.blog-empty { text-align: center; max-width: 560px; margin: 0 auto; padding: clamp(40px, 6vw, 72px) 28px; border: 1px dashed #C9D6CF; border-radius: var(--radius-l); background: var(--pale); display: grid; gap: 14px; justify-items: center; }
.blog-empty p { color: var(--muted); }

.blog-pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: clamp(32px, 5vw, 56px); }
.blog-pager > :last-child { justify-self: end; }
.pager-info { color: var(--muted); font-size: .9rem; }

/* single post */
.post-hero { padding-bottom: clamp(28px, 4vw, 44px); }
.post-narrow { max-width: 780px; }
.post-wide { max-width: 1040px; }
.post-back { display: inline-block; margin-bottom: 22px; color: var(--green-ink); font-weight: 600; font-size: .93rem; text-decoration: none; }
.post-back:hover { text-decoration: underline; }
.post-hero .post-title { font-size: clamp(2rem, 4.6vw, 3.3rem); line-height: 1.06; }
.post-lede { margin-top: 18px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; color: var(--muted); font-size: .9rem; }
.post-cover { margin: 0 0 clamp(32px, 5vw, 56px); border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-soft); background: var(--pale); }
.post-cover img { width: 100%; height: auto; max-height: 620px; object-fit: cover; }

.post-body { font-size: 1.1rem; line-height: 1.78; color: #2A2D2B; overflow-wrap: break-word; }
.post-body > * + * { margin-top: 1.1em; }
.post-body h2 { font-family: var(--font-display); font-size: 1.75rem; line-height: 1.2; letter-spacing: -.03em; color: var(--ink); margin-top: 1.8em; }
.post-body h3 { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.25; letter-spacing: -.02em; color: var(--ink); margin-top: 1.6em; }
.post-body h4 { font-size: 1.1rem; color: var(--ink); margin-top: 1.4em; }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body li + li { margin-top: .4em; }
.post-body li::marker { color: var(--green-ink); }
.post-body a { color: var(--green-ink); text-decoration: underline; text-underline-offset: 3px; }
.post-body blockquote { border-left: 4px solid var(--green); background: var(--pale); padding: 16px 22px; border-radius: 0 var(--radius-s) var(--radius-s) 0; color: var(--ink); }
.post-body strong, .post-body b { color: var(--ink); }

.post-cta { margin: clamp(48px, 7vw, 80px) 0 clamp(56px, 8vw, 96px); padding: 28px 30px; border-radius: var(--radius-l); background: radial-gradient(120% 140% at 0% 0%, #0B7A4D, var(--forest)); color: var(--white); display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.post-cta h2 { font-family: var(--font-display); font-size: 1.45rem; letter-spacing: -.02em; }
.post-cta p { color: rgba(255,255,255,.82); margin-top: 6px; }
.post-cta a:not(.btn) { color: var(--white); }
.post-cta .btn-primary { background: var(--white); color: var(--forest); }

@media (max-width: 960px) {
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-pager { grid-template-columns: 1fr 1fr; }
  .pager-info { display: none; }
  .post-body { font-size: 1.04rem; }
}

/* images placed inside a post */
.post-body figure { margin: 2em 0; }
.post-body figure img { width: 100%; height: auto; border-radius: var(--radius-m, 16px); box-shadow: var(--shadow-soft); background: var(--pale); }
.post-body figcaption { margin-top: 10px; text-align: center; font-size: .9rem; color: var(--muted); }
.post-body > figure + * { margin-top: 0; }
