/* ============================================================
   BLOG HUB — Bento Grid Content Feed
   palaverafrica.org/blog
   ============================================================ */

/* ── Layout Shell ────────────────────────────────── */
.blog-hub {
  background-color: var(--primary-color);
  min-height: 100vh;
  padding-bottom: 80px;
}

.blog-hub-header {
  padding: 120px 0 40px;
  text-align: center;
  position: relative;
}

.blog-hub-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--gold-muted);
  opacity: 0.4;
}

.blog-hub-title {
  font-family: var(--display-font-family);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: #fff;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  font-weight: 400;
}

.blog-hub-subtitle {
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-muted);
  opacity: 0.7;
  margin-bottom: 0;
}

/* ── Filter Pills ────────────────────────────────── */
.blog-filters {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 30px 0 50px;
  flex-wrap: wrap;
}

.blog-filters-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 20px;
}

.blog-filters-scroll::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
}

.filter-pill:hover {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

.filter-pill.active {
  background: var(--gold-muted);
  color: var(--primary-color);
  border-color: var(--gold-muted);
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(184, 155, 94, 0.25);
}

.filter-pill i {
  font-size: 0.85rem;
}

.filter-count {
  font-size: 0.65rem;
  opacity: 0.6;
  font-weight: 400;
}

/* ── Bento Grid ──────────────────────────────────── */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Bento Card Base ─────────────────────────────── */
.bento-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--secondary-color);
  border: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.bento-card:hover {
  transform: translateY(-4px);
  border-color: rgba(184, 155, 94, 0.15);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(184, 155, 94, 0.08);
}

.bento-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.bento-card-link:hover {
  color: inherit;
  text-decoration: none;
}

/* ── Card Image ──────────────────────────────────── */
.bento-card-visual {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.bento-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.bento-card:hover .bento-card-visual img {
  transform: scale(1.05);
}

.bento-card-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 30%,
    rgba(7, 7, 17, 0.7) 70%,
    rgba(7, 7, 17, 0.95) 100%
  );
  pointer-events: none;
}

/* ── Card Content ────────────────────────────────── */
.bento-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
  z-index: 2;
}

/* For image-heavy cards, content overlays the image */
.bento-card--overlay .bento-card-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px;
}

.bento-card-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 12px;
  width: fit-content;
}

/* Type badge colors */
.bento-card-type--article {
  background: rgba(184, 155, 94, 0.15);
  color: var(--gold-muted);
}

.bento-card-type--photo {
  background: rgba(99, 179, 237, 0.15);
  color: #63B3ED;
}

.bento-card-type--update {
  background: rgba(72, 187, 120, 0.15);
  color: #48BB78;
}

.bento-card-type--video {
  background: rgba(237, 100, 166, 0.15);
  color: #ED64A6;
}

.bento-card-type--report {
  background: rgba(159, 122, 234, 0.15);
  color: #9F7AEA;
}

.bento-card-title {
  font-family: var(--heading-font-family);
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bento-card-excerpt {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.82rem;
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-line-clamp: 3;
}

.bento-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.bento-card-author {
  font-size: 0.75rem;
  color: var(--gold-muted);
  font-weight: 500;
}

.bento-card-date {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  margin-left: auto;
}

/* ── Card Share Button ───────────────────────────── */
.bento-card-share {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.3s ease;
  font-size: 0.8rem;
}

.bento-card:hover .bento-card-share {
  opacity: 1;
  transform: translateY(0);
}

.bento-card-share:hover {
  background: var(--gold-muted);
  color: var(--primary-color);
  border-color: var(--gold-muted);
}

/* ── Card Size Variants (Content Type Sizing) ────── */

/* Article: editorial, wide, moderate height */
.bento-card--article {
  grid-column: span 3;
  grid-row: span 2;
}

.bento-card--article .bento-card-visual {
  height: 220px;
}

.bento-card--article .bento-card-title {
  font-size: 1.25rem;
  -webkit-line-clamp: 3;
}

/* Photo: large visual, image dominates */
.bento-card--photo {
  grid-column: span 3;
  grid-row: span 2;
}

.bento-card--photo .bento-card-visual {
  height: 100%;
  min-height: 340px;
}

.bento-card--photo .bento-card-title {
  font-size: 1.1rem;
  -webkit-line-clamp: 2;
}

/* Update: compact, text-first */
.bento-card--update {
  grid-column: span 2;
  grid-row: span 1;
}

.bento-card--update .bento-card-visual {
  height: 120px;
}

.bento-card--update .bento-card-title {
  font-size: 0.95rem;
  -webkit-line-clamp: 2;
}

.bento-card--update .bento-card-excerpt {
  -webkit-line-clamp: 2;
  font-size: 0.78rem;
}

/* Video: cinematic, wide */
.bento-card--video {
  grid-column: span 4;
  grid-row: span 2;
}

.bento-card--video .bento-card-visual {
  height: 260px;
}

.bento-card--video .bento-card-title {
  font-size: 1.3rem;
  -webkit-line-clamp: 2;
}

/* Video play icon overlay */
.bento-card--video .bento-card-visual::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  z-index: 2;
  transition: all 0.3s ease;
}

.bento-card--video .bento-card-visual::after {
  /* Override gradient for video — needs play button visible */
  background: linear-gradient(
    180deg,
    transparent 40%,
    rgba(7, 7, 17, 0.6) 70%,
    rgba(7, 7, 17, 0.9) 100%
  );
}

.bento-card--video:hover .bento-card-visual::before {
  background: rgba(184, 155, 94, 0.7);
  border-color: var(--gold-muted);
  transform: translate(-50%, -50%) scale(1.1);
}

/* Report: clean, document-like */
.bento-card--report {
  grid-column: span 3;
  grid-row: span 1;
}

.bento-card--report .bento-card-visual {
  height: 140px;
}

.bento-card--report .bento-card-title {
  font-size: 1rem;
  -webkit-line-clamp: 2;
}

.bento-card--report .bento-card-body {
  background: linear-gradient(135deg, var(--secondary-color) 0%, rgba(18, 18, 40, 0.95) 100%);
}

/* ── Featured / First Post Emphasis ──────────────── */
.bento-card--featured {
  grid-column: span 4;
  grid-row: span 2;
}

.bento-card--featured .bento-card-visual {
  height: 100%;
  min-height: 380px;
}

.bento-card--featured .bento-card-title {
  font-size: 1.6rem;
  -webkit-line-clamp: 3;
}

.bento-card--featured .bento-card-excerpt {
  -webkit-line-clamp: 3;
  font-size: 0.88rem;
}

/* ── Empty State ─────────────────────────────────── */
.bento-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
}

.bento-empty-icon {
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
}

.bento-empty-text {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

/* ── Loading Skeleton ────────────────────────────── */
.bento-skeleton {
  border-radius: 14px;
  background: var(--secondary-color);
  position: relative;
  overflow: hidden;
}

.bento-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.03) 50%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.bento-skeleton--large {
  grid-column: span 4;
  grid-row: span 2;
  min-height: 380px;
}

.bento-skeleton--medium {
  grid-column: span 3;
  grid-row: span 2;
  min-height: 300px;
}

.bento-skeleton--small {
  grid-column: span 2;
  grid-row: span 1;
  min-height: 200px;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 1200px) {
  .bento-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }

  .bento-card--featured { grid-column: span 4; }
  .bento-card--article { grid-column: span 2; }
  .bento-card--photo { grid-column: span 2; }
  .bento-card--video { grid-column: span 4; }
  .bento-card--update { grid-column: span 2; }
  .bento-card--report { grid-column: span 2; }
}

@media (max-width: 768px) {
  .blog-hub-header {
    padding: 100px 0 30px;
  }

  .blog-hub-title {
    font-size: 2.2rem;
  }

  .blog-filters {
    padding: 20px 0 30px;
    justify-content: flex-start;
  }

  .bento-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 16px;
  }

  /* All cards go full width on mobile */
  .bento-card--featured,
  .bento-card--article,
  .bento-card--photo,
  .bento-card--video,
  .bento-card--update,
  .bento-card--report {
    grid-column: span 1;
    grid-row: span 1;
  }

  .bento-card-visual {
    height: 200px !important;
    min-height: unset !important;
  }

  .bento-card--photo .bento-card-visual {
    height: 260px !important;
  }

  .bento-card-share {
    opacity: 1;
    transform: translateY(0);
  }

  .bento-card-title {
    font-size: 1.05rem !important;
  }

  .filter-pill {
    padding: 6px 14px;
    font-size: 0.68rem;
  }

  .bento-skeleton--large,
  .bento-skeleton--medium,
  .bento-skeleton--small {
    grid-column: span 1;
    grid-row: span 1;
    min-height: 200px;
  }
}

@media (max-width: 480px) {
  .blog-hub-header {
    padding: 80px 0 20px;
  }

  .blog-hub-title {
    font-size: 1.8rem;
  }

  .bento-card-body {
    padding: 16px;
  }

  .bento-card-visual {
    height: 170px !important;
  }
}
