#blog-listing {
  position: relative;
  width: 100%;
}

/* --- Search Bar --- */
.search-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.search-bar:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.search-bar input {
  width: 100%;
  outline: none;
  border: none;
  background: transparent;
  color: white;
  font-size: 1rem;
}

.search-bar input::placeholder {
  color: #9ca3af;
}

/* --- Navigation / Categories (Tab Style) --- */
#blog-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1px;
  margin-bottom: 3rem;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #9ca3af;
  /* Text muted */
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-chip:hover {
  color: white;
}

.category-chip.active {
  color: white;
  border-bottom-color: #6366f1;
  /* Indigo-500 */
}

.category-chip i {
  display: none;
  /* Hide icons for cleaner look */
}

/* --- Featured Card (Horizontal Split) --- */
.featured-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  /* Content | Image */
  min-height: 480px;
  margin-bottom: 4rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(99, 102, 241, 0.3);
}

.featured-badge {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: #6366f1;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.featured-card-content {
  padding: 3.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  order: 1;
}

.featured-visual {
  position: relative;
  height: 100%;
  order: 2;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
}

.featured-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1.5rem;
  transition: transform 0.7s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

.featured-eyebrow {
  display: inline-block;
  margin-bottom: 1.5rem;
  padding: 0.5rem 1rem;
  border-radius: 99px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  font-weight: 600;
  font-size: 0.875rem;
  width: fit-content;
}

.featured-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  color: white;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.featured-excerpt {
  color: #d1d5db;
  font-size: 1.125rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 90%;
}

.featured-meta {
  display: flex;
  gap: 1.5rem;
  color: #9ca3af;
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}

.featured-actions {
  display: flex;
  gap: 1rem;
}

.featured-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #818cf8;
  font-weight: 600;
  font-size: 1.05rem;
  transition: gap 0.2s ease;
}

.featured-card:hover .featured-primary {
  gap: 0.75rem;
}

/* --- Standard Blog Cards --- */
#blog-articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: transparent;
  border-radius: 1rem;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-8px);
}

.blog-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

.blog-card img {
  width: 100%;
  height: 240px;
  /* Taller images */
  object-fit: cover;
  border-radius: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

.blog-card:hover img {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

.blog-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
  color: white;
  margin-bottom: 0.75rem;
  transition: color 0.2s ease;
}

.blog-card:hover .blog-card-title {
  color: #818cf8;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .featured-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .featured-visual {
    height: 300px;
    order: 1;
  }

  .featured-card-content {
    order: 2;
    padding: 2rem;
  }

  .featured-title {
    font-size: 2rem;
  }

  #blog-articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  #blog-category-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 1rem;
    padding-bottom: 0.5rem;
    /* Add padding to account for scrollbar space if visible */
    margin-bottom: 2.5rem;
    /* Scrollbar hiding */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
  }

  #blog-category-chips::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
  }

  .category-chip {
    white-space: nowrap;
    /* Prevent text wrapping inside chips */
    flex-shrink: 0;
    /* Prevent shrinking */
  }

  .featured-badge {
    top: 1rem;
    right: 1rem;
  }
}


@media (max-width: 640px) {
  #blog-articles-grid {
    grid-template-columns: 1fr;
  }

  .featured-title {
    font-size: 1.75rem;
  }
}

/* --- Empty State / Utilities --- */
#blog-listing.is-empty #blog-featured,
#blog-listing.is-empty #blog-category-chips,
#blog-listing.is-empty #blog-articles-grid,
#blog-listing.is-empty #blog-evergreen,
#blog-listing.is-empty #blog-cta-banner,
#blog-listing.is-empty #blog-newsletter,
#blog-listing.is-empty #blog-search-wrapper {
  display: none;
}

#blog-listing.is-empty #blog-empty-state {
  display: block;
}

#blog-empty-state {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}