/*
 * Core stylesheet for Andrew's article portfolio.
 * The color palette is inspired by the provided reference image: deep maroons
 * fading into rich reds, contrasted by near‑black backgrounds. Typography
 * leans toward a modern, condensed sans serif (Rajdhani) to evoke a
 * technology and futurism vibe reminiscent of the "Mr. Robot" aesthetic.
 */

/* CSS reset to ensure consistency across browsers */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: 'Rajdhani', sans-serif;
  background: linear-gradient(160deg, #20010c 0%, #3d0015 40%, #7a001b 100%);
  color: #f5f5f5;
}

a {
  color: inherit;
  text-decoration: none;
}

header {
  padding: 3rem 1rem 2rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 100%);
}

.site-title {
  font-size: 2.5rem;
  font-weight: 600;
  color: #f55;
  letter-spacing: 0.05em;
}

.subtitle {
  margin-top: 0.5rem;
  font-size: 1.1rem;
  color: #ccc;
}

main {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Controls: search bar and category filters */
.controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0;
  align-items: stretch;
}

/* Search input styling */
#searchInput {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid #3d0015;
  background-color: rgba(255,255,255,0.05);
  color: #f5f5f5;
  border-radius: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#searchInput::placeholder {
  color: #888;
}

#searchInput:focus {
  outline: none;
  border-color: #e63946;
  box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.5);
}

/* Filter buttons container */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  background-color: rgba(255,255,255,0.05);
  color: #ddd;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  font-weight: 500;
  text-transform: capitalize;
  letter-spacing: 0.5px;
}

.filter-btn.active,
.filter-btn:hover {
  background-color: #e63946;
  color: #fff;
}

/* Articles grid */
.articles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  padding-bottom: 4rem;
}

/* Individual article card */
.article-card {
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color 0.2s, transform 0.2s;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.article-card:hover {
  border-color: #e63946;
  transform: translateY(-4px);
}

.article-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #fff;
  line-height: 1.3;
  word-break: break-word;
}

.article-meta {
  font-size: 0.9rem;
  color: #999;
}

.article-category {
  color: #e63946;
  font-weight: 600;
}

.article-source {
  color: #aaa;
}

footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.9rem;
  color: #777;
  background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
}