/* =========================================================
   MENU VERRE — Une Histoire de Com · v2.2.2
   Composant du studio. Tout se règle avec les variables --gn-* (voir LISEZMOI).
   Préfixe .gn : rien ne fuit vers le site, le thème ne s'y mêle pas (protections en bas).
========================================================= */

.gn,
.gn *,
.gn *::before,
.gn *::after { box-sizing: border-box; }

/* Teintes par zone (5 points le long de la barre), animables en douceur */
@property --gn-c0 { syntax: "<color>"; inherits: true; initial-value: rgba(34,34,34,.4); }
@property --gn-c1 { syntax: "<color>"; inherits: true; initial-value: rgba(34,34,34,.4); }
@property --gn-c2 { syntax: "<color>"; inherits: true; initial-value: rgba(34,34,34,.4); }
@property --gn-c3 { syntax: "<color>"; inherits: true; initial-value: rgba(34,34,34,.4); }
@property --gn-c4 { syntax: "<color>"; inherits: true; initial-value: rgba(34,34,34,.4); }

.gn {
  /* ---- Réglages par site (à surcharger dans style="" ou une feuille du site) ---- */
  --gn-accent-1: #FCCF31;
  --gn-accent-2: #FEA618;
  --gn-accent-3: #FF7F00;
  --gn-cta-fg: #202020;
  --gn-font: inherit;
  --gn-max: 880px;
  --gn-h: 46px;
  --gn-top: 16px;
  --gn-logo-bg: radial-gradient(circle at 35% 30%, #3a3a3a, #161616 70%);
  --gn-logo-h: 30px;     /* logo allongé : hauteur de l'image dans la pastille (valeur fixe : un % serait instable dans la grille) */
  --gn-logo-max: 170px;  /* logo allongé : largeur maximale de l'image */

  /* ---- Interne ---- */
  --gn-grad: linear-gradient(90deg, var(--gn-accent-1) 0%, var(--gn-accent-2) 55%, var(--gn-accent-3) 100%);
  --gn-spring: cubic-bezier(.34, 1.42, .5, 1);
  --gn-ease: cubic-bezier(.2, .7, .2, 1);
  --gn-mx: 50%;
  --gn-my: 0%;

  /* Teinte sombre (par défaut) */
  --gn-border: rgba(255,255,255,.17);
  --gn-rim: rgba(255,255,255,.28);
  --gn-shadow: 0 12px 40px -12px rgba(0,0,0,.6);
  --gn-lens-bg: rgba(255,255,255,.12);
  --gn-lens-rim: rgba(255,255,255,.4);
  --gn-drawer-bg: rgba(24,24,24,.84);

  position: fixed;
  z-index: 9990;
  top: var(--gn-top);
  left: 50%;
  width: min(calc(100% - 24px), var(--gn-max));
  transform: translateX(-50%);
  font-family: var(--gn-font);
  -webkit-font-smoothing: antialiased;
  pointer-events: none; /* seule la barre capte la souris */
  transition: top .5s var(--gn-ease), --gn-c0 .7s ease, --gn-c1 .7s ease, --gn-c2 .7s ease, --gn-c3 .7s ease, --gn-c4 .7s ease;
}

.gn[data-tone="light"] {
  --gn-border: rgba(255,255,255,.85);
  --gn-rim: rgba(255,255,255,1);
  --gn-shadow: 0 12px 40px -14px rgba(20,20,20,.3), 0 0 0 1px rgba(20,20,20,.05);
  --gn-lens-bg: rgba(255,255,255,.7);
  --gn-lens-rim: rgba(255,255,255,1);
  --gn-drawer-bg: rgba(255,255,255,.9);
}

body.admin-bar .gn { --gn-top: 48px; }
@media (max-width: 782px) { body.admin-bar .gn { --gn-top: 62px; } }
.gn.is-scrolled { --gn-top: 10px; }

/* Lien d'évitement (clavier) */
/* Caché au-dessus de l'écran quelle que soit sa hauteur (v2.2.2 : une interligne
   de thème plus grande le faisait dépasser de quelques pixels en haut de la page) */
.gn__skip {
  position: absolute;
  left: 0;
  top: 0;
  padding: 10px 16px;
  border-radius: 100px;
  background: #fff;
  color: #111;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  pointer-events: auto;
  transform: translateY(calc(-100% - var(--gn-top) - 20px));
  transition: transform .3s ease;
}
.gn__skip:focus { transform: none; }

/* ---------- La barre ---------- */

.gn__bar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 auto;
  padding: 7px;
  border-radius: calc(var(--gn-h) / 2 + 7px);
  pointer-events: auto;
  transition: border-radius .6s var(--gn-ease), width .6s var(--gn-spring);
}

/* Le verre : couche à part (et non la barre elle-même) pour que la bulle
   puisse aussi voir et déformer la page derrière */
.gn__glass {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gn-c0) 6%, var(--gn-c1) 30%, var(--gn-c2) 50%, var(--gn-c3) 70%, var(--gn-c4) 94%);
  -webkit-backdrop-filter: blur(16px) saturate(1.8);
  backdrop-filter: blur(16px) saturate(1.8);
  box-shadow: var(--gn-shadow);
  pointer-events: none;
  transition: box-shadow .6s ease;
}

/* Bord du verre : liseré + reflet haut */
.gn__glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid var(--gn-border);
  box-shadow:
    inset 0 1px 0 var(--gn-rim),
    inset 0 -1px 0 rgba(255,255,255,.06),
    inset 0 0 18px rgba(255,255,255,.05);
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0) 50%);
  transition: border-color .6s ease;
}

/* Reflet qui suit la souris (ou le défilement sur mobile) */
.gn__shine {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background:
    radial-gradient(180px 100px at var(--gn-mx) var(--gn-my), rgba(255,255,255,.13), transparent 70%);
  /* pas de mix-blend-mode : il annulerait le flou du verre dans Chrome */
  opacity: .6;
  pointer-events: none;
  transition: opacity .5s ease;
}
.gn__bar:hover .gn__shine { opacity: 1; }

/* Réfraction (navigateurs Chromium) : posée par le script */
.gn.has-refraction .gn__glass {
  -webkit-backdrop-filter: var(--gn-refract-bar) blur(7px) saturate(1.8);
  backdrop-filter: var(--gn-refract-bar) blur(7px) saturate(1.8);
}

/* ---------- Logo ---------- */

.gn__logo {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  flex: none;
  width: var(--gn-h);
  height: var(--gn-h);
  border-radius: 50%;
  background: var(--gn-logo-bg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 4px 12px -4px rgba(0,0,0,.5);
  text-decoration: none;
  overflow: hidden;
  transition: transform .5s var(--gn-spring);
}

.gn__logo img,
.gn__logo svg { display: block; width: 60%; height: 60%; object-fit: contain; }

/* Logo allongé (v2.1) : le logo complet dans une pastille, au lieu d'un symbole rond.
   Réglage « Forme du logo » de l'extension, ou classe gn__logo--wide dans le widget. */
.gn__logo--wide {
  width: auto;
  min-width: var(--gn-h);
  padding: 0 18px;
  border-radius: 100px;
}
.gn__logo--wide img,
.gn__logo--wide svg { width: auto; height: var(--gn-logo-h); max-width: var(--gn-logo-max); }

/* ---------- Liens ---------- */

.gn__links-wrap {
  position: relative;
  z-index: 1;
  flex: 0 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
  max-width: var(--gn-links-w, 1000px);
  margin: 0 auto; /* centré entre le logo et le bouton */
  transition: max-width .7s var(--gn-spring), opacity .4s ease;
}

.gn__links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* La bulle : une loupe en verre qui glisse (position pilotée par un ressort en JS) */
.gn__lens {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 100%;
  border-radius: 100px;
  opacity: 0;
  pointer-events: none;
  transform-origin: center;
  will-change: transform, width;
  transition: opacity .3s ease;
}

.gn__lens::before,
.gn__lens::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.gn__lens::before {
  background: var(--gn-lens-bg);
  -webkit-backdrop-filter: blur(3px) saturate(1.4) brightness(1.08);
  backdrop-filter: blur(3px) saturate(1.4) brightness(1.08);
  transition: background .6s ease;
}

.gn.has-refraction .gn__lens::before {
  -webkit-backdrop-filter: var(--gn-refract-lens) saturate(1.5) brightness(1.1);
  backdrop-filter: var(--gn-refract-lens) saturate(1.5) brightness(1.1);
}

.gn__lens::after {
  border: 1px solid var(--gn-lens-rim);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.55),
    inset 0 -2px 6px rgba(255,255,255,.08),
    0 8px 20px -10px rgba(0,0,0,.45);
  background: radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,.22), transparent 55%);
}

.gn__links.has-lens .gn__lens { opacity: 1; }

.gn__link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--gn-h);
  padding: 0 16px;
  border-radius: 100px;
  color: var(--gn-fg, rgba(255,255,255,.76));
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: color .35s ease;
}

.gn__link[data-tone="light"] { --gn-fg: rgba(24,24,24,.68); --gn-fg-on: #141414; }
.gn__link[data-tone="dark"]  { --gn-fg: rgba(255,255,255,.76); --gn-fg-on: #FFFFFF; }

.gn__link svg { width: 16px; height: 16px; flex: none; opacity: .8; }

.gn__link .gn__in {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transform: translate(var(--gn-px, 0px), var(--gn-py, 0px)) scale(var(--gn-zoom, 1));
  transition: transform .5s var(--gn-spring);
}

.gn__link.is-hover { --gn-zoom: 1.08; color: var(--gn-fg-on, #fff); }
.gn__link.is-active { color: var(--gn-fg-on, #fff); }
.gn__link.is-hover svg,
.gn__link.is-active svg { opacity: 1; color: var(--gn-accent-3); }

/* ---------- Sous-menu (v2.2) : panneau en verre sous le lien ---------- */

.gn { --gn-sub-bg: rgba(14,20,30,.8); --gn-sub-fg: rgba(255,255,255,.8); --gn-sub-fg-on: #fff; }
.gn[data-tone="light"] { --gn-sub-bg: rgba(255,255,255,.9); --gn-sub-fg: rgba(24,24,24,.72); --gn-sub-fg-on: #141414; }

.gn__item { position: relative; }

.gn__link .gn__chev { width: 12px; height: 12px; margin-left: -3px; opacity: .65; transition: transform .45s var(--gn-spring); }

.gn__sub {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 3;
  padding-top: 14px; /* pont invisible : la souris passe du lien au panneau sans le fermer */
  transform: translate(-50%, -6px) scale(.98);
  transform-origin: 50% 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, transform .5s var(--gn-spring), visibility 0s linear .22s;
}

.gn__item.has-sub:hover > .gn__sub,
.gn__item.has-sub:focus-within > .gn__sub,
.gn__item.has-sub.is-open > .gn__sub {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
  transition-delay: 0s;
}
.gn__item.has-sub:hover > .gn__link .gn__chev,
.gn__item.has-sub:focus-within > .gn__link .gn__chev,
.gn__item.has-sub.is-open > .gn__link .gn__chev { transform: rotate(180deg); }

.gn__sub-panel {
  position: relative;
  min-width: 250px;
  padding: 8px;
  border-radius: 22px;
  background: var(--gn-sub-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.8);
  backdrop-filter: blur(18px) saturate(1.8);
  border: 1px solid var(--gn-border);
  box-shadow: var(--gn-shadow), inset 0 1px 0 var(--gn-rim);
}
.gn__sub-panel ul { display: grid; gap: 2px; }

.gn__sublink {
  display: block;
  padding: 11px 14px;
  border-radius: 14px;
  color: var(--gn-sub-fg);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  text-decoration: none;
  transition: background .25s ease, color .25s ease, transform .4s var(--gn-spring);
}
.gn__sublink:hover,
.gn__sublink:focus-visible,
.gn__sublink.is-active { background: var(--gn-lens-bg); color: var(--gn-sub-fg-on); }
.gn__sublink:hover { transform: translateX(3px); }

.gn.is-compact .gn__sub { display: none; }

/* Sous-menu dans le menu mobile */
.gn__drawer-sub { display: grid; gap: 0; }
.gn__drawer .gn__drawer-sub a { min-height: 44px; padding-left: 49px; font-size: 15px; font-weight: 500; opacity: .85; }

/* ---------- Bouton d'action ---------- */

.gn__cta {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  height: var(--gn-h);
  padding: 0 20px;
  border-radius: 100px;
  background: var(--gn-grad);
  background-size: 170% 100%;
  color: var(--gn-cta-fg);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -2px 6px rgba(0,0,0,.08), 0 8px 20px -10px var(--gn-accent-3);
  transform: translate(var(--gn-px, 0px), var(--gn-py, 0px));
  transition: background-position .6s var(--gn-ease), transform .5s var(--gn-spring);
}

.gn__cta svg { width: 16px; height: 16px; transition: transform .45s var(--gn-ease); }

/* ---------- Mode compact (« île ») : en descendant, la barre se resserre ---------- */

.gn.is-compact .gn__links-wrap { max-width: 0; opacity: 0; margin: 0 -3px; pointer-events: none; }
.gn.is-compact .gn__bar { width: auto; }
.gn.is-compact .gn__links.has-lens .gn__lens { opacity: 0; }

/* ---------- Mobile : la barre elle-même devient le menu ---------- */

.gn__burger {
  display: none;
  position: relative;
  z-index: 2;
  flex: none;
  width: var(--gn-h);
  height: var(--gn-h);
  margin: 0;
  padding: 0;
  border: 1px solid var(--gn-lens-rim);
  border-radius: 50%;
  background: var(--gn-lens-bg);
  cursor: pointer;
}

.gn__burger i {
  position: absolute;
  left: 30%;
  right: 30%;
  height: 1.8px;
  border-radius: 2px;
  background: var(--gn-burger, #fff);
  transition: transform .5s var(--gn-spring), top .5s var(--gn-spring), opacity .3s ease;
}
.gn[data-tone="light"] .gn__burger { --gn-burger: #141414; }
.gn__burger i:nth-child(1) { top: 36%; }
.gn__burger i:nth-child(2) { top: 49%; }
.gn__burger i:nth-child(3) { top: 62%; }
.gn.is-open .gn__burger i:nth-child(1) { top: 49%; transform: rotate(45deg); }
.gn.is-open .gn__burger i:nth-child(2) { opacity: 0; }
.gn.is-open .gn__burger i:nth-child(3) { top: 49%; transform: rotate(-45deg); }

.gn__drawer {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 0fr;
  flex-basis: 100%;
  min-width: 0;
  transition: grid-template-rows .6s var(--gn-ease);
}

.gn__drawer > div { min-height: 0; overflow: hidden; }
.gn.is-open .gn__drawer > div { max-height: calc(100svh - 110px); overflow-y: auto; overscroll-behavior: contain; }

.gn__drawer ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 8px 0 4px;
  list-style: none;
}

.gn__drawer a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 20px;
  color: var(--gn-drawer-fg, #fff);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .35s ease, transform .5s var(--gn-spring), background .3s ease;
}
.gn[data-tone="light"] .gn__drawer a { --gn-drawer-fg: #141414; }
.gn__drawer a svg { width: 19px; height: 19px; color: var(--gn-accent-3); }
.gn__drawer a.is-active { background: var(--gn-lens-bg); box-shadow: inset 0 1px 0 var(--gn-lens-rim); }

.gn.is-open .gn__drawer { grid-template-rows: 1fr; }
.gn.is-open .gn__drawer a { opacity: 1; transform: none; }
.gn.is-open .gn__drawer li:nth-child(2) a { transition-delay: .04s; }
.gn.is-open .gn__drawer li:nth-child(3) a { transition-delay: .08s; }
.gn.is-open .gn__drawer li:nth-child(4) a { transition-delay: .12s; }
.gn.is-open .gn__drawer li:nth-child(5) a { transition-delay: .16s; }
.gn.is-open .gn__drawer li:nth-child(6) a { transition-delay: .2s; }
.gn.is-open .gn__bar { border-radius: 30px; }
.gn.is-open .gn__glass { background: var(--gn-drawer-bg); }

@media (min-width: 821px) {
  .gn__drawer { display: none; }
}

@media (max-width: 820px) {
  .gn { width: calc(100% - 20px); }
  .gn__links-wrap { display: none; }
  .gn__cta { margin-left: auto; padding: 0 16px; font-size: 13.5px; }
  .gn__burger { display: block; }
}

@media (max-width: 380px) {
  .gn__cta span { display: none; }
  .gn__cta { width: var(--gn-h); padding: 0; justify-content: center; }
  .gn__logo--wide { padding: 0 14px; }
}

/* ---------- Survols ---------- */

@media (hover: hover) and (pointer: fine) {
  .gn__logo:hover { transform: rotate(-10deg) scale(1.06); }
  .gn__logo--wide:hover { transform: scale(1.04); }
  .gn__cta:hover { background-position: 100% 0; }
  .gn__cta:hover svg { transform: translateX(3px); }
}

.gn a:focus-visible,
.gn button:focus-visible { outline: 2px solid var(--gn-accent-2); outline-offset: 3px; }

/* ---------- Préférences d'accessibilité ---------- */

/* « Réduire la transparence » (macOS / iOS) et « contraste élevé » : verre opaque */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .gn .gn__glass,
  .gn.has-refraction .gn__glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(28,28,28,.97); }
  .gn[data-tone="light"] .gn__glass { background: rgba(255,255,255,.98); }
  .gn .gn__lens::before { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .gn__shine { display: none; }
}

/* Navigateurs sans flou d'arrière-plan */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .gn .gn__glass { background: rgba(28,28,28,.95); }
  .gn[data-tone="light"] .gn__glass { background: rgba(255,255,255,.97); }
}

@media (prefers-reduced-motion: reduce) {
  .gn *, .gn *::before, .gn *::after, .gn { transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* =========================================================
   PROTECTION CONTRE LES STYLES DU THÈME / ELEMENTOR
========================================================= */

.gn ul, .gn li { margin: 0 !important; padding: 0 !important; list-style: none !important; background: none !important; border: 0 !important; }
.gn .gn__drawer ul { padding: 8px 0 4px !important; }
.gn li::marker { content: none !important; }
.gn li::before, .gn li::after { content: none !important; }
.gn .gn__lens::before, .gn .gn__lens::after { content: "" !important; display: block !important; }

.gn a.gn__link, .gn a.gn__link:hover, .gn a.gn__link:focus, .gn a.gn__link:visited {
  color: var(--gn-fg, rgba(255,255,255,.76)) !important; font-family: var(--gn-font) !important; font-size: 14px !important;
  font-weight: 500 !important; letter-spacing: 0 !important; text-transform: none !important;
  text-decoration: none !important; background: none !important; box-shadow: none !important; border: 0 !important;
}
.gn a.gn__link.is-hover, .gn a.gn__link.is-active { color: var(--gn-fg-on, #fff) !important; }

.gn a.gn__cta, .gn a.gn__cta:hover, .gn a.gn__cta:focus, .gn a.gn__cta:visited {
  color: var(--gn-cta-fg) !important; font-family: var(--gn-font) !important; font-weight: 700 !important;
  letter-spacing: 0 !important; text-transform: none !important; text-decoration: none !important;
  background-image: var(--gn-grad) !important; background-size: 170% 100% !important; border: 0 !important;
}

.gn .gn__drawer a, .gn .gn__drawer a:hover, .gn .gn__drawer a:focus, .gn .gn__drawer a:visited {
  color: var(--gn-drawer-fg, #fff) !important; font-family: var(--gn-font) !important; font-size: 17px !important;
  font-weight: 600 !important; text-transform: none !important; text-decoration: none !important; border: 0 !important;
}

.gn .gn__drawer .gn__drawer-sub { padding: 0 0 6px !important; }
.gn .gn__drawer .gn__drawer-sub a, .gn .gn__drawer .gn__drawer-sub a:hover, .gn .gn__drawer .gn__drawer-sub a:focus, .gn .gn__drawer .gn__drawer-sub a:visited {
  font-size: 15px !important; font-weight: 500 !important;
}

.gn a.gn__sublink, .gn a.gn__sublink:hover, .gn a.gn__sublink:focus, .gn a.gn__sublink:visited {
  color: var(--gn-sub-fg) !important; font-family: var(--gn-font) !important; font-size: 14px !important;
  font-weight: 500 !important; letter-spacing: 0 !important; text-transform: none !important;
  text-decoration: none !important; border: 0 !important; box-shadow: none !important;
}
.gn a.gn__sublink:hover, .gn a.gn__sublink:focus-visible, .gn a.gn__sublink.is-active { color: var(--gn-sub-fg-on) !important; background: var(--gn-lens-bg) !important; }
.gn a.gn__sublink:not(:hover):not(:focus-visible):not(.is-active) { background: none !important; }

.gn a.gn__skip { line-height: 1.2 !important; text-decoration: none !important; }
.gn a.gn__logo { text-decoration: none !important; border: 0 !important; }
.gn .gn__logo img { max-width: none !important; height: 60% !important; margin: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.gn .gn__logo--wide img { width: auto !important; height: var(--gn-logo-h) !important; max-width: var(--gn-logo-max) !important; }

.gn button.gn__burger, .gn button.gn__burger:hover, .gn button.gn__burger:focus {
  -webkit-appearance: none; appearance: none;
  width: var(--gn-h) !important; height: var(--gn-h) !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important;
  border: 1px solid var(--gn-lens-rim) !important; border-radius: 50% !important; background: var(--gn-lens-bg) !important; box-shadow: none !important;
}
@media (min-width: 821px) { .gn button.gn__burger { display: none !important; } }

.gn svg { max-width: none !important; }
