 /* ==========================================================================
   1. FONDATIONS ET CONFIGURATION GÉNÉRALE
   ========================================================================== */
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body { 
  font-family: Georgia, serif; 
  font-variant-numeric: lining-nums proportional-nums; 
  line-height: 1.4; 
  color: #333; 
  background: #cccccc; /* gris = couche 1 (ext) pour le grand fond extérieur sur PC */
}

.nombres {
  font-variant-numeric: lining-nums tabular-nums;
}

.base-zone { 
  max-width: 1200px; 
  margin: 0 auto; 
  background: #eafaff; /* bleu acier = couche 2 (milieu) pour le grand fond extérieur sur PC */
  padding: 20px 0; 
}

/* MODIFICATION : Élargi à 950px pour laisser de la place aux 85 caractères de l'article */
.page-container { 
  max-width: 800px;      /* On revient à votre taille d'origine (très élégante pour 66ch) */
  margin: 0 auto; 
  background: #ffffff; 
  padding: 0px; 
  border: 1px solid #ebd7ec; 
}

/* ==========================================================================
   2. EN-TÊTE DU SITE (HEADER)
   ========================================================================== */
.site-header { 
  text-align: center; 
  margin-bottom: 20px;       /* Crée un espace propre sous la ligne grise */
  padding-bottom: 15px;      /* Crée un espace entre le texte et la ligne grise */
  border-bottom: 4px solid #808080; /* LA LIGNE ÉPAISSE GRISE */
}

.site-header-subtitle {
  color: #666;
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  margin-top: 0px;
  margin-bottom: 0;          /* Supprime les marges par défaut qui font baver le fond bleu */
}

.site-header h1 { 
  font-size: 2.2rem; 
  margin-bottom: 5px; 
} 

.site-header p { 
  color: #666; 
  font-size: clamp(0.85rem, 2vw, 1.05rem); /* Le texte va se réduire proprement sur mobile */
  margin-top: 5px;                         /* Ajoute une petite respiration sous le logo */
}

/* ==========================================================================
   3. STRUCTURE DE L’ARTICLE ET DES PARAGRAPHES
   ========================================================================== */
/* MODIFICATION : Élargi à 900px pour permettre l'étalement des 85 caractères */
.article-container { 
  max-width: 750px;      /* On revient aussi à 750px pour encadrer le texte de près */
  margin: 0 auto; 
  background: #f8f9fa; 
  padding: 15px; 
  margin-bottom: 10px; 
}

.article-title { 
  font-size: clamp(1.8rem, 5vw, 2.8rem); 
  margin-bottom: 10px; 
  line-height: 1.2; 
}

.article-container h2 {
  font-size: clamp(1.4rem, 4vw, 2.2rem) !important;
  text-align: center;
  margin-bottom: 15px;
}

/* MODIFICATION : Verrouillage strict à environ 85 caractères max et augmentation de l'interligne */
.para {
  text-align: justify;
  font-size: clamp(0.95rem, 1vw + 0.5rem, 1.1rem);
  max-width: 66ch;       /* AU LIEU DE 85ch : On passe à l'idéal de 66 caractères */
  line-height: 1.5;      /* On peut redescendre l'interligne à 1.5 (les lignes étant plus courtes) */
  margin-left: auto;     
  margin-right: auto;    
}

/* MODIFICATION : Harmonisation pour les apartés longs */
.para-aparte {
  text-align: justify;
  font-size: clamp(0.95rem, 1vw + 0.5rem, 1rem);
  max-width: 66ch;       /* AU LIEU DE 85ch */
  line-height: 1.4;      
  margin-bottom: 10px;
  margin-left: auto;
  margin-right: auto;
}

.para + .para {
  margin-top: 1.2em;     /* Un poil plus d'espace entre paragraphes longs */
}

/* Données de l’auteur et de la date */
.meta-infos {
  display: flex;
  justify-content: space-between;
  font-size: 0.85em;
  margin-bottom: 5px;
}

/* Conteneur du titre et des deux singes */
.title-header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 15px;
  width: 100%;
  background: #ffffff;
}

/* Style des blocs d’images */
.title-side-img {
  flex: 1;
  max-width: 120px;
}
.title-side-img img {
  max-width: 100%;
  height: auto;
  display: block;
}
.img-left { text-align: left; margin: 5px 0 5px 16px; }
.img-right { text-align: right; margin: 5px 16px 5px 0; }

/* Style du titre central */
.title-center-text {
  flex: 2;
  text-align: center;
}
.title-center-text h1.article-title {
  margin: 0;
  color: #cc0000;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  word-wrap: break-word;
  font-family: Georgia, serif;
}

/* Style pour les sous-titres d’Histoire */
.article-subtitle-text {
  font-family: Georgia, serif;
  color: #333333;
  font-size: 1.3rem;
  margin-top: 25px;
  margin-bottom: 10px;
}

/* Espacement propre pour vos listes à puces */
.article-list {
  margin: 15px 0 15px 15px; /* Aligne proprement les puces vers la droite */
}
.article-list li {
  margin-bottom: 10px;
}

/* ==========================================================================
   4. BOUTONS ET ACTIONS (PDF, FACEBOOK)
   ========================================================================== */
.actions-article {
  display: flex;
  justify-content: space-between;
  margin-top: 1px;
  padding-top: 1px;
}

.btn-action {
  font-size: 0.9em;
  color: #0066cc;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 5px 0;
  margin-bottom: 20px;
}

.btn-action:hover {
  text-decoration: underline;
  color: #004499;
}

/* ==========================================================================
   5. ENCADRÉS SPÉCIAUX (APARTÉS)
   ========================================================================== */
.aparte-bonhomme h4, 
.aparte-sombre h4, 
.aparte-commentaire h4 {
  color: #c53030;
  margin-top: 0;
  text-transform: uppercase;
  font-size: 0.90rem;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.aparte-bonhomme h5, 
.aparte-sombre h5, 
.aparte-commentaire h5 {
  font-size: 1.0rem;   
  line-height: 1.3;     
  margin-bottom: 8px; 
}

/* L’aparté Vert "Personnage" (Ex: Motta) */
.aparte-bonhomme {
  background-color: #e8f8e8;
  border-left: 5px solid #309d30;
  padding: 10px 10px;
  margin: 10px 0;
  border-radius: 0 8px 8px 0;
}

/* L’aparté Rouge "Sombre Histoire" (Ex: Extroc) */
.aparte-sombre {
  background-color: #f8e8e8;
  border-left: 5px solid #e53e3e;
  padding: 10px 10px;
  margin: 10px 0;
  border-radius: 0 8px 8px 0;
}

/* L’aparté Bleu "Commentaire" */
.aparte-commentaire {
  background-color: #d9e6f3;
  border-left: 5px solid #30679d;
  padding: 10px 10px;
  margin: 10px 0;
  border-radius: 0 8px 8px 0;
}

.text-alert {
  color: #cc0000;
}

.text-alert-large {
  font-family: Georgia, serif;
  color: #cc0000;
  font-size: 1.4rem;
  font-weight: bold;
  margin-top: 25px;
  margin-bottom: 15px;
}

/* ==========================================================================
   6. IMAGES ET ALIGNEMENTS
   ========================================================================== */
.wrap-img {
  float: right;
  margin: 5px 0 5px 16px;
}

.wrap-imgR {
  float: left;
  margin: 5px 16px 5px 0;
}

/* ==========================================================================
   7. GRILLE DES AUTRES ARTICLES (BAS DE PAGE)
   ========================================================================== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 15px;
  margin-bottom: 30px;
}
.articles-grid1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 15px;
  margin-bottom: 30px;
}

.article-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.article-card {
  background: #ffffff;
  padding: 15px;
  border: 1px solid #dddddd;
  border-radius: 8px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
}

.article-card-link:hover .article-card { 
  transform: translateY(-4px); 
  box-shadow: 0 5px 10px rgba(0,0,0,0.1);
  border-color: #b0b0b0;
}

/* Structure interne : sépare le texte à gauche et l’image à droite */
.card-content-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.card-text {
  flex: 1; 
  text-align: left;
}

.article-card h3 { 
  margin-top: 0; 
  font-size: 1.2rem;
  color: #4b0082; /* Violet */
  margin-bottom: 6px;
  font-family: Georgia, serif;
  line-height: 1.4;
}

.article-card p { 
  color: black; 
  font-size: 1.1rem;
  line-height: 1.3;
  margin-bottom: 6px;
}

/* La petite image vignette à droite */
.card-thumb {
  width: 150px;
  height: 200px;
  object-fit: cover; 
  border-radius: 4px;
  flex-shrink: 0; 
}

.card-read-more { 
  display: inline-block; 
  color: #0066cc; 
  font-size: 0.85rem;
  font-weight: bold; 
  text-align: left;
}

.article-card-link:hover .card-read-more {
  text-decoration: underline;
}

.footer { 
  margin-top: 40px; 
  text-align: center; 
  font-size: 0.85rem; 
  color: #666; 
  padding-top: 20px; 
  border-top: 1px solid #ccc; 
}

/* ==========================================================================
   8. RESPONSIVE DESIGN (AFFICHAGE MOBILE UNIQUEMENT)
   ========================================================================= */

/* --- TAILLES ORDINATEUR (PC) --- */
h1 {
  font-size: 2.5rem;
}

/* --- ICI COMMENCE LE ZONE STRICTEMENT MOBILE --- */
@media screen and (max-width: 768px) {
  
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
  }

  .base-zone { 
    max-width: 100% !important; 
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
  }
  
  .page-container { 
    max-width: 100% !important; 
    width: 100% !important;
    padding: 10px !important; 
    margin: 0 !important;
    border: none !important;
	}
}
/* ==========================================================================
   9. STYLE DU TABLEAU HISTORIQUE (AFFICHAGE ORDINATEUR PAR DÉFAUT)
   ========================================================================== */

.table-historique-container {
  width: 100%;
  margin: 20px 0;
}

/* On cible uniquement les écrans d'ordinateur (plus grands que 768px) */
@media screen and (min-width: 769px), print {
  .table-historique {
    display: table !important;
    width: 100%;
    max-width: 750px;
    border-collapse: collapse !important;
    font-family: Georgia, serif;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #333;
    border: 1px solid #ebd7ec !important;
    margin: 0 auto 20px auto;
    background-color: #ffffff !important;
  }

  .table-historique tr {
    display: table-row !important;
  }

  .table-historique th, 
  .table-historique td {
    display: table-cell !important;
    padding: 12px 10px !important;
    text-align: left !important;
    border: 1px solid #ebd7ec !important;
  }

  /* MODIFICATION : FORCE LE BLEU ACIER TRÈS CLAIR SUR LES TITRES DE COLONNES */
  .table-historique thead th,
  .table-historique th {
    font-weight: bold;
    background: #eafaff !important;       /* Votre bleu acier léger d'origine */
    background-color: #eafaff !important;  
    color: #4b0082 !important;             /* Texte violet pour une parfaite lisibilité */
    border-bottom: 3px solid #808080 !important;
  }

  /* CONSERVÉ : LE GRIS CLAIR SUR LA PREMIÈRE COLONNE (Critères) */
  .table-historique tbody td:first-child,
  .table-historique td.critere-col {
    font-weight: bold;
    background: #eafaff !important;       /* Votre bleu acier léger d'origine */
    background-color: #eafaff !important;    
    color: #333 !important;
    width: 22%;
  }

  .table-historique td:nth-child(2),
  .table-historique td:nth-child(3) {
    width: 39%;
  }
}


/* ==========================================================================
   10. STYLE DU TABLEAU HISTORIQUE (AFFICHAGE MOBILE UNIQUEMENT)
   ========================================================================== */

@media screen and (max-width: 768px) {
  .table-historique, 
  .table-historique thead, 
  .table-historique tbody, 
  .table-historique th, 
  .table-historique td, 
  .table-historique tr { 
    display: block !important; 
    width: 100% !important;
  }
  
  .table-historique thead {
    display: none !important;
  }
  
  .table-historique tbody tr {
    margin-bottom: 15px;
    border: 1px solid #ebd7ec !important;
    background: #ffffff;
    padding: 5px;
  }
  
  .table-historique td {
    border: none !important;
    border-bottom: 1px dashed #ebd7ec !important;
    padding: 10px 12px !important;
  }
  
  .table-historique td:last-child {
    border-bottom: none !important;
  }

  /* REPRODUIT L'ÉTIQUETTE AUTOMATIQUEMENT EN FONCTION DU TEXTE INJECTÉ DANS LE HTML */
  .table-historique td:nth-child(2)::before {
    content: attr(data-label) " : ";
    font-weight: normal;
    color: #666;
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 2px;
  }
  
  .table-historique td:nth-child(3)::before {
    content: attr(data-label) " : ";
    font-weight: normal;
    color: #666;
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 2px;
  }

  /* La première cellule devient le titre du bloc mobile */
  .table-historique td:first-child {
    background-color: #eafaff !important; 
    color: #4b0082 !important;
    font-size: 1rem;
  }
}
/* --- AJUSTEMENT DES LISTES DE PAYS DANS LES TABLEAUX --- */
@media screen and (min-width: 769px), print {
  /* Sur ordinateur, on transforme les espaces après les virgules en retours à la ligne */
  .liste-pays {
    white-space: pre-line;
    display: block;
  }
}

@media screen and (max-width: 768px) {
  /* Sur mobile, on laisse le texte couler naturellement pour économiser de la place */
  .liste-pays {
    display: inline;
    white-space: normal;
  }
}
/* ==========================================================================
   11. STYLE DU TABLEAU DES RÉGIMES À 4 COLONNES
   ========================================================================== */

/* --- Configuration Ordinateur (Écrans larges) --- */
@media screen and (min-width: 769px), print {
  .table-regimes {
    display: table !important;
    width: 100%;
    max-width: 750px; /* Aligné sur votre conteneur 66ch */
    border-collapse: collapse !important;
    font-family: Georgia, serif;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #333;
    border: 1px solid #ebd7ec !important;
    margin: 0 auto 20px auto;
    background-color: #ffffff !important;
  }

  .table-regimes tr {
    display: table-row !important;
  }

  .table-regimes th, 
  .table-regimes td {
    display: table-cell !important;
    padding: 15px 10px !important;
    border: 1px solid #ebd7ec !important;
  }

  /* Titres de colonnes en Bleu Acier très clair */
  .table-regimes thead th {
    font-weight: bold;
    background: #eafaff !important;       
    background-color: #eafaff !important;  
    color: #4b0082 !important; /* Écriture Violette */
    border-bottom: 3px solid #808080 !important;
    text-align: left;
  }
  
  /* On centre spécifiquement les colonnes de chiffres sur PC */
  .table-regimes th.centre,
  .table-regimes td.centre {
    text-align: center !important;
  }

  /* Répartition des largeurs sur ordinateur */
  .table-regimes th:nth-child(1), .table-regimes td:nth-child(1) { width: 25%; }
  .table-regimes th:nth-child(2), .table-regimes td:nth-child(2) { width: 15%; }
  .table-regimes th:nth-child(3), .table-regimes td:nth-child(3) { width: 20%; }
  .table-regimes th:nth-child(4), .table-regimes td:nth-child(4) { width: 40%; }

  /* Couleur de fond des cellules de titres de lignes (Première colonne) */
  .table-regimes tbody td:first-child {
    background-color: #eafaff !important; /* Assorti aux en-têtes */
  }
  
  /* Couleurs de texte spécifiques sur PC pour chaque catégorie */
  .row-demo-complete td { color: #006633 !important; }
  .row-demo-defaillante td { color: #cc6600 !important; }
  .row-regime-autoritaire td { color: #cc0000 !important; }
  
  /* On garde les listes de pays en noir pour le contraste */
  .table-regimes td.pays-col { color: #333333 !important; }
}

/* --- Configuration Mobile (Téléphones portables) --- */
@media screen and (max-width: 768px) {
  .table-regimes, 
  .table-regimes thead, 
  .table-regimes tbody, 
  .table-regimes th, 
  .table-regimes td, 
  .table-regimes tr { 
    display: block !important; 
    width: 100% !important;
  }
  
  .table-regimes thead {
    display: none !important; /* Masque la barre de titre globale */
  }
  
  .table-regimes tbody tr {
    margin-bottom: 25px;
    border: 1px solid #ebd7ec !important;
    border-radius: 8px;
    background: #ffffff;
    padding: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  }
  
  .table-regimes td {
    border: none !important;
    border-bottom: 1px dashed #ebd7ec !important;
    padding: 12px 12px !important;
    text-align: left !important;
  }
  
  .table-regimes td:last-child {
    border-bottom: none !important;
  }

  /* Génération dynamique des libellés de lignes */
  .table-regimes td:nth-child(2)::before,
  .table-regimes td:nth-child(3)::before,
  .table-regimes td:nth-child(4)::before {
    content: attr(data-label) " : ";
    font-weight: normal;
    color: #666;
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 3px;
  }

  /* Style des bannières de titres sur mobile avec leurs vraies couleurs */
  .row-demo-complete td:first-child {
    background-color: #e8f8e8 !important; /* Fond vert très clair */
    color: #006633 !important;
    font-size: 1.05rem;
  }
  .row-demo-defaillante td:first-child {
    background-color: #fff4e6 !important; /* Fond orange très clair */
    color: #cc6600 !important;
    font-size: 1.05rem;
  }
  .row-regime-autoritaire td:first-child {
    background-color: #f8e8e8 !important; /* Fond rouge très clair */
    color: #cc0000 !important;
    font-size: 1.05rem;
  }
}
/* ==========================================================================
   12. IMPRESSION (PDF) — RESTAURE LES CADRES DES TABLEAUX
   ========================================================================== */
@media print {
  .table-historique,
  .table-regimes {
    display: table !important;
    width: 100%;
    max-width: 750px;
    border-collapse: collapse !important;
    background-color: #ffffff !important;
    margin: 0 auto 20px auto;
  }

  .table-historique tr,
  .table-regimes tr { display: table-row !important; }

  .table-historique th, .table-historique td,
  .table-regimes th, .table-regimes td {
    display: table-cell !important;
    padding: 10px 8px !important;
    text-align: left !important;
    border: 1px solid #808080 !important;   /* gris visible à l'impression */
  }

  /* En-têtes et première colonne : conserver le fond bleu acier */
  .table-historique thead th,
  .table-regimes thead th,
  .table-historique tbody td:first-child,
  .table-regimes tbody td:first-child {
    background: #eafaff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .table-historique thead th,
  .table-regimes thead th {
    color: #4b0082 !important;
    border-bottom: 2px solid #808080 !important;
  }

  /* Mobile : les ::before data-label ne servent à rien sur papier,
     on n'y touche pas car ils ne s'appliquent qu'en @media screen max-width */

  /* Couleurs de lignes du tableau des régimes */
  .row-demo-complete td:first-child { color: #006633 !important; }
  .row-demo-defaillante td:first-child { color: #cc6600 !important; }
  .row-regime-autoritaire td:first-child { color: #cc0000 !important; }

  /* Empêcher qu'une ligne soit coupée entre deux pages */
  .table-historique tr, .table-regimes tr { page-break-inside: avoid; }

  /* Les tableaux longs peuvent se couper, mais l'en-tête se répète */
  thead { display: table-header-group; }
}

