/* ==========================================================================
   Grandis — Menu : burger + overlay plein écran (<=1024px)
   + dropdown "Nos offres" coloré (desktop >1024px)
   mu-plugin grandis-menu — n'altère pas le plugin gsap-hamburger-menu partagé
   ========================================================================== */

:root{
  --gr-green:#41ae96;
  --gr-cream:#f2f0e7;
  --gr-ink:#233028;
}

/* Neutraliser les artefacts de l'ancien menu hamburger sur ce site */
.ghm-hamburger,
.ghm-menu-mobile{ display:none !important; }

/* --- Bouton burger (masqué en desktop) --- */
#gr-burger{ display:none; }

@media (max-width:1024px){
  #gr-burger{
    position:fixed; top:34px; right:20px;
    width:52px; height:52px; border-radius:50%;
    background:var(--gr-green); border:none; cursor:pointer;
    z-index:2147483000;
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px;
    box-shadow:0 6px 16px rgba(0,0,0,.18);
  }
  #gr-burger span{ display:block; width:24px; height:2.5px; border-radius:3px; background:#fff; transition:transform .25s ease, opacity .2s ease; }
  body.gr-open #gr-burger span:nth-child(1){ transform:translateY(7.5px) rotate(45deg); }
  body.gr-open #gr-burger span:nth-child(2){ opacity:0; }
  body.gr-open #gr-burger span:nth-child(3){ transform:translateY(-7.5px) rotate(-45deg); }

  /* Sous 1024px, tout passe dans l'overlay : on masque le menu inline, la recherche et la pastille top de l'entête */
  .ghm-frontend-wrapper{ display:none !important; }
  .heading .wp-block-search{ display:none !important; }
  .translate{ display:none !important; }
}

/* --- Overlay plein écran --- */
#gr-overlay{
  position:fixed; inset:0; background:var(--gr-cream);
  z-index:2147482000; overflow-y:auto; -webkit-overflow-scrolling:touch;
  opacity:0; transform:translateY(-10px); pointer-events:none;
  transition:opacity .32s ease, transform .32s ease;
}
#gr-overlay.open{ opacity:1; transform:none; pointer-events:auto; }
.gr-in{ max-width:560px; margin:0 auto; padding:26px 22px 44px; }

.gr-top{ display:flex; align-items:center; justify-content:space-between; margin-bottom:22px; }
.gr-logo{ display:flex; align-items:center; }
.gr-logo img{ max-height:46px; width:auto; display:block; }
.gr-logo .gr-wordmark{ font-family:var(--wp--preset--font-family--kensington,Georgia,serif); font-size:30px; color:var(--gr-green); }
.gr-x{ display:none; }

.gr-search{
  display:flex; align-items:center; background:#fff;
  border:2.5px solid var(--gr-ink); border-radius:40px;
  padding:6px 6px 6px 20px; margin-bottom:26px;
}
.gr-search input{
  flex:1; border:none; outline:none; background:none;
  font-family:var(--wp--preset--font-family--neulis-sans,system-ui,sans-serif);
  font-size:15px; color:var(--gr-ink); padding:11px 0;
}
.gr-search input::placeholder{ color:var(--gr-ink); opacity:.55; }
.gr-search button{
  width:44px; height:44px; border-radius:50%; background:var(--gr-cream); border:none; cursor:pointer;
  color:var(--gr-ink); display:flex; align-items:center; justify-content:center; flex:0 0 auto;
}
.gr-search button svg{ width:20px; height:20px; }

/* Résultats de recherche live (AJAX REST) */
.gr-results{ display:none; margin:-14px 0 26px; }
.gr-results.open{ display:block; }
.gr-res{
  display:flex; align-items:center; gap:12px; padding:13px 14px; margin-bottom:8px;
  background:#fff; border-radius:14px; text-decoration:none; transition:transform .1s ease;
}
.gr-res:active{ transform:scale(.99); }
.gr-res-dots{ display:flex; gap:4px; flex:0 0 auto; }
.gr-res-dot{ width:12px; height:12px; border-radius:50%; }
.gr-res-b{ display:flex; flex-direction:column; min-width:0; flex:1 1 auto; }
.gr-res-t{
  font-family:var(--wp--preset--font-family--neulis-sans,system-ui,sans-serif);
  font-weight:600; font-size:16px; color:var(--gr-ink); line-height:1.25;
}
.gr-res-d{
  font-family:var(--wp--preset--font-family--neulis-sans,system-ui,sans-serif);
  font-size:13px; color:var(--gr-ink); opacity:.6; line-height:1.3;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.gr-res-ar{ color:var(--gr-green); flex:0 0 auto; display:flex; }
.gr-res-ar svg{ width:18px; height:18px; }
.gr-res-msg{
  font-family:var(--wp--preset--font-family--neulis-sans,system-ui,sans-serif);
  font-size:14px; color:var(--gr-ink); opacity:.7; padding:10px 4px;
}
#gr-overlay.gr-searching .gr-lab,
#gr-overlay.gr-searching .gr-grid,
#gr-overlay.gr-searching .gr-links,
#gr-overlay.gr-searching .gr-foot{ display:none; }

.gr-lab{
  font-family:var(--wp--preset--font-family--kensington,Georgia,serif);
  text-transform:uppercase; letter-spacing:1.5px; font-size:14px;
  color:var(--gr-ink); opacity:.6; margin:0 2px 12px;
}

.gr-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:30px; }
.gr-cat{
  position:relative; border-radius:18px; min-height:88px; padding:14px;
  display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-end; gap:6px;
  text-decoration:none;
  font-family:var(--wp--preset--font-family--kensington,Georgia,serif);
  text-transform:uppercase; font-size:25px; line-height:1.0; letter-spacing:.3px; color:var(--gr-ink);
  transition:transform .12s ease;
}
.gr-cat:active{ transform:scale(.97); }
.gr-cat .ar{ position:absolute; top:12px; right:14px; width:20px; height:20px; opacity:.75; }
.gr-cat .gr-ico{
  width:50px; height:50px; opacity:.9; background:var(--gr-ink);
  -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
  -webkit-mask-size:contain; mask-size:contain;
  -webkit-mask-position:left center; mask-position:left center;
}
.gr-cat .gr-cat-n{ display:block; }

.gr-links{ list-style:none; margin:0 0 26px; padding:0; }
.gr-links a{
  display:flex; align-items:center; justify-content:space-between; text-decoration:none;
  font-family:var(--wp--preset--font-family--neulis-sans,system-ui,sans-serif);
  font-weight:600; font-size:19px; color:var(--gr-ink);
  padding:17px 2px; border-bottom:1.5px solid rgba(35,48,40,.14);
}
.gr-links li:first-child a{ border-top:1.5px solid rgba(35,48,40,.14); }
.gr-links .ch{ color:var(--gr-green); width:20px; height:20px; flex:0 0 auto; }

.gr-foot{
  display:flex; align-items:center; gap:6px;
  font-family:var(--wp--preset--font-family--neulis-sans,system-ui,sans-serif);
  font-size:13px; color:var(--gr-ink); opacity:.65;
}
.gr-foot b{ color:var(--gr-green); opacity:1; font-weight:600; }

@media (min-width:1025px){
  #gr-overlay{ display:none !important; }

  /* Panneau de résultats de la recherche desktop (entête) */
  .heading .wp-block-search{ position:relative; }
  .gr-desk-results{
    position:absolute; top:calc(100% + 12px); right:0; width:380px; max-width:70vw;
    background:#fff; border-radius:16px; box-shadow:0 16px 34px rgba(0,0,0,.16);
    padding:10px; z-index:2147482500; display:none;
  }
  .gr-desk-results.open{ display:block; }
  .gr-desk-results .gr-res{ background:transparent; margin-bottom:2px; padding:11px 12px; }
  .gr-desk-results .gr-res:hover{ background:var(--gr-cream); }
}

/* --- Dropdown "Nos offres" coloré (desktop) --- */
@media (min-width:1025px){
  .ghm-frontend-wrapper .wp-block-navigation-item.has-child:hover > .wp-block-navigation__submenu-container{
    display:grid !important; grid-template-columns:1fr 1fr; gap:10px;
    background:#fff !important; border-radius:18px; padding:14px; width:400px;
    box-shadow:0 16px 34px rgba(0,0,0,.16); margin-top:12px;
    position:absolute !important; top:100% !important; left:0 !important; z-index:99999 !important;
    visibility:visible !important; opacity:1 !important;
    height:auto !important; max-height:none !important; overflow:visible !important;
  }
  /* Pont invisible : couvre l'espace de 12px trigger<->dropdown pour ne pas perdre le :hover */
  .ghm-frontend-wrapper .wp-block-navigation-item.has-child:hover > .wp-block-navigation__submenu-container::before{
    content:""; position:absolute; top:-18px; left:0; width:100%; height:20px; background:transparent;
  }
  .ghm-frontend-wrapper .wp-block-navigation__submenu-container .wp-block-navigation-item{ margin:0 !important; }
  .ghm-frontend-wrapper .wp-block-navigation__submenu-container .wp-block-navigation-item__content{
    display:flex !important; flex-direction:column; align-items:flex-start; justify-content:flex-end; gap:8px;
    min-height:126px; padding:16px !important;
    border-radius:12px; white-space:normal !important;
    font-family:var(--wp--preset--font-family--kensington,Georgia,serif) !important;
    text-transform:uppercase !important; font-size:22px !important; line-height:1.0; letter-spacing:.3px;
    color:var(--gr-ink) !important;
  }
  .ghm-frontend-wrapper .wp-block-navigation__submenu-container .wp-block-navigation-item__content::before{
    content:""; width:62px; height:62px; opacity:.9; flex:0 0 auto;
    background:var(--gr-ink);
    -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
    -webkit-mask-size:contain; mask-size:contain;
    -webkit-mask-position:left center; mask-position:left center;
  }
  .ghm-frontend-wrapper .wp-block-navigation__submenu-container a[href*="/garde/"]{ background:#f7abc5; }
  .ghm-frontend-wrapper .wp-block-navigation__submenu-container a[href*="/garde/"]::before{ -webkit-mask-image:url(/wp-content/uploads/2025/09/garde.svg); mask-image:url(/wp-content/uploads/2025/09/garde.svg); }
  .ghm-frontend-wrapper .wp-block-navigation__submenu-container a[href*="/education/"]{ background:#bba9e6; }
  .ghm-frontend-wrapper .wp-block-navigation__submenu-container a[href*="/education/"]::before{ -webkit-mask-image:url(/wp-content/uploads/2025/09/education.svg); mask-image:url(/wp-content/uploads/2025/09/education.svg); }
  .ghm-frontend-wrapper .wp-block-navigation__submenu-container a[href*="/aide/"]{ background:#bacc76; }
  .ghm-frontend-wrapper .wp-block-navigation__submenu-container a[href*="/aide/"]::before{ -webkit-mask-image:url(/wp-content/uploads/2025/09/aide.svg); mask-image:url(/wp-content/uploads/2025/09/aide.svg); }
  .ghm-frontend-wrapper .wp-block-navigation__submenu-container a[href*="/sante/"]{ background:#82c7da; }
  .ghm-frontend-wrapper .wp-block-navigation__submenu-container a[href*="/sante/"]::before{ -webkit-mask-image:url(/wp-content/uploads/2025/09/sante.svg); mask-image:url(/wp-content/uploads/2025/09/sante.svg); }
  .ghm-frontend-wrapper .wp-block-navigation__submenu-container a[href*="/loisirs/"]{ background:#ffce53; }
  .ghm-frontend-wrapper .wp-block-navigation__submenu-container a[href*="/loisirs/"]::before{ -webkit-mask-image:url(/wp-content/uploads/2025/09/loisirs.svg); mask-image:url(/wp-content/uploads/2025/09/loisirs.svg); }
  .ghm-frontend-wrapper .wp-block-navigation__submenu-container a[href*="/culture/"]{ background:#41ae96; }
  .ghm-frontend-wrapper .wp-block-navigation__submenu-container a[href*="/culture/"]::before{ -webkit-mask-image:url(/wp-content/uploads/2025/09/culture.svg); mask-image:url(/wp-content/uploads/2025/09/culture.svg); }
  .ghm-frontend-wrapper .wp-block-navigation__submenu-container a:hover{ filter:brightness(.97); transform:translateY(-1px); transition:.15s; }
}
