/* ============================================================
   INDEX — home page specific styles
   Requires: style.css (base)
   ============================================================ */

/* --- Hero --- */

.hero {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(10,12,20,.75), rgba(24,26,36,.88)),
              url('../images/pc.png') center / cover no-repeat;
}

#matrix-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.35;
  pointer-events: none;
  display: block;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
  padding: 3rem;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-heading);
  color: #fff;
  font-size: clamp(2rem, 6vw, 3.5rem);
  margin-bottom: 0.5rem;
}

.hero p {
  color: #d7d7d7;
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

/* --- Featured post --- */

.featured-post {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.8rem;
  margin: 1.5rem 0;
}

.featured-post article {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
  align-items: center;
}

.featured-img {
  width: 100%;
  min-height: 200px;
  background: linear-gradient(135deg, #334, #112);
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

.featured-copy h2 {
  margin-top: 0;
  font-family: var(--font-heading);
}

.featured-copy .meta {
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* --- Recent posts --- */

.recent-posts {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.8rem;
  margin: 1.5rem 0;
}

.recent-posts h2 {
  margin-top: 0;
  font-family: var(--font-heading);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.post-card {
  background: var(--color-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  position: relative;
  transition: transform 0.18s ease, background 0.18s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  background: rgba(0, 255, 234, 0.05);
}

.post-img {
  width: 100%;
  min-height: 140px;
  background: linear-gradient(135deg, #334, #112);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  object-fit: cover;
  display: block;
}

.post-card h3 {
  margin: 0.4rem 0;
}

.post-card p {
  margin: 0.3rem 0 0.8rem;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.post-card .read-more {
  color: var(--color-primary);
  font-weight: var(--fw-bold);
  text-decoration: none;
}

/* Stretch the read-more link to cover the entire card */
.post-card .stretched-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

/* Featured post title link */
.featured-copy h2 a {
  color: inherit;
  text-decoration: none;
}

.featured-copy h2 a:hover {
  color: var(--color-primary);
}

/* --- Posts toolbar: search + filter chips --- */

.posts-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.search-input {
  flex: 1 1 220px;
  padding: 0.55rem 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #e8e8e8;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input::placeholder {
  color: var(--color-muted);
}

.search-input:focus {
  border-color: var(--color-primary);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--color-muted);
  font-size: 0.82rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.chip.active,
.chip:hover {
  background: var(--color-primary);
  color: #000;
  border-color: var(--color-primary);
}

.no-results {
  text-align: center;
  color: var(--color-muted);
  padding: 2rem 0;
  font-size: 1rem;
}
