/* blog.css — Capital Finplus V5 — layout ported 1:1 from v1-current/blog.css,
   recoloured onto the V5 galaxy/purple theme (variables from styles.css). */

.blog-page-hero {
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  padding: calc(72px + 60px) 5vw 3rem;
  position: relative;
  overflow: hidden;
}
.blog-page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 40%, rgba(244,194,13,0.14) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 80% 60%, rgba(154,115,0,0.1) 0%, transparent 70%);
  pointer-events: none;
}

/* Category filter pills */
.filter-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.filter-btn {
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  font-family: 'Manrope', sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(244,194,13,0.06);
  color: var(--muted);
  transition: all 0.2s ease;
}
.filter-btn:hover,
.filter-btn.active {
  background: rgba(244,194,13,0.18);
  border-color: var(--purple);
  color: #fff;
}

/* Blog listing grid */
.blog-listing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
@media (max-width: 1024px) { .blog-listing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .blog-listing-grid { grid-template-columns: 1fr; } }

/* Post card */
.post-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.post-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-5px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(244,194,13,0.1);
}
.post-card-thumb {
  width: 100%;
  height: 180px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}
.post-card-thumb .thumb-icon {
  opacity: 0.5;
  transition: transform 0.4s ease, opacity 0.3s ease;
}
.post-card-thumb .thumb-icon svg { width: 56px; height: 56px; }
.post-card:hover .thumb-icon { transform: scale(1.15); opacity: 0.75; }

.post-card-body { padding: 1.4rem; display: flex; flex-direction: column; flex: 1; gap: 0.75rem; }

.post-access-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: 'Manrope', sans-serif;
}
.post-access-badge.badge-free {
  background: rgba(34,197,94,0.1);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.3);
}
.post-access-badge.badge-premium {
  background: rgba(245,158,11,0.1);
  color: #fbbf24;
  border: 1px solid rgba(245,158,11,0.3);
}
.post-card-category {
  font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--purple); font-weight: 600;
}

.post-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--white);
  line-height: 1.4;
  letter-spacing: -0.015em;
}
.post-excerpt {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.post-date,
.post-read-time { font-size: 0.72rem; color: var(--muted-2); font-family: 'Manrope', sans-serif; }

/* ── ARTICLE READER (full overlay, like v1) ── */
#article-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(10px);
  overflow-y: auto;
  padding: 2rem 1rem;
}
#article-overlay.open { display: flex; }

.article-reader {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 24px;
  max-width: 760px;
  width: 100%;
  position: relative;
  overflow: hidden;
  margin: auto;
}
.article-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(244,194,13,0.1);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all 0.2s;
  z-index: 10;
  font-size: 0.9rem;
}
.article-close:hover { background: rgba(244,194,13,0.2); color: #fff; }

.article-thumb svg { width: 76px; height: 76px; }
.article-thumb {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.article-header { padding: 2rem 2.5rem 1.5rem; border-bottom: 1px solid var(--border); }
.article-date { font-size: 0.78rem; color: var(--muted-2); font-family: 'Manrope', sans-serif; }
.article-body {
  padding: 2rem 2.5rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.85;
  position: relative;
}
.article-body h2 {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  margin: 1.75rem 0 0.75rem;
  letter-spacing: -0.02em;
}
.article-body h3 {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 1.02rem;
  color: #fff;
  margin: 1.25rem 0 0.5rem;
}
.article-body p { margin-bottom: 1rem; }
.article-body strong { color: #fff; font-weight: 700; }
.article-body ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.article-body ul li { margin-bottom: 0.4rem; }
.article-body .highlight-box {
  background: rgba(244,194,13,0.08);
  border-left: 3px solid var(--purple);
  padding: 1rem 1.25rem;
  border-radius: 0 12px 12px 0;
  margin: 1.25rem 0;
  font-style: italic;
  color: var(--lilac);
}

/* ── PAYWALL ── */
.article-content-wrap { position: relative; }
.paywall-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 240px;
  background: linear-gradient(to bottom, transparent 0%, var(--surface-3) 70%);
  pointer-events: none;
  z-index: 2;
}
.premium-content { filter: blur(4px); user-select: none; pointer-events: none; }
.premium-content.is-unlocked { filter: none; user-select: text; pointer-events: auto; }
.paywall-gate {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 3;
  padding: 2rem 2.5rem;
  text-align: center;
}
.paywall-card {
  background: var(--surface-2);
  border: 1px solid rgba(244,194,13,0.25);
  border-radius: 20px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.paywall-lock-icon {
  width: 52px; height: 52px;
  background: rgba(244,194,13,0.12);
  border: 1px solid rgba(244,194,13,0.3);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.paywall-title { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 1.05rem; color: #fff; }
.paywall-sub { font-size: 0.85rem; color: var(--muted); max-width: 400px; line-height: 1.6; }
.paywall-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

/* Newsletter strip */
.newsletter-strip {
  margin-top: 4rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}
@media (max-width: 768px) { .newsletter-strip { grid-template-columns: 1fr; } }
