/* ===  GÉOMÉTRIE === */

/* Ajoutez ceci au début de votre CSS pour vous assurer que la hauteur se propage du haut */
html {
    height: 100%;
}
body {
    /*height: 100%;*/
    min-height: 100vh;
    background-attachment: fixed;
}
/* Votre page-layout est en Grid, c'est bien. */
.page-layout {
    /* Si la règle Flex de votre CSS global est appliquée, celle-ci peut aider à la neutraliser */
    align-items: start !important; 
}
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body {
  line-height: 1.5;
}

/* === Définition des Variables de Layout (Ajustées) === */
:root {
  /* Hauteur de l'en-tête */
  --header-height-desktop: 85px;  
  /* Hauteur de l'en-tête en mobile */
  --header-height-mobile: 75px;  
  /* Largeur de la barre latérale */
  --sidebar-width-desktop: 240px;  
  /* Marge à gauche de la sidebar */
  --sidebar-offset-left: 40px;
  /* Marge totale nécessaire pour le main-content */
  --main-content-margin-left: 280px;  
}

/* === Conteneurs globaux === */
.container {
  margin: 0 auto;
  padding: 10px 18px; 
}

/* 🏆 CORRECTION CLÉ DÉFINITIVE : Neutralise le padding vertical du container pour le header */
.site-header > .container {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    /*min-height: 80px;*/
}
/* Neutraliser le padding sur le MAIN pour éviter le décalage indésirable */
main.container {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Si vous voulez que le contenu interne retrouve un peu d'air: */
.page-layout {
    padding: 10px 18px; /* Remettre le padding sur l'intérieur */
}
/* La règle 'main.container section { padding-top: 10px; }' a été retirée pour éviter le décalage */


/* ---------------------------------------------------------------------- */
/* === Header (Fixe) === */
/* ---------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 5000;
  height: var(--header-height-desktop); /* Utilise la hauteur fixe (écrasée en mobile) */
}
.header-inner {
  display: flex;
  /* 🏆 CLÉ 1 : Centrage vertical (Doit rester) */
  align-items: center; 
  justify-content: space-between; 
  z-index: 0;
  /* 🏆 CLÉ 2 : SUPPRIMER TOUT PADDING VERTICAL MANUEL ICI */
  padding-top: 0; 
  /* 🏆 CLÉ 3 : ASSURER QU'IL PREND 100% DE LA HAUTEUR DU PARENT FIXE */
  height: 100%; 
  position: relative; 
}

.site-title {
  line-height: 1;
  font-size: 1.6rem;
  /* 🏆 CLÉ 4 : SUPPRIMER LES PADDINGS/MARGES QUI DÉCALENT LE H1 */
  padding: 0 4px; /* Conserver le padding horizontal */
  padding-left: 10px;
  margin-top: 0;  
  margin-bottom: 0;
  flex-shrink: 0;
}

.main-nav {
  display: flex;  
  justify-content: flex-end;
  flex-shrink: 0;
  margin-top: 0px;
}
.main-nav a {
  margin-left: 8px;
  padding: 5px 8px;
}

header.site-header div.container.header-inner h1.site-title img {
  height: 50px;
  width: auto;
  vertical-align: middle;
  padding: 0;
  margin: 0;
  margin-left: 5px;
  max-height: none;
}
/* ---------------------------------------------------------------------- */
/* === CENTRAGE DU TITRE SUR DESKTOP (SUPÉRIEUR À 768px) === */
/* ---------------------------------------------------------------------- */
@media (min-width: 769px) {
    
    /* 🏆 CLÉ 3 : S'assurer que le header-inner prend la hauteur complète pour le centrage */
    .site-header {
        height: var(--header-height-desktop);
    }
    
    /* 🏆 CLÉ 4 : Réinitialise le conteneur pour préparer le centrage horizontal */
    .header-inner {
        justify-content: flex-end; /* Pousse la nav à droite */
        align-items: center; /* Confirme le centrage vertical */
    }

    /* 🏆 CLÉ 5 : Application du centrage ABSOLU uniquement pour le desktop */
    .site-title {
        position: absolute; 
        left: 50%; 
        transform: translateX(-50%); 
        z-index: 10;
        text-align: center; 
        width: auto;
		margin-top: 0;
    }
    
    /* 🏆 CLÉ 6 : Assure que la navigation reste au-dessus si elle se chevauche */
    .main-nav {
        z-index: 20;
		margin-top: 0;
    }
}
/* ---------------------------------------------------------------------- */
/* === Sidebar (Fixe sur Desktop) === */
/* ---------------------------------------------------------------------- */
.sidebar {
  position: fixed;
  /* Compensation du header + petite marge (85px + 10px) */
  top: calc(var(--header-height-desktop) + 10px); 
  left: var(--sidebar-offset-left); 
  width: var(--sidebar-width-desktop); 
  /* Hauteur restante */
  height: calc(100vh - var(--header-height-desktop) - 30px); 
  padding: 18px 16px;
  overflow-y: auto;
  z-index: 1000;
}
/* Styles internes de la sidebar */
.sidebar ul li.menu-title {
  display: block;
  padding: 6px 12px;
  text-align: center;
  font-size: 1.0rem;
  cursor: default;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin: 0.3em 0;
}
.sidebar h3 {
  margin-bottom: 1em;
  padding-bottom: 0.3em;
  font-size: 1.15rem;
}
.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar ul li {
  margin: 0.5em 0;
}
.sidebar ul li a {
  display: block;
  padding: 8px 12px;
  margin: 0.2em 0;
  text-decoration: none;
  text-align: center;
  font-size: 1.2rem;
}
/* Scrollbar uniquement pour la sidebar */
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track { border-radius: 4px; }
.sidebar::-webkit-scrollbar-thumb { border-radius: 4px; }
.sidebar { scrollbar-width: thin; }

/* ---------------------------------------------------------------------- */
/* === Main content (Compensation pour Sidebar) === */
/* ---------------------------------------------------------------------- */
/* La balise <section class="main-content"> (et non <main>) est le conteneur du contenu */
.main-content {
  flex: 1 1 auto;
  /* CLÉ : Marge pour éviter la sidebar fixe */
  margin-left: var(--main-content-margin-left) !important; 
  /* CLÉ : Compensation pour le header fixe (aligné sur le top de la sidebar : 85px + 10px = 95px) */
  padding-top: calc(var(--header-height-desktop) + 10px) !important; 
  min-height: 750px;
}
/* Annule le padding des sections internes au main-content qui causait un décalage */
.main-content > section { 
    padding-top: 0 !important;
}

/* ---------------------------------------------------------------------- */
/* === Pages en pleine largeur (Compensation du Header) === */
/* ---------------------------------------------------------------------- */
/* Cibles : Les sections des pages complètes (qui ne sont pas dans .main-content) */
#mentions-legales, .contact, .category-section {
  /* Compense le header fixe + marge supérieure */
  padding-top: calc(var(--header-height-desktop) + 40px);
}


/* Autres styles (Cards, Pagination, Footer, Article, Formulaires) Inchangés */

.page-layout {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  gap: 20px;
  /*position: relative;*/
}
#menu-toggle {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 3100;
  border: none;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 1.6rem;
  cursor: pointer;
}
.card {
  display: flex;
  gap: 18px;
  padding: 14px;
  border-radius: 10px;
  align-items: flex-start;
}
.card figure { width: 220px; flex-shrink: 0; }
.card img { width: 100%; height: auto; border-radius: 8px; display: block; }
.excerpt { flex: 1; }
.meta { font-size: 0.9rem; margin-bottom: 8px; }
.btn {
  display: inline-block;
  padding: 8px 12px;
  text-decoration: none;
  font-weight: 700;
}
.site-footer {
  margin-top: 30px;
  padding: 18px 0;
  text-align: center;
}
.footer-links { text-align: center; margin-top: 1em; font-size: 0.9em; }
.footer-links a { text-decoration: none; }
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 25px auto;
  padding: 10px 0;
}
.pagination a, .pagination span {
  display: inline-block;
  padding: 6px 10px;
  text-decoration: none;
  font-size: 0.95rem;
}
.pagination .dots { padding: 0 5px; }
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4em;
  line-height: 1.6;
  perspective: 400px;
}
.tag-cloud a {
  text-decoration: none;
  padding: 3px 6px;
  display: inline-block;
}
#tags {
  margin: 40px auto;
  text-align: center;
  max-width: 850px;
}
#tags h2 {
  font-size: 1.8em;
  margin-bottom: 1em;
} /* <-- ACCCOLADE CORRIGÉE ICI */
.categories-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  padding: 2rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}
.hero-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.hero-card figure { margin: 0; height: 180px; overflow: hidden; }
.hero-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-content {
  flex: 1;
  padding: 1.2rem;
  text-align: center;
}
.hero-content h3.cat-name { font-size: 1.5em; margin-bottom: 0.4em; font-weight: 700; }
.hero-content h4 { margin-top: 0; font-size: 1.15em; font-weight: 600; }
.hero-content p { margin: 0.6em 0; line-height: 1.4em; }
.hero-content .btn {
  display: inline-block;
  margin-top: 0.6em;
  padding: 0.5em 1.2em;
  font-weight: bold;
  text-decoration: none;
}
.category-section {
  padding:2rem;
  text-align:center;
}
.category-title { font-size:2rem; margin-bottom:2rem; }
.no-article { font-style:italic; font-size:1.2rem; }
.contact {
  max-width: 750px;
  margin: 2em auto;
  padding: 2em;
}
.contact h2 {
  text-align: center;
  margin-bottom: 1.2em;
  font-size: 1.6em;
}
.contact form {
  display: flex;
  flex-direction: column;
  gap: 1em;
}
.contact textarea {
  min-height: 160px;
}
.contact .captcha {
  text-align: center;
  margin-top: 0.5em;
}
.contact .captcha img {
  margin: 0.6em 0;
  padding: 4px;
  display: inline-block;
}
.contact .captcha a {
  text-decoration: none;
  font-size: 0.85em;
}
.contact button {
  border: none;
  padding: 0.8em 1.4em;
   cursor: pointer;
  align-self: center;
  font-size: 1rem;
}
.contact .feedback-success {
  text-align: center;
  font-weight: bold;
  margin-bottom: 1em;
}
.contact .feedback-error {
  text-align: center;
  font-weight: bold;
  margin-bottom: 1em;
}
form {
  max-width: 420px;
  margin: 15px auto;
  padding: 18px 22px;
}
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}
label {
  font-weight: bold;
  margin-bottom: 4px;
}
input[type="text"],
input[type="email"],
textarea {
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 14px;
  resize: vertical;
}
button[type="submit"] {
  border: none;
  padding: 10px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}
section.contact form p.info-rgpd {
  font-size: 0.5rem;
  font-style: italic;
  margin-top: 0.5em;
}
.article-full::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
}
main.container section article.article-full {
  min-height: 600px;
  padding: 30px;
}
.article-photo {
    margin-top: 12px;
    text-align: center;
}
.article-photo img {
    max-width: 90%;*/
    max-width: none;
    display: inline-block;
}
.article-video-block {
    margin-top: 12px;
    text-align: center;
}
.article-video-block .video-container {
    width: 90%;
    margin: 0 auto;
    overflow: hidden;
}
.article-video-block .video-container iframe {
    width: 100%;
    height: 360px;
    max-width: 100%;
    border: 0;
}
article .result-meta {
    display: flex;
    justify-content: flex-end;
    font-size: 0.8em;
    font-style: italic;
    margin-top: 6px;
    margin-bottom: 12px;
}
.article-link {
    margin-top: 1.5em;
    padding: 0.5em 1em;
    border-left: 3px solid #888;
}
.article-link .link-comment {
    font-style: italic;
    margin-bottom: 0.3em;
}
.article-link .link-item a {
    text-decoration: none;
    font-weight: bold;
}
.social-share {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
}
.social-share a {
  text-decoration: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 18px;
}


/* ---------------------------------------------------------------------- */
/* === RESPONSIVE DESIGN (Mobile < 768px) === */
/* ---------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .categories-hero { grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap:1.8rem; padding:2rem; }
}

@media (max-width: 768px) {
  
  /* --- Header Mobile --- */
  .site-header {
      height: auto; 
  }
  .container {
    padding: 8px 15px;
  }
  /* Rétablissement du padding vertical en mobile pour le conteneur du header */
  .site-header > .container {
    padding-top: 4px !important; 
    padding-bottom: 4px !important;
  }
  
  .site-title {
      font-size: 1.2rem;
      padding-left: 0;
      margin-bottom: 0px;
      text-align: center;
      flex-shrink: 1;
      white-space: nowrap; 
      overflow: hidden;
  }
  header.site-header div.container.header-inner h1.site-title img {
      height: 25px;
  }
  .header-inner {
      flex-direction: column;
      align-items: center; 
      justify-content: flex-start;
      width: 100%;
      height: auto;
      padding-top: 0;             
  }
  .main-nav {
    gap: 4px;
    width: 100%;
    justify-content: flex-end;
    padding-bottom: 5px;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    font-size: clamp(10px, 0.5vw, 16px);
    margin-top: 0;
    padding-bottom: 2px; /* Gardez un peu d'air */
  }
  .main-nav a {
    padding: 2px 2px;
    min-width: 0;
    flex-shrink: 1;
    font-size: 1em;
    margin-left: 0;
    white-space: nowrap; 
    overflow: hidden; 
  }
  .main-nav::-webkit-scrollbar { display: none; }

  /* --- Toggle Menu --- */
  #menu-toggle {
    display: block !important;
    position: fixed;
    top: 15px; 
    left: 15px;
    z-index: 10000;
  }

  /* --- Sidebar Mobile (Menu coulissant) --- */
  .sidebar { display: block; }
  nav.sidebar {
    position: fixed !important; 
    top: 0; 
    left: 0;
    width: 80%;
    height: 100%;
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    z-index: 9999;
    padding-top: 80px; 
    left: 0 !important; 
    width: 80%; 
  }
  nav.sidebar.active {
    transform: translateX(0);
    opacity: 1;
  }
  
  /* --- Main Content Mobile (Réinitialisation des marges) --- */
  .page-layout {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 98%;
    margin: 0 auto;
    padding: 0;
  }
  .main-content { 
    width: 100%; 
    /* Annule la marge de la sidebar */
    margin-left: 0 !important;
    /* Compensation du header fixe en mobile (120px est l'estimation) */
    padding-top: 120px !important;
	padding-left: 0px !important;
	padding-right: 0px !important;	
  }
  .main-content > section { 
    padding-top: 0 !important;	  
}
  /* --- Pages Pleines Mobile (Compensation) --- */
  /* J'ai retiré les règles `calc()` ici pour utiliser une valeur statique pour la compensation */
  #mentions-legales, .contact {
    padding-top: 120px !important;
  }
 .article-full {
        padding-top: 125px !important; /* ⬅️ Anciennement 120px */
    }
  
  .article-full {
      /* Annule la marge supérieure héritée du desktop */
      margin-top: 0 !important; 
      margin-bottom: 0 !important;
      width: 100%;
      margin: 0 auto;
      /* La compensation est appliquée via .main-content ou le sélecteur pleine page ci-dessus */
      padding-top: 0 !important; 
  }
  .main-content article.article-full div.article-content {
        /* Utilisez !important en dernier recours pour vaincre toute règle précédente */
        padding-left: 5px !important;
        padding-right: 5px !important;
        /* Laisser le padding vertical à 0 ou à une valeur si nécessaire */
        padding-top: 0; 
        padding-bottom: 0;
    }
  #tags {
        /* Annule la grande marge supérieure desktop (40px auto) */
        margin-top: 0 !important; 
        /* Annule la grande marge inférieure desktop (40px auto) */
        margin-bottom: 0 !important; 
        /* Annule le padding qui s'ajoute à la compensation générale */
        padding-top: 0 !important; 
    }

  /* --- Cards Mobile --- */
  .card { 
    width: 100%; 
    max-width: 700px; 
    flex-direction:column; 
    align-items:center; 
    text-align:center; 
    margin-bottom:20px; 
    padding:10px; 
  }
  .card figure { width:100%; margin-bottom:10px; }
  .card .excerpt { width:100%; text-align:left; }
  .article-photo img { max-width: 100%; }
}
/* Style du lien Tipeee dans le footer */
/* Style du lien Tipeee dans le footer (avec icône) */
.tipeee-link {
    /* Couleurs */
    background: none;
    color: #ffb700; /* La couleur qui ressort (Tipeee) */
    border: 2px solid #ffb700;
    
    /* Apparence du bouton */
    padding: 4px 8px;
    border-radius: 20px; /* Bord arrondi */
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    margin: 0 5px;
    
    /* Animation fluide */
    transition: all 0.3s ease;
}

/* Espacement pour l'icône */
.tipeee-link i {
    margin-right: 5px; 
}

/* Effet de survol (Hover) pour l'interaction */
.tipeee-link:hover,
.tipeee-link:focus {
    background-color: #ffb700; /* Le fond se remplit */
    color: white; /* Le texte et l'icône deviennent blancs */
    box-shadow: 0 0 10px rgba(255, 183, 0, 0.5); /* Halo lumineux discret */
    transform: translateY(-1px); /* Petite élévation */
}
				
html, body {
    /* S'assurer que le HTML et le Body couvrent au moins 100% de la fenêtre, plus le contenu */
    min-height: 100%; 
}

main.container {
    /* Assurer que le conteneur principal prend la hauteur des éléments qu'il contient. */
    min-height: 100%; 
    display: block; /* S'assurer qu'il n'est pas Flex/Grid ou qu'il ne s'étire pas mal */
}			