/* Page Header */
.page-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 6rem 0 4rem;
  position: relative;
  overflow: hidden;
  margin-top: 76px; /* Compensation pour navbar fixe */
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grain)"/></svg>');
}

.page-header-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.page-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 1.3rem;
  opacity: 0.9;
  font-weight: 300;
}

/* Filters Section */
.filters-section {
  background: white;
  padding: 2rem 0;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
  /* Suppression du sticky qui pose problème */
}

.search-container {
  max-width: 600px;
  margin: 0 auto 2rem;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 1rem 1.5rem 1rem 3rem;
  border: 2px solid var(--border);
  border-radius: 50px;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  background: var(--light);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
  background: white;
}

.search-icon {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.2rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.filter-select {
  padding: 0.8rem 1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: white;
  transition: all 0.3s ease;
  font-weight: 500;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Tags Cloud */
.tags-section {
  text-align: center;
  margin-bottom: 1rem;
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.tag-filter {
  background: var(--light);
  color: var(--dark);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  cursor: pointer;
}

.tag-filter:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  text-decoration: none;
}

.tag-filter.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.tag-filter .tag-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

/* Results Header */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2rem 0 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-info {
  color: var(--muted);
  font-weight: 500;
}

.results-count {
  color: var(--primary);
  font-weight: 700;
}

.view-toggle {
  display: flex;
  background: var(--light);
  border-radius: 10px;
  padding: 0.3rem;
}

.view-btn {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: var(--muted);
  transition: all 0.3s ease;
  font-weight: 500;
}

.view-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sort-select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

/* Articles Grid */
.articles-container {
  min-height: 500px;
}

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

.articles-list {
  display: none;
}

.articles-list.active {
  display: block !important;
}

.articles-grid.active {
  display: grid !important;
}

/* Article Card */
.article-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.article-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 102, 204, 0.15);
}

.article-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.article-card:hover .article-image {
  transform: scale(1.05);
}

.article-content {
  padding: 1.5rem;
}

.article-category {
  display: inline-block;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

.article-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.8rem;
  line-height: 1.3;
}

.article-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.article-title a:hover {
  color: var(--primary);
}

.article-excerpt {
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.article-tag {
  background: var(--light);
  color: var(--dark);
  padding: 0.3rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.article-tag:hover {
  background: var(--primary);
  color: white;
  text-decoration: none;
}

.article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.read-more {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.read-more:hover {
  color: var(--secondary);
  gap: 0.8rem;
}

.article-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* List View */
.article-list-item {
  background: white;
  border-radius: 15px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border-left: 4px solid var(--primary);
}

.article-list-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 102, 204, 0.15);
}

.list-content {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

.list-image {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
}

.list-info h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.list-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.list-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

/* Pagination */
.pagination-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding: 2rem 0;
}

.pagination {
  display: flex;
  gap: 0.5rem;
}

.page-btn {
  background: white;
  border: 2px solid var(--border);
  color: var(--dark);
  padding: 0.8rem 1rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  min-width: 45px;
  text-align: center;
}

.page-btn:hover,
.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  text-decoration: none;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading State */
.loading-container {
  text-align: center;
  padding: 3rem;
  color: var(--muted);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* No Results */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}

.no-results-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .page-title {
    font-size: 2.5rem;
  }

  .page-header {
    padding: 3rem 0 2rem;
    margin-top: 56px; /* Navbar mobile plus petite */
  }

  .filters-section {
    padding: 1.5rem 0;
  }

  .search-container {
    margin-bottom: 1.5rem;
  }

  .filters-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .results-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .view-toggle {
    order: 2;
    justify-content: center;
  }

  .sort-select {
    order: 1;
    width: 100%;
  }

  .list-content {
    grid-template-columns: 1fr !important;
    gap: 1rem;
    text-align: left;
  }

  .list-image {
    width: 100% !important;
    height: 200px !important;
  }

  .list-actions {
    justify-self: stretch;
    text-align: center;
  }

  .pagination-wrapper {
    flex-direction: column;
    gap: 1rem;
  }

  .tags-cloud {
    justify-content: flex-start;
  }

  .search-input {
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    font-size: 1rem;
  }

  .article-meta {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .meta-item {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .page-header {
    padding: 2rem 0 1.5rem;
    margin-top: 56px;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .page-subtitle {
    font-size: 1rem;
  }

  .article-card {
    border-radius: 15px;
  }

  .article-content {
    padding: 1.2rem;
  }

  .article-title {
    font-size: 1.2rem;
  }

  .search-input {
    padding: 0.7rem 0.8rem 0.7rem 2.2rem;
    font-size: 0.9rem;
  }

  .filter-select {
    padding: 0.7rem 0.8rem;
    font-size: 0.9rem;
  }

  .tags-cloud {
    gap: 0.3rem;
  }

  .tag-filter {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .view-toggle {
    padding: 0.2rem;
  }

  .view-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
}