/* Style général */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f9f9f9;
  color: #333;
}

/* Header */
header {
  background-color: #007B77;
  color: white;
  padding: 20px;
  text-align: center;
}

header h1 {
  margin: 0;
  font-size: 1.8em;
}

#photo-mounir {
  max-width: 80px;
  border-radius: 8px;
  margin-top: 10px;
}

/* Navigation principale */
nav {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

nav button {
  background-color: #fff;
  color: #007B77;
  border: 2px solid #007B77;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

nav button.active,
nav button:hover {
  background-color: #007B77;
  color: white;
  border: 2px solid white;
}

/* Section principale */
main {
  max-width: 900px;
  margin: 20px auto;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.content-block {
  display: none;
}

/* Sous-onglets */
.sous-onglets {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sous-onglets button {
  padding: 6px 12px;
  background-color: #eee;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sous-onglets button.active,
.sous-onglets button:hover {
  background-color: #007B77;
  color: white;
}

/* Contenu des sous-sections */
.subsection-content {
  margin-top: 20px;
}

.service-block {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.service-block img {
  width: 100%;
  max-width: 200px;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.service-block .texte-service {
  flex: 1;
}

/* Articles */
.articles-list .loading {
  font-style: italic;
  color: #666;
  padding: 20px;
  text-align: center;
}

.articles-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.article-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.article-card h3 {
  margin-top: 0;
  color: #007B77;
}

.article-date {
  font-style: italic;
  color: #666;
  font-size: 0.9em;
  margin-bottom: 10px;
  display: block;
}

.article-resume {
  color: #444;
  line-height: 1.5;
  margin-bottom: 15px;
}

.read-more {
  display: inline-block;
  margin-top: 15px;
  padding: 8px 15px;
  background: #007B77;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: background 0.3s ease;
}

.read-more:hover {
  background: #00635f;
}

/* Article individuel */
.article-container {
  display: flex;
  max-width: 900px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  flex-direction: column;
}

.article-image {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  display: block;
}

.article-content {
  padding: 25px;
}

.article-content[dir="rtl"] {
  text-align: right;
  font-family: "Amiri", "Scheherazade", serif;
  font-size: 18px;
}

.article-content[dir="ltr"] {
  text-align: left;
  font-size: 17px;
}

.article-content h1 {
  margin-top: 0;
  color: #007B77;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 10px;
}

.article-content p {
  line-height: 1.8;
  margin-bottom: 1.5em;
}

/* Formulaire de contact */
form {
  margin-top: 20px;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
}

input, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 16px;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

button[type="submit"] {
  background-color: #007B77;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: background 0.3s ease;
}

button[type="submit"]:hover {
  background-color: #00635f;
}

.bloc-domaine {
  margin-bottom: 1.5em;
  padding-left: 1em;
  border-left: 4px solid #ccc;
}

.bloc-domaine h4 {
  margin-bottom: 0.5em;
  font-weight: bold;
  color: #007B77;
}

.bloc-domaine ul {
  list-style: disc;
  padding-left: 1.5em;
}

.bloc-domaine li {
  margin-bottom: 0.5em;
}

/* Footer */
footer {
  background-color: #007B77;
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: 50px;
}

/* Styles pour la direction du texte */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] nav,
[dir="rtl"] .sous-onglets {
  flex-direction: row-reverse;
}

/* Responsive design */
@media (max-width: 768px) {
  .article-container {
    flex-direction: column;
  }
  
  .article-image {
    max-height: 200px;
  }
  
  .articles-list {
    grid-template-columns: 1fr;
  }
  
  nav {
    flex-direction: column;
    align-items: center;
  }
  
  .sous-onglets {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  main {
    padding: 15px;
    margin: 10px;
  }
  
  header {
    padding: 15px;
  }
  
  header h1 {
    font-size: 1.5em;
  }
}

/* Utilitaires */
.visually-hidden {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.formation-container {
  margin: 20px 0;
}

.formation-list {
  list-style: none;
  padding: 0;
}

.formation-list li {
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.formation-list h4 {
  margin: 0 0 5px 0;
  color: #007B77;
}

.formation-details {
  display: flex;
  gap: 15px;
  margin-bottom: 8px;
  font-size: 0.9em;
}

.etablissement {
  font-weight: bold;
}

.annee {
  color: #666;
  font-style: italic;
}

.description {
  margin: 5px 0 0 0;
  line-height: 1.5;
}

/* Style Publications */
.publication-container {
  margin-top: 20px;
}

.publication-item {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  align-items: flex-start;
}

.publication-image {
  width: 4cm;
  height: 7cm;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.publication-details {
  flex: 1;
}

.publication-title {
  color: #3498db;
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.2em;
}

.publication-meta {
  color: #7f8c8d;
  margin-bottom: 15px;
}

.publication-meta p {
  margin: 5px 0;
}

.publication-resume {
  line-height: 1.6;
  margin-bottom: 15px;
}

.publication-observation {
  font-style: italic;
  color: #e74c3c;
  padding: 8px;
  background: #f9f9f9;
  border-left: 3px solid #e74c3c;
}

.error {
  color: #d32f2f;
  background: #ffebee;
  padding: 15px;
  border-radius: 4px;
}

/* Styles spécifiques pour les publications */
.publications-container {
  margin-top: 20px;
}

.publication-item {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  align-items: flex-start;
}

.publication-image {
  width: 4cm;
  height: 6cm;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.publication-details {
  flex: 1;
}

.publication-title {
  color: #3498db;
  margin-top: 0;
  margin-bottom: 15px;
}

.publication-meta {
  color: #7f8c8d;
  margin-bottom: 15px;
}

.publication-meta p {
  margin: 5px 0;
}

.publication-resume {
  line-height: 1.6;
  margin-bottom: 15px;
}

.publication-observation {
  font-style: italic;
  color: #e74c3c;
  padding: 8px;
  background: #f9f9f9;
  border-left: 3px solid #e74c3c;
}

/* Styles pour les témoignages */
.temoignages-container {
  margin-top: 20px;
}

.temoignage-item {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  align-items: flex-start;
}

.temoignage-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}

.temoignage-details {
  flex: 1;
}

.temoignage-annee {
  color: #7f8c8d;
  margin: 5px 0 10px 0;
}

.temoignage-description {
  line-height: 1.6;
}

.temoignage-description p {
  margin: 10px 0;
}