/* Homepage Styles */
.hero {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  padding: 4rem 2rem;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary);
  line-height: 1.2;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.columns-section {
  margin-bottom: 4rem;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 2rem;
  color: var(--primary);
}

.columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.feed-section {
  margin-bottom: 4rem;
}

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.feed-controls {
  display: flex;
  gap: 1rem;
}

.feed-control {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition-base);
}

.feed-control:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.feed-control.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.articles-list {
  display: flex;
  flex-direction: column;
}

.view-all {
  display: inline-block;
  color: var(--accent);
  font-weight: 500;
  margin-top: 1rem;
}

.view-all:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .hero {
    padding: 3rem 1rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .columns-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .feed-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .feed-controls {
    width: 100%;
    flex-wrap: wrap;
  }
}

/* ── Home Search Bar ─────────────────────────────────── */
.home-search-bar {
  margin-top: 2rem;
}

.home-search-group {
  display: flex;
  gap: 0.5rem;
  max-width: 560px;
  margin: 0 auto;
}

.home-search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  background: white;
}

.home-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ── Topics Section ──────────────────────────────────── */
.home-topics {
  padding: 2.5rem 2rem 3rem;
}

/* Tab navigation */
.home-tabs-nav {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.home-tab {
  padding: 0.6rem 1.25rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition-base), border-color var(--transition-base);
  white-space: nowrap;
}

.home-tab:hover {
  color: var(--accent);
}

.home-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Tab panels */
.home-tab-panels {
  min-height: 200px;
}

.home-tab-panel {
  display: none;
}

.home-tab-panel.active {
  display: block;
}

.home-tab-empty {
  color: var(--text-secondary);
  text-align: center;
  padding: 3rem 0;
}

/* Latest Articles section on home page */
.home-latest-articles {
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.home-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}

.home-section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.home-section-link {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.home-section-link:hover {
  text-decoration: underline;
}

.home-articles-count {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.home-articles-pagination {
  text-align: center;
  margin-top: 1.5rem;
}

/* Articles index page */
.page-header {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.page-header-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--primary);
}

.page-header-description {
  color: var(--text-secondary);
  margin: 0;
}

.articles-pagination {
  text-align: center;
  margin: 2rem 0;
}

@media (max-width: 640px) {
  .home-search-group {
    flex-direction: column;
  }

  .home-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }

  .home-section-header {
    flex-direction: column;
    gap: 0.4rem;
  }

}