/*
 * blog.css — DennTech Blog page styles
 * Dedicated stylesheet for /blog layout: grid, cards, filter bar, category badges.
 * Loaded exclusively on blog_index.html via {% block extra_head %}.
 * DO NOT remove this file or its <link> in blog_index.html — it controls the
 * entire blog listing layout independently of style.css changes.
 */

/* ── Shell & hero ────────────────────────────────────────────────────────── */
.blog-shell {
  padding: 1.4rem;
}

.blog-hero {
  padding: 1.1rem;
}

.blog-hero-banner {
  width: 100%;
  border-radius: 0.5rem;
  margin-bottom: 0.8rem;
}

.blog-hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
}

.blog-hero p {
  margin-top: 0.6rem;
  color: #afc0d6;
  max-width: 65ch;
  line-height: 1.6;
}

/* ── Category filter bar ─────────────────────────────────────────────────── */
.blog-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.4rem 0 0.5rem;
  padding: 1rem 1.1rem;
  background: rgba(12, 20, 34, 0.72);
  border: 1px solid rgba(126, 166, 208, 0.18);
  border-radius: 0.8rem;
  position: sticky;
  top: 0.5rem;
  z-index: 20;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.blog-filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.32em 0.95em;
  border-radius: 999px;
  border: 1px solid rgba(126, 166, 208, 0.28);
  background: transparent;
  color: #9eb5cf;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
  white-space: nowrap;
  line-height: 1;
  font-family: inherit;
}

.blog-filter-btn:hover {
  border-color: rgba(88, 213, 255, 0.55);
  color: #eaf2ff;
}

.blog-filter-btn.is-active {
  background: #1de9b6;
  border-color: #1de9b6;
  color: #071018;
  font-weight: 700;
}

/* ── Blog grid ───────────────────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* ── Blog card ───────────────────────────────────────────────────────────── */
.blog-card.card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.blog-card-img-wrap {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.blog-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-img {
  transform: scale(1.04);
}

.blog-card-body {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.1rem;
}

.blog-card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0.35rem 0 0.5rem;
  color: #eaf2ff;
}

.blog-card-title a {
  color: inherit;
  text-decoration: none;
}

.blog-card-title a:hover {
  color: #74f2ff;
}

.blog-card-excerpt {
  font-size: 0.84rem;
  color: #9eb5cf;
  line-height: 1.6;
  flex: 1;
}

.blog-card .blog-date {
  font-size: 0.72rem;
  color: #8398b3;
  margin: 0;
  white-space: nowrap;
}

.blog-read-link {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.82rem;
  color: #70efff;
}

/* ── Category badge pills ────────────────────────────────────────────────── */
.blog-cat {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18em 0.6em;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.blog-cat--strategies,
.blog-cat--strategy    { background: rgba(6,182,212,0.18);   color: #22d3ee; }
.blog-cat--guides      { background: rgba(20,184,166,0.18);  color: #2dd4bf; }
.blog-cat--exchanges   { background: rgba(59,130,246,0.18);  color: #60a5fa; }
.blog-cat--comparisons { background: rgba(139,92,246,0.18);  color: #c084fc; }
.blog-cat--reviews     { background: rgba(239,68,68,0.18);   color: #f87171; }
.blog-cat--risk-management  { background: rgba(239,68,68,0.18);   color: #f87171; }
.blog-cat--market-outlook   { background: rgba(251,146,60,0.18);  color: #fb923c; }
.blog-cat--pricing     { background: rgba(234,179,8,0.18);   color: #facc15; }
.blog-cat--free-tools  { background: rgba(34,197,94,0.18);   color: #4ade80; }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.blog-empty {
  color: #9eb0c8;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .blog-shell {
    padding: 0.9rem;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .blog-filter-bar {
    position: static;
    padding: 0.75rem;
    gap: 0.4rem;
  }

  .blog-filter-btn {
    font-size: 0.72rem;
    padding: 0.28em 0.75em;
  }
}

/* ── Layout hardening ────────────────────────────────────────────────────── */

/* Grid cells must have min-width:0; without it, content overflows the column */
.blog-card {
  min-width: 0;
}

/* Clamp title to 3 lines — prevents long titles from breaking card heights */
.blog-card-title {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Clamp excerpt to 3 lines */
.blog-card-excerpt {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Fallback bg when card image fails to load — preserves aspect-ratio wrapper */
.blog-card-img-wrap {
  background: rgba(12, 20, 34, 0.85);
}

/* Hero banner: never overflow its container */
.blog-hero-banner {
  max-width: 100%;
  height: auto;
}

/* Filter bar: never overflow horizontally */
.blog-filter-bar {
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
}

/* ── Card accent strip (top colour bar, replaces image when none present) ── */
.blog-card-accent {
  height: 4px;
  width: 100%;
  flex-shrink: 0;
}

.blog-card-accent--strategies,
.blog-card-accent--strategy    { background: #22d3ee; }
.blog-card-accent--guides      { background: #2dd4bf; }
.blog-card-accent--exchanges   { background: #60a5fa; }
.blog-card-accent--comparisons { background: #c084fc; }
.blog-card-accent--reviews     { background: #f87171; }
.blog-card-accent--risk-management { background: #f87171; }
.blog-card-accent--market-outlook  { background: #fb923c; }
.blog-card-accent--pricing     { background: #facc15; }
.blog-card-accent--free-tools  { background: #4ade80; }
.blog-card-accent--            { background: #1de9b6; }
ENDCSS
/* -- Card accent strip (top colour bar, replaces image when none present) -- */
.blog-card-accent {
  height: 4px;
  width: 100%;
  flex-shrink: 0;
}
.blog-card-accent--strategies,
.blog-card-accent--strategy    { background: #22d3ee; }
.blog-card-accent--guides      { background: #2dd4bf; }
.blog-card-accent--exchanges   { background: #60a5fa; }
.blog-card-accent--comparisons { background: #c084fc; }
.blog-card-accent--reviews     { background: #f87171; }
.blog-card-accent--risk-management { background: #f87171; }
.blog-card-accent--market-outlook  { background: #fb923c; }
.blog-card-accent--pricing     { background: #facc15; }
.blog-card-accent--free-tools  { background: #4ade80; }
.blog-card-accent--            { background: #1de9b6; }
