/* ===========================
   0. Titre de la section
   =========================== */
.news-section {
  padding: 100px 20px 60px;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 200px);
}

.news-title {
  font-size: 2.5rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 3rem;
  color: #ffffff;
  background: linear-gradient(135deg, #EC9600, #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding-top: 20px;
}

/* ===========================
   1. Filtre (Pills Design)
   =========================== */
.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 120px 0 50px;
  flex-wrap: wrap;
}

.filter-buttons .btn {
  padding: 12px 28px;
  border-radius: 50px;
  /* Pill shape */
  text-decoration: none;
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.05);
  /* Glass feel attempt */
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #aaa;
  transition: all 0.3s ease;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.filter-buttons .btn:hover {
  background-color: rgba(236, 150, 0, 0.2);
  color: #EC9600;
  border-color: #EC9600;
  transform: translateY(-2px);
}

.filter-buttons .btn.active {
  background-color: #EC9600;
  color: #fff;
  border-color: #EC9600;
  box-shadow: 0 4px 15px rgba(236, 150, 0, 0.4);
}

/* ===========================
   2. Grille d’articles (Premium Grid)
   =========================== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hardened News Card Styles - FINAL VERTICAL FIX */
.news-grid .news-card {
  display: flex;
  flex-direction: column;
  width: 100% !important;
  border: 1px solid #333;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: white;
  background-color: #1a1a1a;
  transition: transform 0.3s ease;
  position: relative;
}

.news-grid .news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  background-color: #222;
}

.news-grid .news-img-wrapper {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border-bottom: none !important;
  flex-shrink: 0 !important;
  border-radius: 8px;
  /* Added aesthetic */
  overflow: hidden;
  background-color: #2a2a2a;
  /* Fallback color */
  margin-bottom: 15px !important;
  /* Spacing from title */
}

/* Safety: hide empty wrappers if JS/PHP fails */
.news-grid .news-img-wrapper:empty {
  display: none !important;
}

.news-grid .news-card img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block !important;
}

.news-grid .news-content {
  display: flex !important;
  flex-direction: column !important;
  padding: 10px 15px 15px 15px !important;
  /* Tight top padding */
  width: 100% !important;
  box-sizing: border-box !important;
}

.news-grid .news-content h2 {
  margin: 0 0 5px 0 !important;
  font-size: 18px !important;
  line-height: 1.25 !important;
  color: #fff;
}

.news-meta {
  margin-bottom: 15px;
}

.news-content .date {
  font-size: 12px;
  text-transform: uppercase;
  color: #888;
  font-weight: 600;
  letter-spacing: 1px;
  display: inline-block;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.news-content p {
  font-size: 15px;
  color: #ccc;
  line-height: 1.6;
  margin: 0;
  opacity: 0.9;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===========================
   3. Styles des articles (Vue détaillée - inchangée mais nettoyée)
   =========================== */
.article-section {
  max-width: 900px;
  margin: 80px auto;
  padding: 40px;
  background-color: #1a1a1a;
  border-radius: 20px;
  color: #eee;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.article-section h1 {
  font-size: 42px;
  margin-bottom: 20px;
  color: #fff;
  line-height: 1.2;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 14px;
  color: #aaa;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid #333;
}

.article-meta .author {
  font-weight: 700;
  color: #EC9600;
}

.article-banner {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 40px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.article-content h2 {
  margin-top: 40px;
  font-size: 28px;
  color: #EC9600;
  margin-bottom: 20px;
}

.article-content p {
  margin-bottom: 24px;
  font-size: 18px;
  line-height: 1.8;
  color: #ddd;
}

.article-content a {
  color: #EC9600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.article-content a:hover {
  border-bottom-color: #EC9600;
}

.empty-message {
  text-align: center;
  font-size: 20px;
  color: #666;
  margin: 100px 0;
  font-style: italic;
}

.news-more {
  text-align: center;
  margin-top: 60px;
}

#loadMoreBtn {
  background: transparent;
  border: 1px solid #EC9600;
  color: #EC9600;
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 16px;
}

#loadMoreBtn:hover {
  background: #EC9600;
  color: white;
}


/* ===========================
   4. Responsive
   =========================== */
@media (max-width: 1024px) {
  .news-grid {
    gap: 30px;
  }
}

@media (max-width: 768px) {
  .news-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .filter-buttons {
    gap: 10px;
  }

  .filter-buttons .btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .article-section h1 {
    font-size: 32px;
  }
}

@media (max-width: 480px) {
  .news-grid {
    grid-template-columns: 1fr;
  }

  .news-content h2 {
    font-size: 18px;
  }

  .section-news {
    padding: 0 15px;
  }
}
/* Explicit hiding class for non-admin users */
.news-grid .news-card.hidden-article {
  display: none !important;
}
