/* ==========================================================================
   Conteneur de contenu de publication (.tag-old #post-content)
   ========================================================================== */

/* 1. Espacement des titres (H2 à H5) et des sections */
.tag-old #post-content h2,
.tag-old #post-content h3,
.tag-old #post-content h4,
.tag-old #post-content h5 {
  margin-top: 3rem;      /* Espace au-dessus du titre (séparation de section) */
  margin-bottom: 1rem;   /* Espace sous le titre (entre le titre et le texte) */
  line-height: 1.3;
}

/* Annulation de la marge supérieure si le titre est le tout premier élément */
.tag-old #post-content > *:first-child {
  margin-top: 0;
}

/* Espacement global des paragraphes pour aérer le texte */
.tag-old #post-content p {
  margin-bottom: 1.25rem;
  line-height: 1.6;
}


/* ==========================================================================
   Gestion des Listes (ul, ol) et de leurs espacements contextuels
   ========================================================================== */

.tag-old #post-content ul, 
.tag-old #post-content ol {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}

.tag-old #post-content p:has(+ ul),
.tag-old #post-content p:has(+ ol) {
    margin-bottom: 0;
}

.tag-old #post-content p + ul,
.tag-old #post-content p + ol {
    margin-top: 0.5em;
}

.tag-old #post-content ul li + li,
.tag-old #post-content ol li + li {
    margin-top: 0.5em;
}

.tag-old #post-content li {
  line-height: 1.5;
}

.tag-old #post-content ul + p,
.tag-old #post-content ol + p {
    margin-top: 1.5em;
}


/* ==========================================================================
   2. Style des images
   ========================================================================== */
.tag-old #post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 20px;
  display: block;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}


/* ==========================================================================
   3. Style des liens et hover
   ========================================================================== */
.tag-old #post-content a {
  color: #00428E;
  font-weight: 700;
  text-decoration: underline;
  transition: color 0.2s ease-in-out;
}

.tag-old #post-content a:hover,
.tag-old #post-content a:focus {
  color: #24B9CE;
}


/* ==========================================================================
   Adaptations Responsives (Desktop, Laptop, Tablettes, Mobile)
   ========================================================================== */

/* Laptop (≤ 1200px) */
@media (max-width: 1200px) {
  .tag-old #post-content h2,
  .tag-old #post-content h3,
  .tag-old #post-content h4,
  .tag-old #post-content h5 {
    margin-top: 1.75rem;
    margin-bottom: 0.875rem;
  }
}

/* Tablette Paysage (≤ 1024px) */
@media (max-width: 1024px) {
  .tag-old #post-content h2,
  .tag-old #post-content h3,
  .tag-old #post-content h4,
  .tag-old #post-content h5 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
  }
  
  .tag-old #post-content p {
    margin-bottom: 1rem;
  }
}

/* Tablette Portrait (≤ 768px) */
@media (max-width: 768px) {
  .tag-old #post-content h2,
  .tag-old #post-content h3,
  .tag-old #post-content h4,
  .tag-old #post-content h5 {
    margin-top: 1.35rem;
    margin-bottom: 0.65rem;
  }

  .tag-old #post-content img {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
  }
}

/* Mobile (≤ 480px) */
@media (max-width: 480px) {
  .tag-old #post-content h2,
  .tag-old #post-content h3,
  .tag-old #post-content h4,
  .tag-old #post-content h5 {
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
  }

  .tag-old #post-content p {
    margin-bottom: 0.875rem;
  }

  .tag-old #post-content img {
    border-radius: 16px;
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
}

/* ==========================================================================
   Carrousel FlexSlider pour les images dans les publications
   ========================================================================== */
.tag-old {
    .scald-flexslider {
        position: relative;
        width: 100% !important;
        height: auto !important; /* neutralise le style inline height:428px */
    }
    .scald-flexslider .slides {
        display: flex;
        margin: 0;
        padding: 0;
        list-style: none;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        scrollbar-width: none;
    }
    .scald-flexslider .slides::-webkit-scrollbar { display: none; }
    .scald-flexslider .slides > li {
        flex: 0 0 100%;
        scroll-snap-align: center;
        list-style: none;
        margin: 0 1em;
    }
    .scald-flexslider img {
        display: block;
        width: 100%;
        height: auto;
        max-height: 600px;
        object-fit: contain;
    }
    .scald-flexslider .flex-caption:empty { 
        display: none; 
    }

    /* Contrôles ajoutés par le JS */
    .gl-carousel__btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 44px;
        height: 44px;
        border: 2px solid #15428E;
        border-radius: 50%;
        background: #15428E;
        color: #fff;
        font-size: 22px;
        line-height: 0;
        cursor: pointer;
        z-index: 2;
    }
    .gl-carousel__btn--prev { 
        left: -1.8em; 
    }
    .gl-carousel__btn--next { 
        right: -1.8em; 
    }
    .gl-carousel__btn:disabled, .gl-carousel__btn:disabled:hover { 
        opacity: .35; 
        cursor: default; 
        background: #15428E;
        color: #fff;
    }
    .gl-carousel__count {
        position: absolute;
        bottom: 10px;
        right: 10px;
        padding: 4px 10px;
        border-radius: 999px;
        background: rgba(21, 66, 142, .85);
        color: #fff;
        font-size: 14px;
    }
}