/* Le groupe parent .mega-menu devient un panneau plein écran masqué */
.mega-menu {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: start center;
  padding: 48px 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 9998;
}

/* Pseudo élément*/
.mega-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.6;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='1445.692' height='1699.776' viewBox='0 0 1445.692 1699.776'><path d='M229.567,8.315C-222.571,96.407-399.507,517.759-309.926,977.549s413.727,783.518,863.9,695.81,614.83-506.327,543.092-969.237c-70.9-457.484-304.558-805.486-867.5-695.806m68.529,1307.2C-74.4,1214.646-334.43,920.349-282.694,658.189S112.952,265.277,485.449,366.152s644.493,393.791,592.757,655.949S670.6,1416.391,298.1,1315.518' fill='%23f2e0d1' opacity='.6'/></svg>");
  background-repeat: no-repeat;
  background-position: left 0 top -24rem;
  background-size: contain;
}

.mega-menu.is-open {
  opacity: 1;
  pointer-events: auto;
}
/* .mega-menu.is-open::before {
  opacity: 1;
} */

/* Contenant interne (ton sous-groupe .mega-dialog) */
.mega-dialog {
  position: relative;
  z-index: 1; /* au-dessus de l’overlay */
  color: var(--wp--preset--color--primary);
}
@media (min-width: 67.5em) {
  .mega-dialog {
padding-inline: 2rem;
} 
}
/* Bouton fermer */
/* .mega-close {
  position: absolute;
  right: 24px;
  top: 24px;
  background: #111;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  z-index: 2;
} */
.admin-bar .mega-close {
  top: calc(24px + 32px);
}
@media (max-width: 782px) {
  .admin-bar .mega-close {
    top: calc(24px + 46px);
  }
}

/* Empêcher le scroll de la page quand le menu est ouvert */
body.mega-open {
  overflow: hidden;
}
body.mega-open .floating-nav {
  opacity: 0.35;
  pointer-events: none;
}

/* Cartes et listes, SCOPÉ sous .mega-menu */
.mega-menu .cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 46px;
  margin-top: 4rem !important;
}
.mega-menu .card {
  position: relative;
  height: 320px;
  padding-bottom: 1.4rem;
  overflow: hidden;
}
@media (max-width: 48em) {
  .mega-menu .card {
    height: 300px;
  }
}
@media (min-width: 50em) {
  .mega-menu .card {
    height: 400px;
  }
}
@media (min-width: 67em) {
  .mega-menu .card {
    height: 320px;
  }
}
.mega-menu .card__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  border-radius: var(--wp--custom--radius--l);
}
.mega-menu .card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(34, 34, 34, 0.44));
}

.mega-menu .card__content {
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  position: absolute;
  bottom: 4rem;
  left: -1rem;
}

.card__content a {
  text-decoration: none;
}
.mega-menu .card__title {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--wp--preset--color--base);
}
.mega-menu .card__title a:hover {
  text-decoration: underline;
  animation: ease-in-out 0.2s;
}

.mega-menu .card__title strong {
  background: var(--wp--preset--color--accent-4);
  color: var(--wp--preset--color--primary);
  padding: 1rem 4rem 1.5rem 1rem;
  transform-origin: left top; /* pivot en haut-gauche */
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  will-change: transform;
}
.mega-menu .card__title a strong:hover {
  transform: scale(4); /* léger zoom */
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  padding-left: 2rem;
  animation: ease-in-out 0.2s;
}
.mega-menu .card-title p a:hover {
  text-decoration: none;
}
.mega-menu .card__title strong {
  transform: scale(0.98); /* petit “press” au clic */
}

.mega-menu .card__title a p:nth-last-child {
  padding-left: 1.2rem;
}
.mega-menu .cards .card:nth-child(2) .card__title strong {
  background: var(--wp--preset--color--accent-7);
}
.mega-menu .card__bullets {
  list-style: none;
  margin-left: 4rem;
  padding: 0;
}
.mega-menu .card__bullets li {
  position: relative;
  padding-left: 26px;
  margin: 9px 0;
}
.mega-menu .card__bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--wp--preset--color--accent-4);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.25);
}
.cards .card:nth-child(2) li::before {
  background: var(--wp--preset--color--accent-7);
}
.mega-menu .card__bullets a {
  color: var(--wp--preset--color--base);
  text-decoration: none;
  font-family: var(--wp--preset--font-family--secondary);
  font-weight: 500;
  font-size: 1.125rem;
}
.mega-menu .card__bullets a:hover {
  text-decoration: underline;
}
.mega-menu .shortcuts {
  margin: 36px auto 0;
  max-width: 920px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
/* 1) La carte peut laisser dépasser le contenu (l'étiquette) */
.mega-menu .card {
  overflow: visible; /* ← au lieu de hidden */
}

/* Garder les coins arrondis sur le fond et le voile */
.mega-menu .card__bg,
.mega-menu .card::after {
  border-radius: 22px;
}

/* 2) Étiquette (le mot en <strong>) qui sort en haut gauche */
.mega-menu .card__title {
  position: relative;
}

/* style de base déjà présent (couleur via accent-4 / accent-7).
   On le transforme en "ribbon" qui dépasse */
.mega-menu .card__title {
  display: inline-block;
  padding: 0.6rem 1rem 0.9rem 0.9rem; /* un peu plus compact que le style inline */
  line-height: 1.5;
  z-index: 3;
  /* on NE change PAS le background ici pour garder tes variantes existantes */
}

.mega-menu .card__title ::before {
  content: "";
  position: absolute;
  left: -40px;
  top: -56px;
  width: 76px;
  height: 76px;
  background: var(--hero-arrow) no-repeat center / contain;
  opacity: 1; /* ne touche que la flèche */
  pointer-events: none;
  z-index: 1;
}
/* Wrapper overlay : plein écran, fermé par défaut */
.mega-menu {
  position: fixed;
  inset: 0;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  /* on évite que le wrapper prenne le scroll */
  overflow: hidden;
}

/* Ouvert */
.mega-menu.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Zone scrollable interne */
.mega-menu__scroll {
  position: absolute;
  top: var(
    --nav-h,
    56px
  ); /* laisse la top bar en mobile ; mets 0 si tu veux couvrir tout */
  right: 0;
  bottom: 0;
  left: 0;

  overflow-y: auto; /* ← le scroll se fait ici */
  -webkit-overflow-scrolling: touch; /* iOS */
  overscroll-behavior: contain; /* évite les rebonds sur mobile */
  scrollbar-gutter: stable both-edges;

  padding-block: 0 !important;
  padding-inline: 24px !important;
  min-height: 0; /* utile si parent flex */
  min-width: 0;
  max-height: calc(100dvh - var(--nav-h, 56px)); /* viewport mobile fiable */
}

/* Desktop : si tu veux que ça parte du haut aussi en desktop */
@media (min-width: 1025px) {
  .mega-menu__scroll {
    top: 0;
    max-height: 100dvh;
  }
}

/* Filet de sécurité : la nav au-dessus pendant l’anim */
.floating-nav {
  z-index: 10001;
}

/* Option: peaufiner sur écrans plus petits - Ajout du 14/09 */
@media (max-width: 48em) {
  .mega-menu .cards {
    margin-top: 0 !important;
    grid-template-columns: 1fr;
    gap: 6rem;
  }
  .mega-left {
    grid-template-columns: 1fr;
    gap: 4rem;
  }
  .mega-menu .card__title {
    /* font-size: 2.4rem; */
    /* font-weight: 800; */
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
  }

  .mega-menu .card__content {
    /* bottom: 3.4rem; */
    /* left: -1rem; */
    left: -3rem;
    /* bottom: 10rem; */
  }

  .mega-menu .card__title {
    right: -2.1rem;
    top: -1rem;
    padding-bottom: 1rem;
  }

  .mega-menu .card__title ::before {
    left: -8px;
    top: -45px;
    width: 48px;
    height: 48px;
  }
  .mega-menu .card__title strong {
    padding-bottom: 0rem;
    padding-right: 0.5rem;

  }
  .mega-menu .card__title strong::after {
    left: 20px;
  }
  .mega-left .cards .card {
    height: 291px;
    width: 248px;
  }
  .mega-menu .card__bullets a {
    font-size: 1rem !important;
  }
}
@media (max-width: 1024px) {
  .mega-menu {
    /* déjà position: fixed; inset: 0; etc. */
    padding-top: calc(var(--nav-h, 56px) + 16px); /* espace sous la barre */
  }

}
@media (min-width: 48em) {
  .menudesc {
display: grid !important;
grid-template-columns: 1fr 2fr !important;
gap: 1rem !important;
justify-content: space-between !important;
}
.menu-desc .wp-block-site-tagline {
  align-self: flex-end !important;
  font-size: 1rem;
}
}