/* 🎯 Importation des polices */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;900&display=swap');
@import url('https://fonts.googleapis.com/earlyaccess/droidarabickufi.css');

/* 🎨 Variables globales */
:root {
  --vert-clair: #85BB64;
  --vert-fonce: #1A7346;
  --vert-tres-fonce: #0D1F1C;
  --gris-clair: #DADADA;
  --gris-fonce: #374548;

  --font-fr: 'Montserrat', sans-serif;
  --font-ar: 'Droid Arabic Kufi', sans-serif;
}

/* 🧱 Structure générale */
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-fr);
  background-color: white;
  color: var(--gris-fonce);
  line-height: 1.6;
  letter-spacing: -1px;
  text-align:justify;
}

.back-to-top {
  text-align: center;
  padding: 1rem 0;
  background-color: var(--vert-fonce);
}

.back-to-top a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  font-size: 1rem;
  transition: opacity 0.3s ease;
}

.back-to-top a:hover {
  opacity: 0.8;
}

.back-to-top i {
  margin-right: 6px;
}


/* 🌍 Texte arabe */
[lang="ar"] {
  font-family: var(--font-ar);
  direction: rtl;
  text-align: right;
}

/* 🧾 Titres */
h1, h2, h3 {
  color: var(--gris-fonce);
  font-weight: 700;
}

/* 🔗 Liens */
a {
  color: var(--vert-clair);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* 🟩 Boutons */
.button {
  display: inline-block;
  background-color: var(--vert-fonce);
  color: white;
  padding: 0.6em 1.2em;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
}
.button:hover {
  background-color: var(--vert-tres-fonce);
  text-decoration: none;
}

/* 📞 Barre supérieure (coordonnées + réseaux + langue) */
.top-bar {
  background-color: var(--vert-clair);
  color: white;
  font-size: 0.9em;
  padding: 1em 1em;
}

.container-topbar {
  width: 90%;
  max-width: 1240px;
  margin: auto auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

/* 📍 Coordonnées à gauche */
.top-bar-left {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

/* 📱 Réseaux sociaux + langue à droite */
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 1.5em;
}

/* 🎯 Liens dans la top-bar */
.top-bar a {
  color: white;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}
.top-bar a:hover {
  color: var(--vert-fonce);
}

/* 📷 Icônes sociales */
.social-icons {
  display: flex;
  gap: 0.8em;
}
.social-icons a {
  font-size: 1.1em;
}

/* 🌐 Sélecteur de langue */
.lang-switch a {
  font-weight: 600;
}

a.Recrutement {
  background-color: white;
  color: var(--vert-fonce);
  padding: 0.1em 0.2em;
  border-radius: 2px;
  font-size: 0.9em;
  font-weight: 900;
}

a.Recrutement:hover {
  background-color: white;
  color: var(--vert-fonce);
}

.lang-switch a.active {
  background-color: white;
  color: var(--vert-fonce);
  padding: 0.2em 0.5em;
  border-radius: 4px;
}
/* 🧭 Header principal */
header {
  background-color: white;
  color: #323232;
  padding: 1em 0;
  border-bottom: 1px solid var(--gris-clair);
}

/* 📦 Conteneur du header */
.container-header {
  max-width: 1180px;
  margin: auto;
  padding: 0 20px;
}

/* 📐 Bloc flex contenant logo + menu + burger */
.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1em;
}

/* 🏷️ Logo ADHA */
.branding {
  display: flex;
  align-items: center;
}

.logo {
  max-width: 140px;
  height: auto;
  margin-right: 1em;
}
/* 🧭 Menu principal */
.main-nav {
  display: flex;
  align-items: center; /* ✅ aligne verticalement avec le logo */
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.1em;
  margin: 0;
  padding: 0;
  text-transform: uppercase;
  font-weight: bold;
  font-size: 1.05em;
}


.main-nav li {
  position: relative;
}

.main-nav a {
  color: #323232;
  font-weight: 600;
  text-decoration: none;
}

.main-nav a:hover {
  color: var(--vert-clair);
}

/* 📂 Sous-menus déroulants */
.main-nav ul.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--vert-clair);
  padding: 0.2em 0.5em;
  z-index: 10;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  font-size: 0.8em;
}

.main-nav li:hover .submenu {
  display: block;
}

.main-nav li.has-submenu > a {
  position: relative;
  padding-right: 1.2em; /* espace pour la flèche */
}

.main-nav li.has-submenu > a::after {
  content: "↓";
  position: absolute;
  right: 0.3em;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7em;
  color: var(--vert-fonce);
}


.submenu li {
  margin: 0.3em 0;
}

.submenu li a {
  color: white;
  font-weight: 500;
  text-transform: none;
  display: block;
  padding: 0.4em 0.6em;
  border-radius: 4px;
}

.submenu li:hover {
  background-color: #1A7946;
  font-weight: 700;
}

.submenu li:hover a {
  color: #FFF;
  font-weight: 700;
}

/* 🍔 Bouton burger (mobile) */
.burger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5em;
  color: var(--vert-fonce);
  cursor: pointer;
}
/* 🦶 Pied de page */
footer {
  background-color: var(--vert-tres-fonce);
  color: white;
  padding: 2em 1em;
}

/* 🧱 Conteneur du footer */
.footer-content {
  max-width: 1240px;
  margin: auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2em;
}

/* 📂 Section individuelle du footer */
.footer-section h3 {
  margin-top: 0;
  color: var(--vert-clair);
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 0.5em;
}

.footer-section ul li a {
  color: white;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-section ul li a:hover {
  color: var(--vert-clair);
  text-decoration: underline;
}

/* 📱 Icônes réseaux sociaux */
.footer-social-icons {
  display: flex;
  gap: 1em;
  margin-top: 0.5em;
}

.footer-social-icons a {
  color: white;
  font-size: 1.2em;
  transition: color 0.2s ease;
}

.footer-social-icons a:hover {
  color: var(--vert-clair);
}

/* 🧾 Bas du footer */
.footer-bottom {
  text-align: center;
  margin-top: 2em;
  font-size: 0.9em;
}

/* 🧱 Grille de rubriques (cartes d’accueil) */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5em;
}

.card {
  background-color: var(--gris-clair);
  padding: 1em;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  color: var(--vert-tres-fonce);
  transition: background-color 0.3s ease;
}

.card:hover {
  background-color: var(--vert-clair);
  color: white;
}

/* 🧱 Layout des pages internes */
.layout {
  display: flex;
  flex-wrap: wrap;
  gap: 2em;
  margin-top: 2em;
}
/* Conteneur */
main.container {
  max-width: 1200px;
  margin: auto;
  padding: 2em;
}

/* Fil d’Ariane */
.breadcrumb {
  font-size: 0.9em;
  margin-bottom: 1.5em;
  color: #666;
}
.breadcrumb a {
  color: var(--vert-fonce);
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
}
.breadcrumb .sep {
  margin: 0 0.5em;
  color: #999;
}
.breadcrumb .current {
  font-weight: bold;
  color: #333;
}

/* 📚 Menu latéral */
.sidebar {
  flex: 0 0 auto;
  align-self: flex-start;
  background-color: #F2F2F2;
  padding: 1em;
  border-radius: 6px;
}

.sidebar h2 {
  font-size: 1.2em;
  margin-bottom: 1em;
  color: var(--vert-fonce);
  font-weight: 900;
}

.side-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-nav li {
  margin-bottom: 0.8em;
}

.side-nav a {
  color: var(--vert-tres-fonce);
  font-weight: 500;
  text-decoration: none;
}

.side-nav a:hover {
  color: var(--vert-fonce);
  text-decoration: underline;
}

.side-nav a.active {
  font-weight: 700;
  color: var(--vert-fonce);
  border-left: 4px solid var(--vert-fonce);
  padding-left: 0.5em;
  padding-right: 0.2em;
  background-color: #E3E3E3;
  border-radius: 4px;
}

.sidebar-block {
  margin-top: 2em;
  background-color: #F2F2F2;
  padding: 0em;
  border-radius: 6px;
  font-size: 0.95em;
  line-height: 1.5;
}

.sidebar-block h3 {
  margin-top: 0;
  color: var(--vert-fonce);
  font-size: 1.1em;
}

.sidebar-block ul {
  list-style: none;
  padding: 0;
  margin: 0.5em 0 0;
}

.sidebar-block ul li {
  margin-bottom: 0.4em;
}

.sidebar-block ul li a {
  color: var(--vert-tres-fonce);
  text-decoration: none;
  font-weight: 500;
}

.sidebar-block ul li a:hover {
  color: var(--vert-fonce);
  text-decoration: underline;
}


/* 📄 Contenu principal */
.content {
  flex: 1;
  min-width: 300px;
}
/* 📊 Tableaux institutionnels */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2em;
  font-size: 0.95em;
  background-color: white;
}

thead {
  background-color: var(--vert-clair);
  color: white;
  font-weight: 600;
}

th, td {
  padding: 0.5em;
  border-bottom: 1px solid var(--gris-clair);
  text-align: left;
  vertical-align: top;
}

td:first-child {
  font-weight: 700;
}

tbody tr:nth-child(even) {
  background-color: #F9F9F9;
}

tbody tr:hover {
  background-color: #EEF6EC;
}

th {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.9em;
}

td {
  color: #323232;
}

/* 📱 Tableaux responsives */
@media screen and (max-width: 768px) {
  table, thead, tbody, th, td, tr {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    margin-bottom: 1em;
    border: 1px solid var(--gris-clair);
    border-radius: 6px;
    padding: 0.5em;
    background-color: #FFF;
  }

  td {
    position: relative;
    padding-left: 50%;
    border: none;
    border-bottom: 1px solid #eee;
  }

  td::before {
    position: absolute;
    top: 0.6em;
    left: 1em;
    width: 45%;
    padding-right: 1em;
    white-space: nowrap;
    font-weight: bold;
    color: #666;
    content: attr(data-label);
  }
}

/* 📱 Responsive header + menu burger */
@media screen and (max-width: 768px) {
  .container-header {
    width: 90%;
    margin: 0 auto;
    padding: 0 1em;
  }

  .header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8em 0;
    width: 100%;
    margin: auto;
  }
.burger {
  position: relative;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.burger span {
  position: absolute;
  width: 24px;
  height: 3px;
  background-color: var(--vert-fonce);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Position initiale des 3 barres */
.burger span:nth-child(1) {
  top: 8px;
}

.burger span:nth-child(2) {
  top: 14px;
}

.burger span:nth-child(3) {
  top: 20px;
}

/* Animation vers croix */
.burger.active span:nth-child(1) {
  transform: rotate(45deg);
  top: 14px;
}

.burger.active span:nth-child(2) {
  opacity: 0;
}

.burger.active span:nth-child(3) {
  transform: rotate(-45deg);
  top: 14px;
}

  .main-nav {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    width: 100%;
    background-color: white;
  }

  .main-nav.active {
    max-height: 600px; /* ✅ assez grand pour contenir le menu */
    opacity: 1;
  }

  .main-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    margin: 0;
    padding: 1em;
  }

  .main-nav li {
    padding: 0.4em 0;
  }

  .main-nav ul.submenu {
    position: static;
    box-shadow: none;
    padding: 0.5em 0;
  }

  .main-nav li:hover .submenu {
    display: block;
  }
}



/* 📱 Responsive footer */
@media screen and (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2em;
    padding: 0 1em;
  }

  .footer-section {
    width: 100%;
  }

  .footer-social-icons {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 1em;
  }

  .footer-bottom {
    font-size: 0.85em;
    margin-top: 1.5em;
  }
}

/* 📱 Responsive layout des pages internes */
@media screen and (max-width: 768px) {
  .layout {
    flex-direction: column;
    gap: 1.5em;
  }

  .sidebar {
    width: 90%;
    margin: 0 auto;
    padding: 1em;
  }

  .content {
    width: 100%;
    min-width: auto;
  }

  .side-nav a.active {
    border-left: none;
    border-bottom: 2px solid var(--vert-fonce);
    padding-left: 0;
    padding-bottom: 0.3em;
    background-color: transparent;
  }
}

/* 📱 Responsive typographie et boutons */
@media screen and (max-width: 768px) {
  body {
    font-size: 0.95em;
    line-height: 1.5;
    padding: 0;
  }

  h1 {
    font-size: 1.6em;
    margin-bottom: 0.8em;
  }

  h2 {
    font-size: 1.3em;
    margin-bottom: 0.6em;
  }

  p {
    margin-bottom: 1em;
  }

  main.container {
    padding: 1.5em;
  }


  .button {
    font-size: 0.9em;
    padding: 0.5em 1em;
    width: 95%;
    margin: 10px auto;
    border: none;
  }
}

/* 📱 Responsive grille d’accueil */
@media screen and (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 1.2em;
  }

  .card {
    padding: 1em;
    font-size: 0.95em;
    text-align: left;
  }

  .card:hover {
    background-color: var(--vert-clair);
    color: white;
  }
}
