/* modal-prestas.css
   Modal "Prestation" (cards -> modal + swiper).
*/

.modal{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(8px);
  z-index: 10050; /* > header (9999) */
}
html.is-modal-open,
body.is-modal-open{
  overflow: hidden;
}

/* Backdrop cliquable (fermeture en cliquant hors du panel) */
.modal__backdrop{
  position: absolute;
  inset: 0;
  background: transparent; /* le fond est déjà sur .modal */
  z-index: 0;
}

/* Le panel doit passer au-dessus du backdrop */
.modal__panel{
  z-index: 1;
}

.modal[aria-hidden="true"]{ display:none; }

.modal__panel{
  position: relative;
  width: min(1100px, 100%);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(10,10,10,.86);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 20px 70px rgba(0,0,0,.55);
}

.modal__media{
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.modal__close{
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
}

.modal__close:hover{ background: rgba(0,0,0,.55); }

.modal__overlay{
  position: absolute;
  inset: 0;
  display: grid;
  align-content: space-between;
  padding: 18px 18px 14px;
  pointer-events: none;
  z-index: 5;
}

.modal__title{
  margin: 0;
  color: #fff;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: .2px;
  text-shadow: 0 6px 25px rgba(0,0,0,.85);
}

.modal__text{
  margin: 0;
  color: rgba(255,255,255,.92);
  font-size: 14px;
  line-height: 1.35;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
  max-width: 70ch;
}

/* Slider in modal */
.modal__media [data-presta-swiper]{
  width: 100%;
  height: 100%;
}

.modal__media img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

@media (max-width: 980px){
  .modal{
    padding: 16px;
  }
  .modal__panel{
    border-radius: 16px;
  }
  .modal__title{
    font-size: 22px;
  }
  .modal__text{
    font-size: 13px;
  }
}

/* =========================================================
   MODE "CARD SWIPE" : une slide = une card complète
   Objectif : le cadre / le bouton fermer / l'overlay swipent ENSEMBLE.
   ========================================================= */

/* On neutralise les éléments globaux (hors slides) */
.modal.modal--slidecards .modal__panel > .modal__close{ display:none; }
.modal.modal--slidecards .modal__media > .modal__overlay{ display:none; }

/* Le panel ne doit plus faire "cadre" (sinon double arrondi + double masque) */
.modal.modal--slidecards .modal__panel{
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}

/* Le Swiper doit pouvoir laisser "déborder" les cards voisines (peek) */
.modal.modal--slidecards .modal__media .swiper{ overflow: visible; }

/* Une card par slide */
.modal.modal--slidecards .presta-slide-card{
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(20,20,20,.92);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 30px 70px rgba(0,0,0,.5);
}

/* Le close dans la card */
.modal.modal--slidecards .presta-slide-card .modal__close{
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 30;
}

/* L'image ne doit PAS avoir ses propres coins arrondis */
.modal.modal--slidecards .presta-slide-card img{ border-radius: 0 !important; }

/* Largeur des slides en mode "cards" (permet le peek gauche/droite) */
.modal.modal--slidecards .swiper-slide{
  width: min(980px, 86%);
}

@media (max-width: 720px){
  .modal.modal--slidecards .swiper-slide{ width: 92%; }
}

/* Atténuation des slides hors focus */
.modal.modal--slidecards .swiper-slide{ transition: transform .2s ease, filter .2s ease, opacity .2s ease; }
.modal.modal--slidecards .swiper-slide:not(.swiper-slide-active){
  filter: brightness(.55);
  opacity: .9;
  transform: scale(.97);
}

/* En mode "slidecards", on veut que l’image remplisse la card */
.modal.modal--slidecards .presta-slide-card img{
  object-fit: cover;
}

/* Smartphone paysage : réduire l’empreinte de la card pour laisser du backdrop cliquable */
@media (max-height: 520px) and (orientation: landscape){
  .modal{
    padding: 10px;
  }

  /* panel un peu moins "full screen" */
  .modal__panel{
    width: min(880px, 88vw);
    border-radius: 14px;
  }

  /* image moins haute : on “écrase” le 16/9 en paysage */
  .modal__media{
    aspect-ratio: 21 / 9;
  }

  /* card un peu moins large en slidecards */
  .modal.modal--slidecards .swiper-slide{
    width: 86%;
  }
}

/* Mode slidecards : pas de "cadre noir" derrière la card */
.modal.modal--slidecards .modal__media{
  background: transparent;
}

/* =========================================================
   Bullets sous la card centrale (mode slidecards)
   ========================================================= */

.modal.modal--slidecards .swiper-pagination{
  /* On sort la pagination de la zone image */
  bottom: -34px;                /* ajuste si tu veux plus bas */
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: max-content;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(10px);
}

/* Option : un peu plus d’air en portrait */
@media (max-width: 720px) and (orientation: portrait){
  .modal.modal--slidecards{
    padding-top: 120px;   /* place pour le texte au-dessus de la photo */
    padding-bottom: 24px;
  }

  .modal.modal--slidecards .presta-slide-card{
    overflow: visible;
  }

  .modal.modal--slidecards .swiper-pagination{
    bottom: -40px;
  }

  /* En portrait: on affiche le texte SEULEMENT pour la slide active,
     sous les bullets (évite de masquer la photo + évite le chaos visuel). */
  .modal.modal--slidecards .swiper-slide .modal__text{
    display: none;
  }

  .modal.modal--slidecards .swiper-slide.swiper-slide-active .modal__text{
    display: block;
    left: 50%;
    right: auto;
    top: auto;
    bottom: calc(100% - 0px); /* calé sur le haut de la card */
    transform: translateX(-50%);
    width: min(88vw, 460px);
    border-radius: 12px;
    text-align: left;
    z-index: 40;
  }
}

/* =========================================================
   Bandeau texte positionnable par slide (4 coins)
   data-text-pos="tl|tr|bl|br"
   ========================================================= */

/* En mode slidecards : on veut pouvoir coller le bandeau au bord de l'image */
.modal--slidecards .presta-slide-card .modal__overlay{
  padding: 0; /* sinon le bandeau part à 18px du bord */
}

/* On garde le titre comme avant (inset “confort”) */
.modal--slidecards .presta-slide-card .modal__title{
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  text-shadow:
    0 4px 12px rgba(0,0,0,.88),
    0 14px 34px rgba(0,0,0,.68),
    0 0 2px rgba(0,0,0,.92);
}

.modal--slidecards .presta-slide-card .modal__text{
  position: absolute;
  margin: 0;
  width: fit-content;
  white-space: normal;
  padding: 12px 16px;

  /* typo 2026 */
  font-size: clamp(14px, 1.6vw, 18px);
  font-weight: 700;
  letter-spacing: .2px;
  line-height: 1.15;

  /* look */
  background: rgba(0,0,0,.38);
  border: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(6px);
}
/* Bottom Left */
.modal--slidecards .presta-slide-card .modal__text[data-text-pos="bl"]{
  left: -2px;              /* collé à l'image */
  bottom: 18px;         /* mais pas collé en bas */
  border-radius: 0 10px 10px 0; /* radius plus fin côté libre (droite) */
}

/* Bottom Right */
.modal--slidecards .presta-slide-card .modal__text[data-text-pos="br"]{
  right: -2px;             /* collé à l'image */
  bottom: 18px;         /* mais pas collé en bas */
  border-radius: 10px 0 0 10px; /* radius plus fin côté libre (gauche) */
}

/* Top Left */
.modal--slidecards .presta-slide-card .modal__text[data-text-pos="tl"]{
  left: -2px;              /* collé à l'image */
  top: 100px;           /* plus bas qu'en haut */
  border-radius: 0 10px 10px 0;    /* radius côté libre (bas/droite) */
}

/* Top Right */
.modal--slidecards .presta-slide-card .modal__text[data-text-pos="tr"]{
  right: -2px;             /* collé à l'image */
  top: 100px;           /* plus bas qu'en haut */
  border-radius: 10px 0 0 10px;    /* radius côté libre (bas/gauche) */
}
