/* Public /blog/ — magazine layout */

.blog-hero {
  background: #0d2137;
  color: white;
  padding: 80px 24px 60px;
  text-align: center;
}

.blog-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: white;
  margin-bottom: 16px;
}

.blog-hero p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.blog-categories {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.cat-pill {
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.cat-pill:hover,
.cat-pill.active {
  background: #0e9e76;
  border-color: #0e9e76;
  color: white;
}

/* Single-column stack — each row matches the horizontal card design */
.blog-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.blog-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 280px;
}

.blog-card:hover {
  box-shadow: 0 8px 32px rgba(13, 33, 55, 0.1);
  transform: translateY(-2px);
}

/* ── Image media: 16:9 crop, no stretch (overrides global img { height: auto }) ── */

.blog-card-img-link {
  display: grid;
  flex: 0 0 50%;
  width: 50%;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #0d2137;
  aspect-ratio: auto;
  height: auto;
  align-self: stretch;
  min-height: 280px;
}

.blog-card-img-link picture {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 100%;
}

.blog-card-img-link .blog-card-img {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 100%;
  /* Override design-system.css img { max-width:100%; height:auto } — that rule stretches photos */
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
}

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

/* Default (stacked horizontal cards): fade image into white body on the right */
.blog-card-img-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(13, 33, 55, 0.12) 0%, transparent 12%),
    linear-gradient(
      to right,
      transparent 45%,
      rgba(255, 255, 255, 0.3) 70%,
      rgba(255, 255, 255, 0.9) 88%,
      #ffffff 100%
    );
}

.blog-card-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  background: linear-gradient(135deg, #0d2137 0%, #0e4d3a 100%);
  transform: none;
}

.blog-cat-led {
  background: linear-gradient(135deg, #0d2137 0%, #1a3a5c 100%);
}

.blog-cat-grants {
  background: linear-gradient(135deg, #0d2137 0%, #0e9e76 100%);
}

.blog-cat-donors {
  background: linear-gradient(135deg, #1a0d37 0%, #4a1e8a 100%);
}

.blog-cat-analytics {
  background: linear-gradient(135deg, #0d2137 0%, #1a5c3a 100%);
}

.blog-cat-general {
  background: linear-gradient(135deg, #0d2137 0%, #0e4d3a 100%);
}

.blog-card-icon {
  font-size: 80px;
  line-height: 1;
  opacity: 0.9;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.blog-card-body {
  background: #ffffff;
  padding: 40px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  justify-content: flex-start;
}

.blog-card-category {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0e9e76;
  margin: 0 0 10px;
}

.blog-card-title {
  font-size: 28px;
  font-weight: 700;
  color: #0d2137;
  line-height: 1.25;
  margin: 0 0 16px;
}

.blog-card-title a {
  color: #0d2137;
  text-decoration: none;
}

.blog-card-title a:hover {
  color: #0e9e76;
}

.blog-card-excerpt {
  font-size: 16px;
  color: #4a5568;
  line-height: 1.7;
  flex: 1 1 auto;
  margin: 0 0 20px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-spacer {
  flex: 1 1 auto;
  min-height: 24px;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
  margin-top: auto;
}

.blog-card-author-info {
  font-size: 12px;
  color: #94a3b8;
}

.blog-card-read-more {
  font-size: 13px;
  font-weight: 600;
  color: #0e9e76;
  text-decoration: none;
  white-space: nowrap;
}

.blog-card-read-more:hover {
  color: #0d2137;
}

/* .blog-card-featured kept for semantics / future overrides; layout is default .blog-card */

.blog-empty {
  width: 100%;
  text-align: center;
  padding: 48px 24px;
  background: #f8fafc;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
  .blog-grid {
    padding: 32px 16px 48px;
  }

  .blog-card {
    flex-direction: column;
    min-height: 0;
  }

  .blog-card-img-link {
    flex: none;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 0;
    align-self: auto;
  }

  .blog-card-img-link::after {
    background:
      linear-gradient(to bottom, rgba(13, 33, 55, 0.1) 0%, transparent 16%),
      linear-gradient(
        to bottom,
        transparent 50%,
        rgba(255, 255, 255, 0.35) 78%,
        rgba(255, 255, 255, 0.92) 92%,
        #ffffff 100%
      );
  }

  .blog-card-body {
    padding: 24px;
  }

  .blog-card-title {
    font-size: 22px;
  }

  .blog-hero {
    padding: 56px 16px 40px;
  }
}
