/* Wrapper global */
.ter-actualites-wrapper {
    margin: 40px auto;
    padding: 20px 10px 40px;
}

/* Header : "Trier par / Les plus récents" */
.ter-actualites-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 3.3rem;
    gap: 12px;
    padding: 0 10px;
}

.ter-actualites-sort-label {
    font-weight: 400;
    font-size: 1rem;
    color: #000000;
}

.ter-actualites-sort-select {
    position: relative;
    display: inline-block;
}

.ter-actualites-sort-select select {
    border-radius: 4.281px;
    padding: 0.5rem 2.2rem 0.5rem 0.85rem; /* marge droite augmentée pour le chevron */
    border: none;
    background: #2D50E5;
    color: #ffffff;
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Chevron ↓ */
.ter-actualites-sort-select::after {
    content: "";
    position: absolute;
    pointer-events: none;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;

    /* Chevron SVG blanc fin */
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7L10 12L15 7' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 10px 10px;
    background-repeat: no-repeat;
}

.ter-actualites-sort-select select:focus {
    color: #ffffff !important;
    outline: none;
}

/* Grille des cartes */
.ter-actualites-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3.56rem;
    padding: 0;
}

@media (max-width: 1024px) {
    .ter-actualites-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .ter-actualites-wrapper {
        padding: 20px 10px;
        border-radius: 0;
        margin: 0;
    }

    .ter-actualites-grid {
        grid-template-columns: 1fr;
    }

    .ter-actualites-header {
        justify-content: space-between;
        padding: 0;
    }
}

/* Carte */
.ter-actualite-card {
    background: #ffffff;
    border-radius: 14.556px;
    box-shadow: 0 3.882px 3.882px 0 rgba(0, 0, 0, 0.03);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ter-actualite-card-image img {
    width: 100%;
    height: 11.5rem;
    object-fit: cover;
    display: block;
}

.ter-actualite-card-body {
    padding: 0.875rem 1.88rem 2.1rem 1.88rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ter-actualite-card-category {
    font-size: 0.64rem;
    text-transform: uppercase;
    color: #929292;
    font-weight: 400;
}

.ter-actualite-card-title {
    font-size: 1.05rem;
    line-height: 1.3;
    font-weight: 700;
    color: #2D50E5;
    margin: 0;
}

.ter-actualite-card-excerpt {
    font-size: 0.75rem;
    font-weight: 400;
    color: #000;
    line-height: 1.5;
}

.ter-actualite-readmore {
    margin-top: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2D50E5;
    text-decoration: none;
    transition: all 300ms ease 0ms !important;
}

.ter-actualite-readmore:hover {
    color: #2D50E5;
	 font-weight: 800;
}

/* ----------------------------------------------------------- */
/* Popup */
/* ----------------------------------------------------------- */

body.ter-actualite-modal-open {
    overflow: hidden;
}

.ter-actualite-modal {
    position: fixed;
    inset: 0;
    display: none; /* base : masqué */

    /* z-index très élevé pour passer au-dessus du header/footer Divi */
    z-index: 2147483647;

    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
}

/* Quand la classe .is-open est ajoutée : on affiche en flex */
.ter-actualite-modal.is-open {
    display: flex;
}

.ter-actualite-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 1;
}

.ter-actualite-modal-dialog {
    position: relative;
    max-width: 94vh;
	max-height: 70vh;
    margin: 0;
    width: 100%;
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.ter-actualite-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: transparent;
    font-size: 1rem;
    cursor: pointer;
    color: #003361;
    z-index: 10;
    border: 1px solid #003361;
    border-radius: 50%;
    padding: 0px 6px;
}

.ter-actualite-modal-close:hover {
    color: #4b5563;
}

/* Contenu gauche / droite */
.ter-actualite-modal-content {
    display: flex;
    flex-direction: row;
    height: 100%;

    /* IMPORTANT : pour que la colonne gauche puisse s'étirer en hauteur */
    align-items: stretch;
	overflow: hidden;
}

.ter-actualite-modal-left {
    padding: 0px;
    flex: 1;

    /* IMPORTANT : l'image doit pouvoir remplir toute la hauteur */
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.ter-actualite-modal-right {
    flex: 1.2;
    overflow-y: auto;

    /* Centrage vertical */
    display: flex;
    flex-direction: column;
    /*justify-content: center;*/

    /* Important pour que le scroll fonctionne dans un flex container */
    min-height: 0;

    padding: 2.5rem 4.4rem;
	
	overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* IMAGE : remplit toute la hauteur de la colonne gauche */
.ter-actualite-modal-image {
    width: 100%;
    height: 100%;
    max-height: none;     /* on annule la limite précédente */
    object-fit: cover;    /* remplit la zone (comme un background cover) */
    display: block;
}

/* Titre + texte */
.ter-actualite-modal-title {
    font-family: 'Montserrat', Helvetica, Arial, Lucida, sans-serif;
    font-size: 1.88rem;
    line-height: 1.3;
    font-weight: 700;
    margin: 0 0 1.69rem 0;
    padding: 0px;
    color: #2D50E5;
}

.ter-actualite-modal-text {
    font-size: 1rem;
    line-height: 1.4;
    color: #000;
    font-weight: 400;
}

.ter-actualite-modal-text p {
    padding: 0 !important;
    margin-bottom: 1.57rem;
}
.ter-actualite-modal-text ul{
	list-style-type:disc;
	list-style-position:inside;
}
.ter-actualite-modal-text a{
	color:#2D50E5;
}
.ter-actualite-modal-text a:hover{
	color: #2D50E5;
    font-weight: 800 !important;
}
.ter-actualite-card-clickable {
  cursor: pointer;
}
@media (max-width: 900px) {

    .ter-actualite-modal-dialog {
        max-height: 85vh;
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .ter-actualite-modal-content {
        flex-direction: column;
        height: 100%;
        overflow: hidden; /* important */
    }

    /* Image en haut avec hauteur fixe */
    .ter-actualite-modal-left {
        flex: 0 0 auto;
        width: 100%;
    }

    .ter-actualite-modal-image {
        width: 100%;
        height: auto;
        max-height: 40vh;
        object-fit: cover;
        display: block;
    }

    /* ZONE SCROLLABLE */
	.ter-actualite-modal-right{
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;

      display: flex;
      flex-direction: column;
      justify-content: flex-start;   /* au lieu de center */
      align-items: stretch;

      padding: 20px 1.5rem 1rem 1.5rem;
  }
}
