/* 
  Ce site est développé par :
  Jean-François McDuff
  et
  Sylvain Meunier
  
  Pour le compte de :
  Mouvement des Insoumis

  2020 © Mouvement des Insoumis - Tous droits réservés
*/

/* Fond et opacité de la modale */

.modal, .modalX { 
    position: fixed;
    z-index: 7;
    left: 1%;
    top: 1%;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
    transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;
    display: none;
}

.modal_portrait { 
    position: fixed;
    z-index: 15;
    left: 1%;
    top: 1%;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
    transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;
    display: none;
}

/* Boîte d'information de la modale */
.modal-content { 
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 1% 2%;
    min-width: 45%;
    max-width: 60%;
    max-height: 85vh;
    border-radius: 0.5rem;
}
.modal-contentX { 
    position: absolute;
    top: 48%;
    left: 48%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 1% 2%;
    width: 85%;
    max-height: 85vh;
    border-radius: 0.5rem;
}
.modalPortrait-content { 
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 1% 2%;
    min-width: 45%;
    max-width: 80%;
    max-height: 55vh;
    border-radius: 0.5rem;
}

.modalShow {
    display: block;
}

.modalHide {
    display: none;
}

/* Entête de la modal */
.modal-texte {
    width: 96%;
    margin-right: 2%;
    margin-left: 2%;
    max-height: 50vh;
    overflow-y: scroll;
}


/* Bouton 'X' pour fermer la modale */
.close-button { 
    float: right;
    width: 1.5rem;
    line-height: 1.5rem;
    text-align: center;
    cursor: pointer;
    border-radius: 0.25rem;
    background-color: lightgray;
}

/* survol du bouton 'X' */
.close-button:hover { 
    background-color: darkgray;
}

/* Modification du curseur au survol d’un clic modal */
.curseur_main:hover {
  cursor: pointer;
}

/* Ajustement de type d'images spécifiques */
.paysage {
    width: 28%;
    margin: 5px 1% 5px 0;
    z-index: 15;
}

.paysage:hover {
    width: 56%;
    margin: 5px 1% 5px 0;
    z-index: 30;
}

/* Quand .paysage est dans une figure flottante (paysageg / paysaged),
   la figure a une largeur fixe — l'image doit remplir cette figure */
figure[style*="float"] .paysage {
    width: 100%;
    margin: 0;
}
figure[style*="float"] .paysage:hover {
    width: 100%;
    margin: 0;
}

.portrait {
    width: 20%;
    margin-right: 1%;
    margin-left: 1%;
    z-index: 15;
}

.portrait:hover {
    width: 40%;
    margin-right: 1%;
    margin-left: 1%;
    z-index: 30;
}

/* ************************************* Fin de Modal ****************************************** */

/* ═══════════════════════════════════════════════════════════
   ADAPTATION MOBILE — format portrait ≤ 768px
   La boîte modale est positionnée avec top/left/right/bottom
   explicites pour garantir des marges visibles sur tous les côtés
   ═══════════════════════════════════════════════════════════ */
@media screen and (max-width: 768px) {

  .modal,
  .modalX,
  .modal_portrait {
    position: fixed !important;
    top: 65px !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 65px) !important;
    background-color: rgba(0, 0, 0, 0.65) !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    z-index: 490 !important;
  }

  .modal-content,
  .modal-contentX,
  .modalPortrait-content {
    position: absolute !important;
    top: 10px !important;
    left: 4% !important;
    right: 4% !important;
    bottom: 10px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    transform: none !important;
    border-radius: 10px !important;
    padding: 12px 4% !important;
    box-sizing: border-box !important;
    overflow-y: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6) !important;
  }

  .modal-texte {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    font-size: 15px !important;
    max-height: none !important;
  }

  /* Sur mobile : les figures flottantes (paysageg/paysaged) passent en bloc pleine largeur */
  figure[style*="float"] {
    float: none !important;
    width: 96% !important;
    margin: 6px auto !important;
    display: block !important;
  }

  figure[style*="float"] .paysage,
  figure[style*="float"] .paysage:hover {
    width: 100% !important;
    margin: 0 !important;
  }

}