/* ==========================================================================
   1. VARIABLES & RESET DE BASE
   ========================================================================== */
:root {
  /* Couleurs principales */
  --primary-color: #0261d9;
  --menu-bg: #8f9de8;
  --menu-border: #901d09;
  --text-light: antiquewhite;
  --text-dark: #333333;
  --footer-color: #5764a9;

  /* Typographies */
  --font-base: Verdana, Tahoma, Arial, sans-serif;
  --font-heading: "Trebuchet MS", Helvetica, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body, h1, h2, h3, p, ul, dl, dt {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-base);
  color: var(--text-dark);
  line-height: 1.5;
  background-color: #ffffff;
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.95rem;
}

a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   2. DISPOSITION GLOBALE (LAYOUT FLEXBOX)
   ========================================================================== */
.site-wrapper {
  max-width: 1200px;
  min-height: 100vh;
  margin: 0 auto;
  background: url('../images_2013/fond_articles_2015.jpg') no-repeat center top;
  background-size: cover;
  display: flex;
  flex-direction: column;
}

/* En-tête */
.site-header {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 30px 20px 0 20px;
}

.site-header img {
  width: 300px;
  height: auto;
}

/* Corps principal en 3 colonnes */
.site-body {
  display: flex;
  flex: 1;
  gap: 20px;
  padding: 20px 40px;
}

/* ==========================================================================
   3. COLONNE DE GAUCHE - NAVIGATION
   ========================================================================== */
.site-sidebar-left {
  width: clamp(120px, 15vw, 150px);
  flex-shrink: 0;
  margin-top: 10%; /* Reprise de la marge de 10% sur ordinateur */
}

.site-sidebar-left p {
  margin-bottom: 25px;
}

.site-sidebar-left span {
  display: block;
  font-size: 0.9rem;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 10px;
  border: 2px solid var(--menu-border);
  background-color: var(--menu-bg);
  color: var(--text-light);
  text-align: center;
  word-wrap: break-word;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.site-sidebar-left a:hover span {
  filter: brightness(1.1);
  transform: translateY(-2px);
  text-decoration: none;
}

/* ==========================================================================
   4. CONTENU PRINCIPAL & ARTICLE
   ========================================================================== */
.content-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0; /* Évite les débordements Flexbox */
}

.article-container {
  width: 100%;
  max-width: 700px;
}

.article-title {
  text-align: center;
  font-weight: bold;
  color: var(--primary-color);
  margin: 10px auto;
  font-size: 1.6rem;
  font-family: var(--font-heading);
}

.sous-titre-title {
  text-align: center;
  font-weight: bold;
  margin: 10px auto;
  font-size: 0.85rem;
  color: #000000;
  background-color: #ffffff;
  padding: 2px 8px;
  width: fit-content;
}

.article-content {
  text-align: center;
  font-size: 0.95rem;
  margin-top: 15px;
}

/* ==========================================================================
   5. COLONNE LATÉRALE DROITE (VIGNETTES)
   ========================================================================== */
.site-sidebar {
  width: 220px;
  flex-shrink: 0;
  max-height: 800px;
  overflow-y: auto;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

#apDiv_index {
  text-align: center;
  margin-top: 15px;
}

#apDiv_index img {
  width: 32px;
  height: 32px;
}

/* ==========================================================================
   6. PIED DE PAGE
   ========================================================================== */
.site-pied {
  margin-top: auto;
  padding: 20px;
  text-align: center;
}

.site-pied__liens {
  margin-bottom: 10px;
}

.pied {
  font-size: 0.85rem;
  color: var(--footer-color);
}

.pied a {
  color: #d90202;
}

* ==========================================================================
   8. SPÉCIFICITÉS PAGE SOMMAIRE / ACCUEIL
   ========================================================================== */

/* Arrière-plan alternatif propre à la page d'accueil */
.site-wrapper--sommaire {
  background: url('../images_2013/fond_index4_2015_4.jpg') no-repeat center top;
  background-size: cover;
  padding: 30px 20px;
}

.site-header__signature {
  max-width: 280px;
  width: 100%;
}

.site-header__signature img {
  width: 100%;
  height: auto;
}

.site-main-content {
  display: flex;
  gap: 40px;
  flex: 1;
  align-items: flex-start;
  padding: 20px 40px; /* Marges intérieures ajoutées ici */
}

.content-accueil {
  flex: 1;
  max-width: 600px;
  text-align: center;
  margin: 0 auto;
}

.accueil-texte {
  font-weight: bold;
  color: var(--primary-color);
  background-color: #ffffff;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 15px;
}

/* Adaptation Responsive du sommaire */
@media (max-width: 768px) {
  .site-wrapper--sommaire {
    padding: 15px;
  }

  .site-header__signature {
    max-width: 180px;
  }

  .site-main-content {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .content-accueil {
    max-width: 100%;
  }
}

@media (max-height: 500px) {
  .site-header__signature {
    max-width: 130px;
  }
}

/* ==========================================================================
   7. MEDIA QUERIES (RESPONSIVE)
   ========================================================================== */
/* ==========================================================================
   7. MEDIA QUERIES (RESPONSIVE)
   ========================================================================== */

@media (max-width: 768px) {
  /* 1. Disposition globale du corps de page */
  .site-body {
    flex-wrap: wrap; /* Permet au menu de se placer tout en haut sur 100% de large */
    padding: 10px 15px;
    gap: 15px;
  }

  /* 2. Menu de navigation (site-sidebar-left) placé en haut sur toute la largeur */
  .site-sidebar-left {
    width: 100%;
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 12px; /* Espace compact entre les boutons */
  }

  /* Annulation des marges héritées des paragraphes <p> du menu */
  .site-sidebar-left p {
    margin: 0 !important;
    padding: 0;
    display: inline-flex; /* Empêche les <p> de prendre toute la largeur */
  }

  .site-sidebar-left span {
    margin-bottom: 0;
    font-size: 0.8rem;
    padding: 4px 10px;
    white-space: nowrap; /* Évite les retours à la ligne à l'intérieur d'un bouton */
  }

  /* 3. Conservation du contenu principal et de la colonne de droite côte à côte */
  .content-main {
    flex: 1 1 60%; /* Prend la majorité de la largeur restante */
    min-width: 0;
  }

  .site-sidebar {
    width: 90px; /* Largeur réduite pour les vignettes sur mobile */
    flex-shrink: 0;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  /* Redimensionnement des vignettes sur mobile pour bien tenir à droite */
  .site-sidebar img {
    max-width: 60px;
    height: auto;
  }

  #apDiv_index img {
    width: 24px;
    height: 24px;
  }
}

/* Très petits écrans (smartphones en portrait < 480px) */
@media (max-width: 480px) {
  .site-sidebar-left {
    gap: 6px;
  }

  .site-sidebar-left span {
    font-size: 0.75rem;
    padding: 3px 6px;
  }

  .site-sidebar {
    width: 75px; /* Encore plus compact sur très petits écrans */
  }

  .site-sidebar img {
    max-width: 50px;
  }
}