/* --- Début : Réinitialisation et Box Sizing Global --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Variables CSS (Palette pour Cafards - Option A implicite) --- */
:root {
  /* Couleurs pour le thème Cafards */
  --primary-color: #5D4037;  /* Brun foncé principal */
  --secondary-color: #795548; /* Brun moyen */
  --accent-color: #A1887F;   /* Brun clair / Taupe pour accents */
  --light-accent-color: #D7CCC8; /* Gris-brun très clair / Beige pour texte sur fond sombre */

  --background-main: #F5F5F5; /* Fond général très clair, grisâtre (pour body/main-container) */
  --background-content: #FFFFFF; /* Fond des sections de contenu (cartes blanches) */
  --text-color: #212121; /* Texte presque noir pour bon contraste */
  --text-light: #FFFFFF; /* Texte blanc */

  --header-height-desktop: 70px; /* Hauteur desktop */
  --header-height-mobile: 80px; /* Hauteur mobile (ajustée) */

  /* Mapping des variables pour cohérence */
  --header-footer-bg: var(--primary-color);
  --nav-bg: var(--secondary-color);
  --nav-text: var(--text-light);
  --heading-color: var(--primary-color);
  --link-color: var(--secondary-color);
  --link-hover-color: #8D6E63;

  --border-color: #DCDCDC;
  --highlight-box-bg: #EFEBE9;
  --highlight-box-border: var(--secondary-color);
  --shadow-color: rgba(0, 0, 0, 0.08);
}

/* --- Styles Généraux du Corps --- */
body {
  font-family: 'Open Sans', 'Roboto', sans-serif;
  background-color: var(--background-main);
  color: var(--text-color);
  line-height: 1.7;
  overflow-x: hidden;
  padding-top: var(--header-height-desktop);
}

/* --- Header --- */
header {
  background-color: var(--header-footer-bg);
  padding: 0 20px;
  box-shadow: 0 2px 5px var(--shadow-color);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000; /* Header au-dessus de tout sauf menu mobile ouvert si besoin */
  height: var(--header-height-desktop);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 15px;
}

.logo-and-title-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-light);
    margin-right: auto;
}

.logo {
  max-height: 50px;
  margin-right: 15px;
  flex-shrink: 0;
}

h1.site-main-title {
  font-family: 'Roboto', 'Montserrat', sans-serif;
  font-size: 1.8em;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  padding: 0;
  border: none;
  color: var(--text-light);
}

/* Styles pour la navigation principale (Desktop) */
nav.main-header-nav {
    display: flex; /* Visible et flex sur desktop par défaut */
    align-items: center; /* Bon pour l'alignement vertical des items */
}
nav.main-header-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex; /* Les li en ligne */
}
nav.main-header-nav li {
    margin-left: 15px;
}
nav.main-header-nav a {
    color: var(--nav-text);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 0.9em;
	white-space: nowrap;
}
nav.main-header-nav a:hover,
nav.main-header-nav a.active-main-link {
    background-color: rgba(255,255,255,0.15);
    color: var(--text-light);
}

.mobile-menu-button {
    display: none; /* Caché sur desktop par défaut */
    background: none;
    border: none;
    color: var(--nav-text);
    font-size: 1.8em;
    cursor: pointer;
    padding: 5px;
    margin-left: 15px;
}

/* --- Navigation Rapide (Sticky) --- */
.nav-quick-links {
  background-color: var(--nav-bg);
  text-align: center;
  padding: 12px 10px;
  position: sticky;
  top: var(--header-height-desktop);
  z-index: 999;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-quick-links a {
  color: var(--nav-text);
  text-decoration: none;
  margin: 0 12px;
  font-weight: bold;
  transition: color 0.3s ease, background-color 0.3s ease;
  padding: 8px 12px;
  border-radius: 4px;
  display: inline-block;
}
.nav-quick-links a.active {
  background-color: rgba(0,0,0,0.2);
  color: var(--text-light);
}
.nav-quick-links a:hover {
  background-color: rgba(0,0,0,0.1);
  color: var(--text-light);
}

/* --- Conteneur Principal (Flexbox) --- */
.main-container {
  display: flex;
  max-width: 1280px;
  margin: 20px auto;
  padding: 0 20px;
  gap: 30px;
  align-items: flex-start;
}

/* --- Sidebar --- */
.sidebar {
  width: 360px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-height-desktop) + 48px + 20px); /* VÉRIFIER 48px avec hauteur réelle de .nav-quick-links */
}

.ads-sidebar, .sidebar-widget {
  background-color: var(--background-content);
  padding: 5px;
  border-radius: 8px;
  box-shadow: 0 2px 5px var(--shadow-color);
  margin-bottom: 25px;
  border: 1px solid var(--border-color);
}

.ads-sidebar ins.adsbygoogle {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}
/* Dans style-cafards-final.css */

/* Styles généraux pour les H2 du contenu principal (exemple) */
.content-section h2 {
  font-size: 1.8em; /* Plus grand */
  color: var(--heading-color);
  border-bottom: 2px solid var(--secondary-color);
  /* ... autres styles ... */
}

/* Styles SPÉCIFIQUES pour les H2 dans la sidebar */
.sidebar-widget h2 {
  font-size: 1.2em; /* Plus petit, comme votre H3 actuel */
  color: var(--heading-color); /* Ou une couleur différente si vous le souhaitez */
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-top: 0;
  margin-bottom: 15px;
  font-weight: bold; /* Similaire à <strong> */
  font-family: 'Roboto', 'Montserrat', sans-serif; /* Cohérence police */

}

.sidebar-widget h3 {
    margin-top: 0;
    color: var(--heading-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    font-size: 1.2em;
    margin-bottom: 15px;
}
.sidebar-widget ul { list-style: none; padding: 0; margin: 0; }
.sidebar-widget ul li { margin-bottom: 10px; }
.sidebar-widget ul li a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.95em;
}
.sidebar-widget ul li a:hover {
    text-decoration: underline;
    color: var(--link-hover-color);
}

/* --- Contenu Principal et Sections --- */
.content {
  flex: 1;
  padding: 0;
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
  margin-top: 0;
}

.content-section {
  background-color: var(--background-content);
  padding: 25px 30px;
  margin-bottom: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 5px var(--shadow-color);
}
.content > .content-section:first-child {
  margin-top: 0;
}
.content-section:last-child {
  margin-bottom: 0;
}
.content-section > h2:first-child {
  margin-top: 0;
}

/* Animation d'Apparition */
.interactive-element {
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  opacity: 0;
  transform: translateY(20px);
}
.interactive-element.fade-in-visible {
  opacity: 1;
  transform: translateY(0);
}
.no-js .interactive-element {
    opacity: 1;
    transform: translateY(0);
}

/* --- Titres dans le Contenu (H2, H3, H4) --- */
.content-section h2, .content-section h3, .content-section h4 {
  color: var(--heading-color);
  padding-bottom: 10px;
  margin-bottom: 20px;
  font-family: 'Roboto', 'Montserrat', sans-serif;
}
.content-section h2 {
  font-size: 1.8em;
  border-bottom: 2px solid var(--secondary-color);
}
.content-section h3 {
  font-size: 1.5em;
  color: var(--secondary-color);
  border-bottom: 1px dashed var(--border-color);
  margin-top: 30px;
}
.content-section h4 {
  font-size: 1.25em;
  color: var(--heading-color);
  font-weight: bold;
  margin-top: 25px;
  margin-bottom: 15px;
  border-bottom: none;
}

/* Styles pour highlight-box et stats-grid */
.highlight-box {
  background-color: var(--highlight-box-bg);
  border-left: 5px solid var(--highlight-box-border);
  padding: 20px;
  margin: 25px 0;
  border-radius: 0 5px 5px 0;
}
.highlight-box h3 {
  color: var(--secondary-color);
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.3em;
  border-bottom: none;
}
.highlight-box ul { padding-left: 20px; margin-bottom: 0; }
.highlight-box ul li { margin-bottom: 8px; font-size: 0.95em; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 30px 0;
}
.stat-card {
  background-color: var(--background-main);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  text-align: center;
}
.stat-card h3 {
  font-size: 1.1em;
  color: var(--secondary-color);
  margin-top: 0;
  margin-bottom: 10px;
  border-bottom: none;
}
.stat-card .value { font-size: 2em; font-weight: bold; color: var(--accent-color); line-height: 1; }
.stat-card .value i { font-size: 0.8em; vertical-align: middle; }
.stat-card p { margin-top: 10px; font-size: 0.9em; margin-bottom: 0; }

/* Paragraphes, Listes dans le Contenu des sections */
.content-section p, .content-section ul, .content-section ol, .content-section dl {
  font-size: 1em;
  margin-bottom: 20px;
  color: var(--text-color);
}
.content-section ul, .content-section ol { padding-left: 25px; }
.content-section ul li, .content-section ol li { margin-bottom: 10px; }
.content-section ul li::marker, .content-section ol li::marker { color: var(--heading-color); }
.content-section dl dt { font-weight: bold; color: var(--heading-color); margin-top: 15px; }
.content-section dl dd { margin-left: 20px; margin-bottom: 10px; }
.content-section strong, .content-section b { color: #000000; font-weight: 700; }
.content-section em, .content-section i { font-style: italic; }
.content-section u { text-decoration: underline; }
.content-section a { color: var(--link-color); text-decoration: underline; transition: color 0.2s ease; }
.content-section a:hover { color: var(--link-hover-color); }

/* Images Internes */
.content-section-image, .content-section img.content-section-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 25px auto;
  border-radius: 6px;
  box-shadow: 0 3px 7px var(--shadow-color);
}

/* Blocs Publicitaires */
.ads-banner-top-content, .ads-in-content {
    text-align: center;
    margin: 25px auto;
    clear: both;
}
.ads-in-content ins.adsbygoogle, .ads-banner-top-content ins.adsbygoogle {
    display: inline-block;
    max-width: 100%;
}
.ads-float-right {
    float: right;
    margin: 0 0 15px 20px;
    max-width: 300px;
}

/* --- Footer --- */
footer {
  background-color: var(--header-footer-bg);
  color: var(--light-accent-color);
  padding: 40px 20px;
  text-align: center;
  font-size: 0.9em;
  margin-top: 40px;
}
.footer-container {
    max-width: 1200px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 30px; text-align: left;
}
.footer-section h3 {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-family: 'Roboto', sans-serif;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 8px;
}
.footer-section ul { list-style: none; padding: 0; }
.footer-section li { margin-bottom: 8px; }
.footer-section a, .footer-section p {
    color: var(--light-accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.95em;
}
.footer-section a:hover {
    color: var(--text-light);
    text-decoration: underline;
}
.footer-bottom {
    grid-column: 1 / -1;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.15);
    text-align: center;
    font-size: 0.9em;
}
.footer-bottom p {
    color: var(--light-accent-color);
}

/* --- Bouton "Retour en Haut" --- */
#backToTopBtn {
  display: none; opacity: 0; visibility: hidden;
  position: fixed; bottom: 25px; right: 25px; z-index: 1001;
  border: none; outline: none;
  background-color: var(--nav-bg);
  color: var(--nav-text);
  cursor: pointer; padding: 10px 14px; border-radius: 50%;
  font-size: 16px; box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: opacity 0.4s ease, visibility 0.4s ease, background-color 0.3s ease, transform 0.3s ease;
}
#backToTopBtn.show {
  display: flex; align-items: center; justify-content: center;
  opacity: 0.9; visibility: visible;
}
#backToTopBtn:hover {
  background-color: var(--link-hover-color);
  opacity: 1;
  transform: translateY(-2px);
}

/* --- Styles Responsives --- */
@media (max-width: 992px) {
  .main-container {
    flex-direction: column;
    padding: 0 15px;
    margin-top: 20px;
  }
  .sidebar {
    width: 100%;
    margin-bottom: 30px;
    position: static;
    top: auto;
    max-height: none;
    overflow-y: visible;
  }
  .ads-sidebar, .sidebar-widget {
      max-width: 700px;
      margin-left: auto;
      margin-right: auto;
  }
  .content {
    width: 100%;
  }

  .mobile-menu-button {
    display: block;
  }

  header nav.main-header-nav {
    display: none; /* CACHÉ PAR DÉFAUT sur les écrans plus petits */
    position: absolute;
    top: var(--header-height-desktop); /* Positionné sous le header (sera ajusté pour mobile plus bas) */
    left: 0;
    right: 0;
    background-color: var(--primary-color);
    flex-direction: column; /* Les éléments s'empilent */
    padding: 0; /* Le padding sera sur les liens individuels */
    z-index: 1001; /* Au-dessus du header et nav-quick-links */
    box-shadow: 0 4px 8px var(--shadow-color);
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  header nav.main-header-nav.active { /* Lorsque le JS ajoute la classe .active */
    display: flex !important; /* Forcer l'affichage en flex (pour flex-direction: column) */
  }
  header nav.main-header-nav ul {
    flex-direction: column; /* Les <li> s'empilent */
    width: 100%;
  }
  header nav.main-header-nav li {
    margin: 0; /* Annuler la marge gauche */
    width: 100%;
  }
  header nav.main-header-nav a {
    display: block; /* Pour prendre toute la largeur */
    padding: 15px 20px; /* Augmenter le padding pour le tactile */
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 1em; /* Ajuster la taille de police pour mobile */
    /* Les autres styles de lien (couleur, transition) sont hérités ou peuvent être redéfinis ici si besoin */
  }
  header nav.main-header-nav li:last-child a {
    border-bottom: none;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 0.98em;
    padding-top: var(--header-height-mobile);
  }
  header {
    height: var(--header-height-mobile);
  }
  .logo { max-height: 45px; }
  h1.site-main-title { font-size: 1.6em; }
  .mobile-menu-button { font-size: 1.9em; }

  .nav-quick-links {
      top: var(--header-height-mobile);
      padding: 10px 8px;
  }
  header nav.main-header-nav { /* MODIFIÉ : Pour ajuster le top du menu ouvert */
      top: var(--header-height-mobile);
  }

  .nav-quick-links a { margin: 0 8px; font-size: 0.9em; padding: 7px 10px; }

  .main-container { margin-top: 15px; gap: 20px;}
  .content-section {
    padding: 20px;
    margin-bottom: 25px;
  }
  .content-section h2 { font-size: 1.6em; }
  .content-section h3 { font-size: 1.35em; }
  .content-section h4 { font-size: 1.15em; }
}

@media (max-width: 600px) {
  h1.site-main-title { font-size: 1.4em; }
  .logo { max-height: 40px; margin-right:10px; }
  header { padding: 0 15px; }
  .mobile-menu-button { font-size: 1.8em; }

  .nav-quick-links {
    padding: 10px 5px;
    text-align: left;
    white-space: normal;
    display: flex;
    flex-wrap: wrap;
    gap: 5px 8px;
    justify-content: center;
  }
  .nav-quick-links a {
    margin: 0;
    font-size: 0.85em;
    padding: 6px 10px;
    white-space: nowrap;
  }

  .main-container { padding: 0 10px; margin-top: 15px; }
  .content-section {
    padding: 20px 15px;
  }
  .content-section h2 { font-size: 1.5em; margin-bottom: 15px; }
  .content-section h3 { font-size: 1.25em; margin-bottom: 15px; }
  .content-section h4 { font-size: 1.1em; margin-bottom: 10px; }
  .content-section p, .content-section ul, .content-section ol { font-size: 0.95em; margin-bottom: 15px; }

  .ads-float-right {
      float: none;
      margin: 20px auto;
      display: block;
      text-align: center;
  }
  .ads-float-right ins.adsbygoogle {
      margin-left: auto;
      margin-right: auto;
  }

  #backToTopBtn { bottom: 15px; right: 15px; padding: 10px 13px; font-size: 15px; }
}

@media (max-width: 480px) {
    body { font-size: 0.92em; line-height: 1.65; }
    .main-container { margin-top: 10px; }

    h1.site-main-title { font-size: 1.3em; }
    .logo { max-height: 35px; }
    .mobile-menu-button { font-size: 1.7em; }

    .nav-quick-links {
        padding: 8px 3px;
        gap: 4px 6px;
    }
    .nav-quick-links a {
        font-size: 0.8em;
        padding: 5px 8px;
    }
    .content-section {
      padding: 15px 10px;
      margin-bottom: 20px;
    }
    .content-section h2 { font-size: 1.4em; }
    .content-section h3 { font-size: 1.2em; }
    .content-section h4 { font-size: 1.05em; }

    .footer-container { grid-template-columns: 1fr; gap: 20px; }
    .footer-section { text-align: center; }
    .footer-section ul { display: inline-block; text-align: left; }
}