/* ═══════════════════ BLOG LISTING — Posts page + category archives (index.php) ═══════════════════
   Enqueued after custom.css (depends on smudgechild-custom). The filter
   pill (.chip) is shared and lives in custom.css.

   Every rule here is class-scoped: custom.css still carries bare
   h1/h2/h3/ul/a rules and body weight 300, so each section sets its own
   font-weight and each heading its own size and margin.

   Sections are direct children of .site-container, so footer.css gives them
   position:relative + z-index:1 + the page background, which keeps the
   sticky footer hidden until the page ends. That background only covers
   each section's own box — so the sections are full width, with the
   content width made by side padding and outer spacing as padding.
   Otherwise the dark footer shows through at the sides and in the gaps. */

.blog-head,
.blog-featured,
.blog-browse { font-weight: 400; }

/* content width min(1240px, 92vw), as padding */
.blog-head,
.blog-featured,
.blog-browse { padding-left: max(4vw, calc((100% - 1240px) / 2)); padding-right: max(4vw, calc((100% - 1240px) / 2)); }

/* ───────────── Reveal-on-scroll ─────────────
   Scoped to this page's sections so nothing else on the site is affected. */
.blog-head .reveal,
.blog-featured .reveal,
.post-grid .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.blog-head .reveal.in,
.blog-featured .reveal.in,
.post-grid .reveal.in { opacity: 1; transform: none; }
.blog-head .reveal-d1 { transition-delay: 0.08s; }
.blog-head .reveal-d2 { transition-delay: 0.16s; }
.blog-featured .reveal-d3 { transition-delay: 0.24s; }

/* ═══════════════════ SECTION 1 — PAGE HEADER ═══════════════════ */
.blog-head {
  padding-top: clamp(132px, 17vh, 172px); padding-bottom: clamp(20px, 3vh, 32px);
  text-align: center;
}
.blog-head .badge-row { margin-bottom: 20px; }
.blog-head__title {
  font-family: var(--sans); font-weight: 500; font-size: clamp(34px, 4.6vw, 60px); line-height: 1.04;
  letter-spacing: -0.03em; color: var(--ink); margin: 0 auto; max-width: 18ch; text-wrap: balance;
}
.blog-head__sub {
  font-family: var(--sans); font-size: clamp(15px, 1.2vw, 18px); line-height: 1.55; color: var(--ink-soft);
  margin: 16px auto 0; max-width: 56ch; text-wrap: pretty;
}

/* ═══════════════════ SECTION 2 — FEATURED POST ═══════════════════ */
.blog-featured { padding-top: clamp(28px, 4vh, 44px); }
.feat-card {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: stretch;
  border-radius: 22px; overflow: hidden; background: #f4f2ed;
  box-shadow: 0 30px 64px -46px rgba(12, 12, 13, 0.35);
  text-decoration: none; color: inherit;
}
/* style.css's a:hover (0,1,1) would otherwise recolour the card's text */
.feat-card:hover { color: inherit; }
.feat-card__media { position: relative; min-height: 280px; background: #e9e6df; }
.feat-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.feat-card__tag {
  position: absolute; top: 18px; left: 18px; z-index: 2;
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: #fff; background: rgba(12, 12, 13, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 7px 13px; border-radius: 999px;
}
.feat-card__body {
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(28px, 3.6vw, 52px);
}
.feat-card__eyebrow {
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.feat-card__title {
  font-family: var(--sans); font-weight: 500; font-size: clamp(22px, 2.4vw, 32px); line-height: 1.14;
  letter-spacing: -0.015em; color: var(--ink); margin: 0 0 14px; text-wrap: balance;
}
.feat-card__excerpt {
  font-family: var(--sans); font-size: clamp(14.5px, 1.1vw, 16.5px); line-height: 1.6; color: var(--ink-soft);
  margin: 0 0 22px; max-width: 52ch; text-wrap: pretty;
}
.feat-card__meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  font-family: var(--sans); font-size: 13px; color: var(--ink-faint); margin-bottom: 22px;
}
.feat-card__meta .sep { opacity: 0.6; }
.feat-card__link {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font-family: var(--sans); font-size: 14.5px; font-weight: 600; color: var(--accent); transition: gap 0.2s ease;
}
.feat-card__link .arrow { width: 16px; height: 16px; transition: transform 0.2s ease; }
.feat-card:hover .feat-card__link .arrow { transform: translateX(3px); }
@media (max-width: 820px) {
  .feat-card { grid-template-columns: 1fr; }
  .feat-card__media { min-height: 220px; }
}

/* ═══════════════════ SECTION 3 — FILTERS + GRID ═══════════════════ */
.blog-browse { padding-top: clamp(56px, 8vh, 100px); padding-bottom: clamp(64px, 9vh, 120px); }
.blog-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: clamp(34px, 4.6vh, 52px); }

.post-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.post-card {
  flex: 0 1 calc((100% - 44px) / 3); max-width: 380px;
  display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  background: #f4f2ed; text-decoration: none; color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.4s ease;
}
.post-card:hover { color: inherit; transform: translateY(-3px); box-shadow: 0 26px 54px -42px rgba(12, 12, 13, 0.4); }
.post-grid .post-card.reveal { transform: translateY(18px); transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.4s ease; }
.post-grid .post-card.reveal.in { transform: none; }
.post-grid .post-card.reveal.in:hover { transform: translateY(-3px); }

.post-card__media { position: relative; aspect-ratio: 16 / 10; background: #e9e6df; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card__tag {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: #fff; background: rgba(12, 12, 13, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 6px 11px; border-radius: 999px;
}
.post-card__body { display: flex; flex-direction: column; flex: 1; padding: 20px 20px 22px; }
.post-card__title {
  font-family: var(--sans); font-weight: 600; font-size: 18px; line-height: 1.28; letter-spacing: -0.01em;
  color: var(--ink); margin: 0 0 10px; text-wrap: balance;
}
/*
 * One Excerpt field feeds the featured card, the article dek and these
 * cards; the cards show at most 3 lines of it.
 */
.post-card__excerpt {
  font-family: var(--sans); font-size: 13.5px; line-height: 1.55; color: var(--ink-soft);
  margin: 0 0 18px; text-wrap: pretty;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card__foot {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.post-card__meta { font-family: var(--sans); font-size: 12px; color: var(--ink-faint); }
.post-card__meta .sep { margin: 0 6px; opacity: 0.6; }
.post-card__arrow { flex: none; width: 15px; height: 15px; color: var(--accent); transition: transform 0.2s ease; }
.post-card:hover .post-card__arrow { transform: translateX(3px); }

/* states — toggled by blog-sections.js (initial state set by PHP) */
.blog-empty { display: none; text-align: center; padding: 60px 0; margin: 0; font-family: var(--sans); font-size: 16px; color: var(--ink-soft); }
.blog-empty.is-visible { display: block; }

.blog-loader {
  display: none; align-items: center; justify-content: center; gap: 10px;
  padding: clamp(36px, 5vh, 56px) 0 0;
  font-family: var(--sans); font-size: 13.5px; color: var(--ink-soft);
}
.blog-loader.is-visible { display: flex; }
.blog-loader__spin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: blog-spin 0.7s linear infinite;
}
@keyframes blog-spin { to { transform: rotate(360deg); } }
.blog-end {
  display: none; text-align: center; padding: clamp(36px, 5vh, 56px) 0 0; margin: 0;
  font-family: var(--sans); font-size: 13.5px; color: var(--ink-faint);
}
.blog-end.is-visible { display: block; }
.blog-sentinel { height: 1px; }

@media (max-width: 1080px) { .post-card { flex-basis: calc((100% - 22px) / 2); } }
@media (max-width: 620px) { .post-card { flex-basis: 100%; max-width: 440px; } }

@media (prefers-reduced-motion: reduce) {
  .blog-head .reveal,
  .blog-featured .reveal,
  .post-grid .reveal { opacity: 1; transform: none; transition: none; }
}
