/* =============================================================================
 * blog.css — Blog index (home.php) + archives (archive.php)
 *
 * Source of truth: gibson-blog-archive-toggle.html (Daedalus, approved v2).
 * Only this template's UNIQUE selectors live here. Design tokens, nav, footer,
 * global map, popup, mobile phone bar, .cta-btn, and .container all come from
 * global.css — never redefined here.
 *
 * NOTE for centralization: the source defined light/dark CONTENT-TEXT tokens
 * (--body-text*, --muted/softer/faint-text, --border-soft*, --surface-card) and
 * the bottom .cta section chrome inside its page <style>. global.css does not
 * yet carry them. They are scoped here so the blog template renders faithfully;
 * if/when another template needs the same tokens or the .cta section, promote
 * these blocks to global.css to keep a single source of truth.
 * ========================================================================== */

/* =============================================================================
 * PAGE HEADER / HERO
 * ========================================================================== */
body.separate-containers .page-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--navy);
  overflow: hidden;
  padding: 140px 0 80px;
}
.page-header::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 30%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(244,100,33,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.page-header::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: 20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0,180,216,0.04) 0%, transparent 70%);
  pointer-events: none;
}
.page-header-content { position: relative; z-index: 2; }
.page-header-eyebrow {
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--fire);
  margin-bottom: 14px;
}
.page-header h1 {
  font-family: var(--display);
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  font-weight: 600;
  color: #fff;
  line-height: 1.15;
  margin: 0 0 16px;
}
.page-header .subtitle {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--smoke);
  font-weight: 400;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}
.page-header .grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 1;
}

/* =============================================================================
 * FILTER BAR
 * ========================================================================== */
.filter-bar {
  background: var(--chalk-warm);
  border-bottom: 1px solid var(--parchment);
  padding: 24px 0;
  position: sticky;
  top: 60px;
  z-index: 100;
  transition: top 0.4s var(--ease);
}
.filter-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-pill {
  padding: 8px 20px;
  font-family: var(--body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--body-text-soft);
  background: transparent;
  border: 1.5px solid var(--parchment);
  border-radius: 100px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s var(--ease);
}
.filter-pill:hover { border-color: var(--fire); color: var(--fire); }
.filter-pill.active { background: var(--fire); color: #fff; border-color: var(--fire); }

/* =============================================================================
 * BLOG GRID + SECTION
 * ========================================================================== */
.blog-section { background: var(--chalk); padding: 64px 0 80px; }
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

/* =============================================================================
 * BLOG CARD
 * ========================================================================== */
.blog-card {
  background: #fff;
  border: 1px solid var(--border-softer);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.5s var(--ease);
  border-left: 3px solid transparent;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.08);
  border-left-color: var(--fire);
}
.blog-card-image {
  display: block; /* the render fn emits this as an <a> (clickable image); without
                     display:block the inline anchor ignores width/height and the
                     img renders at natural (tall) size. The source used a <div>. */
  position: relative;
  width: 100%;
  height: 200px;
  background: var(--navy-90);
  overflow: hidden;
}
.blog-card-image svg { width: 100%; height: 100%; }
.blog-card-image img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-body { padding: 28px 28px 24px; }
.blog-card-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-dim);
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 14px;
}
.blog-card-title {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 12px;
  transition: color 0.3s var(--ease);
}
.blog-card:hover .blog-card-title { color: var(--fire); }
.blog-card-excerpt {
  font-size: 0.9rem;
  color: var(--body-text-soft);
  line-height: 1.65;
  margin-bottom: 20px;
}
.blog-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid #f0ede7;
}
.blog-card-author { font-size: 0.78rem; color: var(--faint-text); font-weight: 400; }
.blog-card-author strong { color: var(--body-text); font-weight: 500; }
.blog-card-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fire);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.3s var(--ease);
}
.blog-card-link:hover { gap: 10px; }

/* The title links to the post; inherits the card's color/hover treatment. */
.blog-card-title a { color: inherit; text-decoration: none; }

/* ── Featured variant (archive first post) — spans the grid, image left ── */
.blog-feature-wrap { margin-bottom: 32px; }
.blog-card.is-feature { border-left-width: 3px; }
.blog-card.is-feature .blog-feature-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: stretch;
}
.blog-card.is-feature .blog-card-image { height: 100%; min-height: 280px; }
.blog-card.is-feature .blog-card-body { padding: 40px 40px 36px; display: flex; flex-direction: column; justify-content: center; }
.blog-card.is-feature .blog-card-title { font-size: 1.9rem; }
.blog-card.is-feature .blog-card-excerpt { font-size: 1rem; }

/* =============================================================================
 * PAGINATION
 * ========================================================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 56px;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--body-text-soft);
  border: 1.5px solid var(--parchment);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s var(--ease);
}
.pagination a:hover { border-color: var(--fire); color: var(--fire); }
.pagination .current,
.pagination .active {
  background: var(--fire);
  color: #fff;
  border-color: var(--fire);
}
.pagination .prev,
.pagination .next { font-size: 0.8rem; letter-spacing: 0.5px; font-weight: 600; }
.pagination .dots { border-color: transparent; }

/* ── Empty state ── */
.blog-empty {
  text-align: center;
  font-family: var(--body);
  color: var(--muted-text);
  padding: 48px 0;
}

/* =============================================================================
 * BOTTOM CTA (.cta) — navy button override for the shared close band.
 * The .cta band chrome itself lives canonically in global.css; only this
 * template's navy-variant button override is scoped here.
 * ========================================================================== */
/* The CTA button inside this section is the navy variant from the source body,
   overriding the global fire-gradient .cta-btn for this dark gradient context. */
.cta .cta-btn {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 18px 48px;
  border-radius: 0;
  box-shadow: none;
}
.cta .cta-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }

/* =============================================================================
 * DARK MODE — blog cards stay white (locked from source HTML)
 * ========================================================================== */
[data-theme="dark"] .blog-card { background: #fff; border-color: #e8e3d8; }
[data-theme="dark"] .blog-card-title { color: #1a1a1a; }
[data-theme="dark"] .blog-card-excerpt { color: #666; }
[data-theme="dark"] .blog-card-author { color: #999; }
[data-theme="dark"] .blog-card-author strong { color: #555; }
[data-theme="dark"] .blog-card-meta { border-top-color: #f0ede7; }

/* =============================================================================
 * RESPONSIVE — matches source breakpoints (1024 / 900 / 768 / 480)
 * ========================================================================== */
@media (max-width: 1024px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}

@media (max-width: 900px) {
  .blog-card.is-feature .blog-feature-inner { grid-template-columns: 1fr; }
  .blog-card.is-feature .blog-card-image { min-height: 200px; }
  .blog-card.is-feature .blog-card-body { padding: 28px 28px 24px; }
  .blog-card.is-feature .blog-card-title { font-size: 1.6rem; }
}

@media (max-width: 768px) {
  body.separate-containers .page-header { padding: 120px 0 60px; }

  .filter-bar { top: 56px; padding: 16px 0; }
  .filter-bar-inner { gap: 8px; }
  .filter-pill { padding: 6px 14px; font-size: 0.75rem; }

  .blog-grid { grid-template-columns: 1fr; gap: 20px; }
  .blog-section { padding: 40px 0 60px; }
  .blog-card-image { height: 180px; }

  .cta { padding: 56px 0; }

  .pagination { gap: 6px; margin-top: 40px; }
  .pagination a,
  .pagination span { min-width: 38px; height: 38px; font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .blog-card-body { padding: 24px 22px 22px; }
  .cta .cta-btn { padding: 16px 32px; }
}
