body {
  background-color: #F4F6F8;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
  font-family: Arial, sans-serif;
  color: #333;
}

.container h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: #CC7700;
}

.api-news-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
}

.api-news-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  background-color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
  color: inherit;
}

.api-news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.api-news-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.api-news-card .card-content {
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.api-news-card h4 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem 0;
  color: #000;
  line-height: 1.3;
}

.api-news-card .meta {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.api-news-card a {
  margin-top: auto;
  font-size: 0.9rem;
  color: #CC7700;
  text-decoration: none;
  font-weight: bold;
}

.api-news-card a:hover {
  text-decoration: underline;
}

@media (max-width: 1024px) {
  .api-news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .api-news-grid {
    grid-template-columns: 1fr;
  }

  .api-news-card img {
    height: 140px;
  }

  .api-news-card .card-content {
    padding: 1rem;
  }
}


/* Container styling */
/* Container */
#trending-news {
  background: #f7f7f7;
  padding: 2rem 1rem;
  font-family: Arial, sans-serif;
  
}

#trending-news .container {
  max-width: 1200px;
  margin: 0 auto;
}

#trending-news h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #ccc;
  padding-bottom: 0.5rem;
}

/* —— NEWS GRID now uses horizontal “featured” style —— */
.news-grid {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.news-grid > a {
  display: flex;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.news-grid > a:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.news-grid img {
  width: 120px;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
}

.news-grid .content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.news-grid .content h4 {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
}

.news-grid .content p {
  color: #555;
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.news-grid .content small {
  color: #999;
  font-size: 0.8rem;
}

/* —— FEATURED NEWS now uses grid “news-grid” style —— */
.featured-news {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.featured-news > a {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.3s ease;
}

.featured-news > a:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.featured-news img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.featured-news .content {
  padding: 0.8rem 1rem;
}

.featured-news .content h4 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.featured-news .content p {
  color: #555;
  font-size: 0.9rem;
  margin: 0 0 0.6rem;
}

.featured-news .content small {
  color: #999;
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  #trending-news {
    padding: 1.5rem 1rem;
  }

  #trending-news h2 {
    font-size: 1.3rem;
  }

  .featured-news {
    grid-template-columns: 1fr 1fr; /* 2 columns for small screens */
    gap: 1rem;
  }

  .featured-news img {
    height: 140px;
  }

  .featured-news .content h4 {
    font-size: 1rem;
  }

  .featured-news .content p {
    font-size: 0.85rem;
  }

  .news-grid > a {
    flex-direction: column;
  }

  .news-grid img {
    width: 100%;
    height: 180px;
  }

  .news-grid .content {
    padding: 0.8rem 1rem;
  }

  .news-grid .content h4 {
    font-size: 1rem;
  }

  .news-grid .content p {
    font-size: 0.85rem;
  }

  .news-grid .content small {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .featured-news {
    grid-template-columns: 1fr; /* Stack vertically on very small screens */
  }

  .news-grid img {
    height: 160px;
  }

  .news-grid .content h4 {
    font-size: 0.95rem;
  }

  .news-grid .content p {
    font-size: 0.8rem;
  }
}
