body.light {
  background: #f4f4f4;
  color: #222;
}

body.dark {
  background: #121212;
  color: #f4f4f4;
}

header {
  padding: 1rem;
  text-align: center;
}

.controls {
  margin-top: 0.5rem;
}

button {
  margin: 0.2rem;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(300px,1fr));
  gap: 1rem;
  padding: 1rem;
}

.news-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s;
}

body.dark .news-card {
  background: #1e1e1e;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.news-card:hover {
  transform: translateY(-5px);
}

.news-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: #ccc;
}

.news-card .card-content {
  padding: 0.5rem;
}

.news-card .card-content h3 {
  font-size: 1.1rem;
  margin: 0.3rem 0;
}

.news-card .card-content p {
  font-size: 0.9rem;
  color: #555;
}

body.dark .news-card .card-content p {
  color: #ccc;
}

.source {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #888;
}

body.dark .source {
  color: #aaa;
}

.loading {
  text-align: center;
  padding: 1rem;
  display: none;
}
