/* ============================================================
   blog.css — CalcPocket Blog Index Page
   Matches the site's existing design system:
   - Fonts: Bricolage Grotesque (headings), DM Sans (body), DM Mono (mono)
   - CSS variables from css/styles.css (--bg, --surface, --border, etc.)
   - Accent: --accent / --blue for dark, --accent for light
   ============================================================ */

/* ---- Box sizing ---- */
.blog-hero *,
.blog-hero *::before,
.blog-hero *::after,
.blog-main *,
.blog-main *::before,
.blog-main *::after,
.blog-cta-strip *,
.blog-cta-strip *::before,
.blog-cta-strip *::after {
  box-sizing: border-box;
}

/* ============================================================
   HERO
   ============================================================ */
.blog-hero {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}

.blog-hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 28px 40px;
}

.blog-hero-content {
  max-width: 720px;
}

.blog-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px 4px 8px;
  background: rgba(91, 156, 246, 0.10);
  border: 1px solid rgba(91, 156, 246, 0.28);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}
body.light-theme .blog-hero-tag {
  background: rgba(2, 100, 200, 0.07);
  border-color: rgba(2, 100, 200, 0.22);
  color: var(--accent);
}

.blog-hero-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: var(--text);
  margin-bottom: 16px;
}
.blog-hero-title span { color: var(--blue); }
body.light-theme .blog-hero-title span { color: var(--accent); }

.blog-hero-desc {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ---- Filter pills ---- */
.blog-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
}
.blog-filter-pill i { font-size: 11px; }
.blog-filter-pill:hover {
  background: rgba(91, 156, 246, 0.08);
  border-color: rgba(91, 156, 246, 0.35);
  color: var(--blue);
}
body.light-theme .blog-filter-pill:hover {
  background: rgba(2, 100, 200, 0.06);
  border-color: rgba(2, 100, 200, 0.28);
  color: var(--accent);
}
.blog-filter-pill.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
body.light-theme .blog-filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.blog-main {
  position: relative;
  z-index: 1;
}

.blog-main-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 28px 72px;
}

/* ============================================================
   FEATURED CARD
   ============================================================ */
.blog-card--featured {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin-bottom: 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 80px var(--accent-dim);
  transition: border-color var(--transition), box-shadow var(--transition);
}
/* Featured badge is now an inline element inside .blog-card-meta — no absolute positioning */
.blog-featured-badge {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue);
  background: rgba(91, 156, 246, 0.10);
  border: 1px solid rgba(91, 156, 246, 0.28);
  border-radius: 100px;
  padding: 3px 10px;
  white-space: nowrap;
}
body.light-theme .blog-featured-badge {
  color: var(--accent);
  background: rgba(2, 100, 200, 0.07);
  border-color: rgba(2, 100, 200, 0.22);
}
.blog-card--featured:hover {
  border-color: var(--blue);
}
body.light-theme .blog-card--featured:hover {
  border-color: var(--accent);
}
.blog-card--featured .blog-card-title {
  font-size: clamp(20px, 2.5vw, 28px);
}
.blog-card--featured .blog-card-excerpt {
  font-size: 15px;
  max-width: 760px;
}

/* ============================================================
   ARTICLE GRID
   ============================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ============================================================
   ARTICLE CARD
   ============================================================ */
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.blog-card:hover {
  border-color: rgba(91, 156, 246, 0.5);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
body.light-theme .blog-card:hover {
  border-color: rgba(2, 100, 200, 0.35);
}

/* Card meta row */
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Category badges */
.blog-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.blog-cat-badge i { font-size: 10px; }

.blog-cat-finance {
  background: rgba(52, 211, 153, 0.10);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.25);
}
body.light-theme .blog-cat-finance {
  background: rgba(5, 150, 105, 0.07);
  color: #059669;
  border-color: rgba(5, 150, 105, 0.2);
}

.blog-cat-health {
  background: rgba(251, 113, 133, 0.10);
  color: #fb7185;
  border: 1px solid rgba(251, 113, 133, 0.25);
}
body.light-theme .blog-cat-health {
  background: rgba(225, 29, 72, 0.07);
  color: #e11d48;
  border-color: rgba(225, 29, 72, 0.2);
}

.blog-cat-math {
  background: rgba(251, 191, 36, 0.10);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.25);
}
body.light-theme .blog-cat-math {
  background: rgba(180, 120, 0, 0.07);
  color: #b45309;
  border-color: rgba(180, 120, 0, 0.2);
}

.blog-cat-converters {
  background: rgba(167, 139, 250, 0.10);
  color: #a78bfa;
  border: 1px solid rgba(167, 139, 250, 0.25);
}
body.light-theme .blog-cat-converters {
  background: rgba(109, 40, 217, 0.07);
  color: #6d28d9;
  border-color: rgba(109, 40, 217, 0.2);
}

.blog-cat-date {
  background: rgba(91, 156, 246, 0.10);
  color: var(--blue);
  border: 1px solid rgba(91, 156, 246, 0.25);
}
body.light-theme .blog-cat-date {
  background: rgba(2, 100, 200, 0.07);
  color: var(--accent);
  border-color: rgba(2, 100, 200, 0.2);
}

/* Read time */
.blog-read-time {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}
/* On regular cards (not featured), push read time to the right */
.blog-card:not(.blog-card--featured) .blog-read-time {
  margin-left: auto;
}
.blog-read-time i { font-size: 11px; }

/* Title */
.blog-card-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.3px;
  color: var(--text);
  margin: 0;
}
.blog-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}
.blog-card-title a:hover { color: var(--blue); }
body.light-theme .blog-card-title a:hover { color: var(--accent); }

/* Excerpt */
.blog-card-excerpt {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  flex: 1;
  margin: 0;
}

/* Card footer */
.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.blog-card-date {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
}

/* CTA link to calculator */
.blog-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: rgba(91, 156, 246, 0.08);
  border: 1px solid rgba(91, 156, 246, 0.28);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.blog-card-cta i { font-size: 10px; }
.blog-card-cta:hover {
  background: rgba(91, 156, 246, 0.16);
  border-color: var(--blue);
}
body.light-theme .blog-card-cta {
  background: rgba(2, 100, 200, 0.06);
  border-color: rgba(2, 100, 200, 0.22);
  color: var(--accent);
}
body.light-theme .blog-card-cta:hover {
  background: rgba(2, 100, 200, 0.12);
  border-color: var(--accent);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.blog-empty {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 60px 24px;
  color: var(--text-dim);
  font-size: 15px;
  text-align: center;
}
.blog-empty i {
  font-size: 32px;
  opacity: 0.35;
}

/* ============================================================
   CTA STRIP
   ============================================================ */
.blog-cta-strip {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}

.blog-cta-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.blog-cta-text {
  display: flex;
  align-items: center;
  gap: 16px;
}
.blog-cta-text > i {
  font-size: 22px;
  color: var(--blue);
  flex-shrink: 0;
}
body.light-theme .blog-cta-text > i { color: var(--accent); }
.blog-cta-text div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.blog-cta-text strong {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.blog-cta-text span {
  font-size: 14px;
  color: var(--text-muted);
}

.blog-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--blue);
  border: none;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  transition: opacity var(--transition), transform var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.blog-cta-btn:hover { opacity: 0.88; transform: translateY(-1px); }
body.light-theme .blog-cta-btn { background: var(--accent); }

/* ============================================================
   BREADCRUMB (reuse from calc pages)
   ============================================================ */
.calc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.calc-breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color var(--transition);
}
.calc-breadcrumb a:hover { color: var(--blue); }
body.light-theme .calc-breadcrumb a:hover { color: var(--accent); }
.calc-breadcrumb i { font-size: 10px; }

/* ============================================================
   FADE-UP ANIMATION
   ============================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .blog-card--featured {
    padding: 26px 28px;
  }
}

@media (max-width: 640px) {
  .blog-hero-inner { padding: 28px 16px 32px; }
  .blog-main-inner { padding: 32px 16px 56px; }
  .blog-cta-inner  { padding: 24px 16px; }

  .blog-grid {
    grid-template-columns: 1fr;
  }
  .blog-card--featured {
    padding: 20px 20px 18px;
  }
  .blog-cta-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .blog-filter-pill span { display: none; }
}
