/* ===== TITRES ===== */
.right-content section h2,
.handipro-section h2,
.sidebar-section h2 {
  font-family: Arial, sans-serif;
  color: #2c5282;
  font-size: 2.2rem;
  font-weight: bold;
  margin: 0 0 2rem 0;
  border-bottom: none; /* plus de soulignement sur h2 ici */
  padding-bottom: 0.8rem;
}

/* ===== STYLE POUR CONTENU LÉGAL/PROTOCOLAIRE ===== */
.legal-content {
  background-color: #fff;
  padding: 2.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  color: #2C3E50 !important;
  line-height: 1.75;
  font-family: Arial, sans-serif;
  width: 100%;
  margin: auto;
}

/* TITRES PRINCIPAUX AVEC LIGNES COLORÉES */
.legal-content h1,
.legal-content h2,
.legal-content h3,
.legal-content h4 {
  font-family: Arial, sans-serif;
  font-weight: bold;
  color: #2C3E50 !important;
  position: relative;
  padding-bottom: 0.5rem;
}

/* h1 sans soulignement */
.legal-content h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  margin-top: 0;
  border-bottom: none;
}

/* h2 sans soulignement */
.legal-content h2 {
  font-size: 1.6rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: none;
}

/* h3 avec soulignement bleu #2C3E50 */
.legal-content h3 {
  font-size: 1.3rem;
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
  border-bottom: 3px solid #2C3E50;
}

/* h4 avec soulignement vert #4DA68B */
.legal-content h4 {
  font-size: 1.15rem;
  margin-top: 1.2rem;
  margin-bottom: 0.6rem;
  border-bottom: 3px solid #4DA68B;
}

/* Titres de niveau 5 sans ligne */
.legal-content h5 {
  font-size: 1rem;
  font-weight: 600;
  color: #4DA68B;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  border-bottom: none;
}

/* PARAGRAPHES */
.legal-content p {
  color: #2C3E50 !important;
  margin-bottom: 1.3rem;
  line-height: 1.75;
  background: transparent !important;
}

/* EMPHASE */
.legal-content strong {
  font-weight: bold;
  color: #4DA68B;
}

/* LIENS */
.legal-content a {
  color: #4DA68B;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.legal-content a:hover {
  color: #2C3E50;
  text-decoration: none;
}

/* LISTES */
.legal-content ul {
  color: #2C3E50 !important;
  margin-bottom: 1.3rem;
  padding-left: 1.5rem;
}

.legal-content li {
  color: #2C3E50 !important;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* TABLEAUX */
.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  font-family: Arial, sans-serif;
  color: #2C3E50 !important;
}

.legal-content th,
.legal-content td {
  border: 1px solid #4DA68B;
  padding: 0.6rem 0.8rem;
  text-align: left;
  vertical-align: top;
}

.legal-content thead th {
  background-color: #E6F2EF;
  color: #2C3E50 !important;
  font-weight: bold;
}

.legal-content tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* Petits écrans */
@media screen and (max-width: 768px) {
  .legal-content th,
  .legal-content td {
    padding: 0.4rem 0.5rem;
    font-size: 0.9rem;
  }
}

/* Surcharge anti-conflits */
.legal-content * {
  color: inherit;
}

.legal-content p,
.legal-content li,
.legal-content span {
  color: #2C3E50 !important;
}

/* Responsive */
@media screen and (max-width: 768px) {
  .legal-content {
    padding: 1.5rem;
    border-radius: 0.5rem;
  }
  
  .legal-content h1 {
    font-size: 1.7rem;
  }
  
  .legal-content h2 {
    font-size: 1.4rem;
  }
  
  .legal-content h3 {
    font-size: 1.2rem;
  }
}


/* ===== LAYOUT SIDEBAR GÉNÉRIQUE ===== */
.right-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1rem;
  max-width: 100%;
  box-sizing: border-box;
}

.right-content section {
  background-color: #fff;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.right-content h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #333;
  width: 100%;
  border-bottom: none; /* Pas de soulignement */
}

/* SECTIONS CONDITIONNELLES */
.sidebar-section {
  display: none;
}

.sidebar-section.active {
  display: block;
}

.handipro-section {
  display: none;
}

.handipro-section.active {
  display: block;
}

/* NAVIGATION SIDEBAR (masquée sur mobile) */
.sidebar-nav {
  display: none;
}

.handipro-nav {
  display: none;
}

/* ===== LAYOUT DESKTOP ===== */
@media screen and (min-width: 768px) {
  .main-sidebar-layout,
  .main-mentionslégalesetconfidentialité,
  .main-infospratiques {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
  }
  
  /* Sidebar gauche */
  .left-sidebar {
    display: flex;
    flex-direction: column;
    width: 25%;
    position: sticky;
    top: 90px;
    align-self: flex-start;
    height: fit-content;
    padding-bottom: 20px;
  }

  .left-container {
    width: 25%;
    position: sticky;
    top: 120px;
    align-self: flex-start;
    background: #f8f8f8;
    border: 1px solid #ccc;
    padding: 1rem;
    overflow-y: auto;
    box-sizing: border-box;
  }
  
  /* Navigation visible */
  .sidebar-nav,
  .handipro-nav {
    display: block;
  }
  
  .sidebar-nav ul,
  .handipro-nav ul {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  .sidebar-nav li,
  .handipro-nav li {
    width: 100%;
    margin-bottom: 1rem;
  }
  
  .sidebar-nav a,
  .handipro-nav a {
    display: inline-block;
    width: 100%;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
    box-sizing: border-box;
  }
  
  .sidebar-nav a:hover,
  .sidebar-nav a:focus,
  .handipro-nav a:hover,
  .handipro-nav a:focus {
    background-color: #007acc;
    color: white;
    outline: none;
  }
  
  /* Contenu principal */
  .right-content {
    width: 75%;
    padding: 1rem;
    box-sizing: border-box;
  }
  
  .right-content section {
    scroll-margin-top: 120px;
  }
}

/* VARIANTES DE COULEURS SIDEBAR */
.sidebar-nav.theme-green a:hover,
.sidebar-nav.theme-green a:focus {
  background-color: #4DA68B;
  color: white;
}

.sidebar-nav.theme-handipro a:hover,
.sidebar-nav.theme-handipro a:focus {
  background-color: #007acc;
  color: white;
}

/* RESPONSIVE AMÉLIORÉ */
@media screen and (max-width: 1024px) {
  .main-sidebar-layout,
  .main-mentionslégalesetconfidentialité,
  .main-infospratiques,
  .main-capemploi-31,
  .main-crehi,
  .main-handipro31,
  .main-prehi,
  .main-cheops {
    gap: 1rem;
  }
  
  .left-sidebar {
    width: 30%;
  }
  
  .left-container {
    width: 30%;
  }
  
  .right-content {
    width: 70%;
  }
}

@media screen and (max-width: 768px) {
  .main-sidebar-layout,
  .main-mentionslégalesetconfidentialité,
  .main-infospratiques {
    flex-direction: column;
    gap: 1rem;
  }
  
  .left-sidebar,
  .right-content {
    width: 100%;
  }
  
  .left-container {
    width: 100%;
    position: relative;
    top: auto;
  }
  
  .right-content {
    padding: 0.5rem;
  }
  
  .right-content section {
    padding: 1rem;
    border-radius: 0.5rem;
  }
}
