:root {
  --primary: #e8a121;
  --secondary: #3e2f22;
  --light: #f9f4ea; /* Couleur de fond principale de la page */
  --dark: #222222;
  --accent: #73480f;
  --transition: all 0.3s ease;
  --featured-link-bg: #f2eee4; /* Nouvelle variable pour le fond des liens "featured" */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--light);
  color: var(--dark);
  line-height: 1.6;
}

header {
  background-color: var(--secondary);
  color: white;
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.logo span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary);
}

.search-icon {
  cursor: pointer;
  font-size: 1.2rem;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.hero {
  position: relative;
  height: 500px;
  
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  margin-bottom: 3rem;
}

.hero-content {
  padding: 2rem;
  color: white;
  width: 100%;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: url('logo.png') center/cover no-repeat; 
}

.share-buttons {
  display: flex;
  gap: 0.5rem;
}

.share-btn, .share-btn-1 { /* Combinaison des sélecteurs pour des propriétés communes */
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.share-btn {
  background-color: black; /* Spécifique à .share-btn */
}
.share-btn-1 {
  background-color: white; /* Spécifique à .share-btn-1 */
  color: black; /* Pour que le 'f' soit visible */
}	

.share-btn:hover, .share-btn-1:hover { /* Style de survol commun */
  background-color: var(--primary);
  color: white; /* Assure que le texte change aussi de couleur au survol */
}

.table-of-contents {
  background-color: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 3rem;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.toc-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--secondary);
  font-weight: 600;
}

.toc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.toc-link {
  background-color: var(--light); /* Fond par défaut pour les liens TOC (comme dans la table des matières de l'article) */
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--dark);
  font-weight: 500;
  transition: var(--transition);
  flex: 1; /* Grandit pour remplir l'espace dans un conteneur flex */
  min-width: 200px; /* Garde une largeur minimale sur les grands écrans */
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  text-align: center; /* Centre le texte à l'intérieur du lien */
}

.toc-link:hover {
  background-color: var(--primary);
  color: white;
  transform: translateY(-3px);
}

/* Styles spécifiques pour les liens dans .featured-items-grid sur la page d'accueil */
.featured-items-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  justify-content: center;
}

.featured-items-grid .toc-link {
  background-color: var(--featured-link-bg); /* Utilise la nouvelle variable pour un fond distinct */
  flex-grow: 1; 
  flex-basis: 200px; 
  min-width: 180px; /* Légèrement réduit pour plus de flexibilité */
  /* Les autres propriétés de .toc-link sont héritées ou peuvent être surchargées ici si besoin */
}


article {
  display: grid;
  grid-template-columns: 1fr; /* Par défaut une seule colonne */
  gap: 3rem;
}

@media (min-width: 992px) {
  article {
    grid-template-columns: 3fr 1fr; /* Deux colonnes sur les grands écrans */
  }
}

.article-content { /* Concerne le contenu principal de l'article */
  background-color: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.homepage-category { /* Concerne les sections de catégorie sur la page d'accueil */
  background-color: white;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.section { /* Utilisé dans les articles */
  margin-bottom: 3rem;
}

.section-title { /* Titres de section dans les articles et sur la page d'accueil */
  font-size: 1.8rem;
  color: var(--secondary);
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--primary);
}

.fact-card {
  background-color: var(--light);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.fact-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.fact-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 5px;
  background-color: var(--primary);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

.comparison-table th,
.comparison-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.comparison-table th {
  background-color: var(--secondary);
  color: white;
}

.comparison-table tr:hover {
  background-color: #f9f9f9;
}

.img-container {
  margin: 2rem 0;
  border-radius: 12px;
  overflow: hidden;
}

.img-container img {
  width: 100%;
  height: auto;
  display: block; /* Enlève l'espace sous l'image */
  transition: var(--transition);
}

.img-container:hover img {
  transform: scale(1.03);
}

.sidebar {
  position: sticky;
  top: 100px; /* Ajustez en fonction de la hauteur de votre header sticky */
}

.sidebar-section {
  background-color: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.sidebar-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--secondary);
  font-weight: 600;
}

.related-list {
  list-style: none;
  /* padding: 0; déjà fait par * {} */
}

.related-list li {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.related-list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.related-list a {
  text-decoration: none;
  color: var(--dark);
  font-weight: 500;
  transition: var(--transition);
  display: block;
}

.related-list a:hover {
  color: var(--primary);
}

.ad-container {
  text-align: center;
}

.ad-unit {
  
  margin: 0 auto; 
  width: 336px;
  height: 280px; 
}

.conclusion {
  background-color: var(--secondary);
  color: white;
  padding: 2rem;
  border-radius: 12px;
  margin-top: 3rem;
}

.conclusion-title {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

/* Styles pour le footer amélioré */
footer {
  background-color: var(--secondary);
  color: white;
  padding: 2rem 1rem;
  margin-top: 3rem;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px 25px;
}

.footer-links li a {
  color: #f0f0f0;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-links li a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.copyright-text {
  font-size: 0.85rem;
  color: #ccc;
  margin-bottom: 1rem;
}

.social-icons {
  margin-top: 1rem;
}

.social-icons a {
  margin: 0 10px;
  display: inline-block;
}

.social-icons img {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.social-icons img:hover {
  opacity: 1;
}

.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  transition: var(--transition);
}

.scroll-top:hover {
  transform: translateY(-5px);
}

/* Progress bar */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  z-index: 200;
}

.progress-bar {
  height: 5px;
  background-color: var(--primary);
  width: 0;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.section, .homepage-category { /* Appliquer l'animation aussi aux catégories de la page d'accueil */
  animation: fadeIn 0.5s ease-out;
}

/* Dark mode toggle (si vous l'utilisez) */
.dark-mode-toggle {
  position: fixed;
  bottom: 90px; /* Ajustez si le bouton scroll-top est présent */
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--secondary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  transition: var(--transition);
}

.dark-mode-toggle:hover {
  transform: scale(1.1);
}


/* === Media Queries === */

@media (max-width: 991px) { /* Point de rupture pour la sidebar qui disparaît ou passe en dessous */
  article {
    grid-template-columns: 1fr; /* S'assure que c'est une seule colonne */
  }
  .sidebar {
    position: static; /* Enlève le sticky pour qu'elle suive le flux normal */
    top: auto;
    margin-top: 2rem; /* Ajoute un peu d'espace si elle est sous le contenu principal */
  }
}


@media (max-width: 768px) {
  .hero {
    height: 350px;
  }

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

  .section-title {
    font-size: 1.5rem;
  }

  .footer-links {
    flex-direction: column; 
    gap: 10px; 
  }
}

@media (max-width: 576px) {
  .nav-links {
    display: none; /* Cache les liens de navigation principaux */
    /* Vous pourriez vouloir un menu burger ici à la place */
  }

  .hero {
    height: 250px;
    margin-bottom: 2rem;
  }

  .hero-content {
    padding: 1rem;
  }
  
  .hero h1 {
    font-size: 1.5rem; /* Réduit encore la taille du H1 dans le hero */
  }

  .article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .featured-items-grid {
    flex-direction: column; /* Empile les liens verticalement */
    gap: 0.75rem; 
  }

  .featured-items-grid .toc-link {
    min-width: 0; 
    width: 100%; 
    flex-basis: auto; 
  }

  .section-title {
    font-size: 1.3rem; /* Réduit la taille des titres de section */
  }
}