/******************************************************************************************
 *
 * CSS : POPUP
 *
 *****************************************************************************************/

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none; /* caché par défaut */
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}

.popup-overlay.show {
  display: flex;
  opacity: 1;
}

.popup-box {
  background: #fff;
  border-radius: 12px;
  width: 750px;
  max-width: 90%;
  aspect-ratio: 4/3;
  display: flex;
  flex-direction: row;
  padding: 30px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}

.popup-close {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    font-size: 30px;
    color: #000000;
    cursor: pointer;
    line-height: 1em;
}

/* Affiche */
.popup-affiche {
  flex: 1;
  overflow: hidden;
  margin-right: 30px;
}

.popup-affiche img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

/* Photo mea (smartphone) */
.popup-photo-mea {
  flex: 1;
  overflow: hidden;
  margin-right: 30px;
  display: none;
}

.popup-photo-mea img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.popup-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 30px 0;
}

/* Badge */
.popup-badge {
    background: #41cc3b;
    color: white;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 12px;
    font-size: 24px;
    line-height: 2em;
    text-align: center;
}

/* Titre */
.popup-title {
    font-size: 32px;
    margin: 20px 0;
    line-height: 1.4em;
    letter-spacing: 0.5px;
    text-align: center;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 3;  /* max 3 lignes visibles */
/*  Les titres dépassant 3 lignes sont coupés avec …
    Les titres courts gardent leur taille normale. */
}

/* Première */
.popup-date {
    font-size: 23px;
    margin-bottom: 50px;
    line-height: 1.4em;
    font-weight: 600;
    text-align: center;
}

/* Boutons */
.popup-boutons {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    margin: 0 0 0;
}
.popup-boutons a {
    font-size: 15px!important;
}
.popup-boutons .bouton-voir a {
    border-color: #dd1c1a!important;
    background-color: #FFFFFF!important;
    color: #dd1c1a!important;
}
.popup-boutons .bouton-voir a:hover {
    border-color: #dd1c1a!important;
    background-color: #dd1c1a!important;
    color: #ffffff!important;
}
.popup-boutons .bouton-reserver a {
    border-color: #dd1c1a!important;
    background-color: #dd1c1a!important;
    color: #FFFFFF!important;
}
.popup-boutons .bouton-reserver a:hover {
    border-color: #dd1c1a!important;
    background-color: #FFFFFF!important;
    color: #dd1c1a!important;
}

/* SMARTPHONE */

@media all and (max-width: 767px) {

  .popup-box {
    flex-direction: column;
    width: 90%;
    aspect-ratio: auto;
  }
  .popup-photo-mea {
    display: block;
    margin: 0;
  }
  .popup-affiche {
    display: none;
  }
  .popup-badge {
    font-size: 6vw;
  }
  .popup-title {
    font-size: 7vw;
  }
  .popup-date {
    font-size: 5vw;
  }
}



@media all and (max-width: 767px) {
  .popup-photo-mea {
    display: block;
    margin: 0;
    overflow: visible;   /* <-- permet à l'image de ne pas être tronquée */
    /* max-height: 40vh;    optionnel : limite sa taille si tu veux */
  }

  .popup-photo-mea img {
    height: auto;        /* garde les proportions */
    max-height: 100%;    /* s'adapte à son conteneur */
  }

  .popup-box {
    flex-direction: column;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;    /* scroll vertical pour le texte */
    justify-content: flex-start;
    align-items: stretch;
  }

  .popup-text {
    flex: none;          /* texte scrollable */
  }
}