/* Homepage additions: topic grid + lead-category strip.
   Loaded only by posts/index on the home route (pushed via @push('head')). */

.topic-section,
.lead-section {
  padding: var(--space-2xl) 0 var(--space-sm);
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-md);
}

.topic-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.topic-card:hover,
.topic-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.topic-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  padding-right: 28px;
}

.topic-count {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.topic-arrow {
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--primary);
  font-size: 1.1rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s;
}

.topic-card:hover .topic-arrow,
.topic-card:focus-visible .topic-arrow {
  opacity: 1;
  transform: translateX(0);
}

.lead-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}

.lead-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
}

.lead-card-date {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
}

.lead-card h3 {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
}

.lead-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.lead-card h3 a:hover,
.lead-card h3 a:focus-visible {
  color: var(--primary);
}

.lead-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* The hero's third stat is a date, not a number, so it should not be
   monospaced/tabular like the animated counters. */
.hero-stats .stat-num.stat-text {
  font-variant-numeric: normal;
  letter-spacing: 0;
}

@media (max-width: 640px) {
  .topic-grid,
  .lead-grid {
    grid-template-columns: 1fr;
  }
}
