/*
  CSS variables for consistent theming
*/
:root {
  --primary-color: #2563eb;
  --background-color: #f8fafc;
  --card-background: #ffffff;
  --text-color: #0f172a;
  --muted-text: #64748b;
}

/*
  Base page styling
*/
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
}

/*
  Centered layout container
*/
.container {
  max-width: 900px;
  margin: auto;
  padding: 1.5rem;
}

/*
  Page heading
*/
h1 {
  text-align: center;
  margin-bottom: 1.25rem;
}

/*
  Search bar layout
*/
.search-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

/*
  Search input field
*/
.search-bar input {
  flex: 1;
  padding: 0.75rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

/*
  Search button
*/
.search-bar button {
  padding: 0.75rem 1.2rem;
  font-size: 1rem;
  background-color: var(--primary-color);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/*
  Date filter container
*/
.date-filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

/*
  Date filter labels
*/
.date-filters label {
  font-size: 0.9rem;
  color: var(--muted-text);
}

/*
  Date inputs
*/
.date-filters input {
  margin-left: 0.4rem;
  padding: 0.4rem;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
}

/*
  Results grid layout
*/
.results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/*
  Individual article card
*/
.card {
  background-color: var(--card-background);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/*
  Article title link
*/
.card a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}

/*
  Link hover effect
*/
.card a:hover {
  text-decoration: underline;
}

/*
  Article metadata text
*/
.meta {
  font-size: 0.85rem;
  color: var(--muted-text);
  margin-top: 0.3rem;
}

/*
  Responsive grid for larger screens
*/
@media (min-width: 768px) {
  .results {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .results {
    grid-template-columns: repeat(3, 1fr);
  }
}