/* ==========================================================================
   Navbar EPSN (maquette 1c) — partial templates/partials/navbar.php
   Feuille autonome scopee sous .nv, chargee par toutes les pages.
   style.css est compile depuis scss/ : ne rien y fusionner sans repasser
   par les sources.
   ========================================================================== */

.nv {
  --nv-ink: #4A4A4A;
  --nv-ink-2: #666666;
  --nv-green: #43AA8B;
  --nv-green-dark: #216051;
  --nv-brown: #A97E45;
  --nv-beige: #F9F5EF;
  --nv-rule: #EAD8C2;
  --nv-blue: #2F83D9;
  --nv-blue-bg: #EAF3FB;
  --nv-display: "Euclid Flex Medium", "Euclid Flex", sans-serif;
  --nv-text: "Suisse intl", Arial, sans-serif;
  --nv-medium: "Suisse intl Medium", "Suisse intl", Arial, sans-serif;

  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  font-family: var(--nv-text); font-size: 16px; line-height: 24px; color: var(--nv-ink);
  transition: transform .3s ease-in-out;
}
.nv *, .nv *::before, .nv *::after { box-sizing: border-box; }
.nv.is-hidden { transform: translateY(-100%); }

/* reserve la hauteur de la barre fixe dans le flux */
.nv__spacer { height: 120px; }

/* --- Bandeau utilitaire -------------------------------------------------- */
.nv__utility { background: var(--nv-beige); height: 36px; font-size: 13px; }
.nv__utility-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 40px; height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.nv__utility-right { display: flex; gap: 22px; align-items: center; }
.nv .nv__util-link {
  display: flex; gap: 7px; align-items: center; color: var(--nv-ink);
  text-decoration: none; font-family: var(--nv-medium); font-weight: 500;
  transition: color .3s ease-in-out;
}
.nv .nv__util-link:hover { color: var(--nv-green); text-decoration: none; }

/* --- Barre principale ---------------------------------------------------- */
.nv__bar { background: #fff; border-bottom: 1px solid var(--nv-rule); position: relative; }
.nv__bar-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 40px; height: 84px;
  display: flex; align-items: center; gap: 20px;
}
.nv__logo { flex: none; display: flex; }
.nv__logo img { height: 40px; width: auto; }
.nv__nav {
  display: flex; gap: 18px; align-items: center; height: 100%;
  font-family: var(--nv-medium); font-weight: 500; font-size: 15px; white-space: nowrap;
}
.nv .nv__link,
.nv .nv__formations {
  display: flex; align-items: center; gap: 6px; height: 100%;
  color: var(--nv-brown); text-decoration: none;
  font-family: var(--nv-medium); font-weight: 500; font-size: 15px;
  transition: color .3s ease-in-out;
}
.nv .nv__link:hover,
.nv .nv__formations:hover { color: var(--nv-green); text-decoration: none; }
.nv .nv__link.is-active,
.nv .nv__formations.is-active,
.nv .nv__formations[aria-expanded="true"] {
  color: var(--nv-green); box-shadow: inset 0 -3px 0 var(--nv-green);
}
/* neutralise le button:hover global de style.css */
.nv .nv__formations { border: none; background: none; padding: 0; cursor: pointer; font: inherit; }
.nv .nv__formations:hover,
.nv .nv__formations:focus { background: none; }
.nv .nv__formations svg { transition: transform .3s ease-in-out; }
.nv .nv__formations[aria-expanded="true"] svg { transform: rotate(180deg); }

.nv__actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.nv .nv__btn-info {
  white-space: nowrap; font-family: var(--nv-medium); font-weight: 500; font-size: 15px;
  color: var(--nv-blue); border: 2px solid var(--nv-blue); padding: 8px 16px;
  border-radius: 50px; text-decoration: none; transition: all .3s ease-in-out;
}
.nv .nv__btn-info:hover { background: var(--nv-blue); color: #fff; text-decoration: none; }
.nv .nv__btn-cta {
  white-space: nowrap; font-family: var(--nv-medium); font-weight: 500; font-size: 15px;
  background: var(--nv-green); color: #fff; padding: 10px 18px; border-radius: 50px;
  text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,.2); transition: all .3s ease-in-out;
}
.nv .nv__btn-cta:hover { background: var(--nv-green-dark); color: #fff; box-shadow: none; text-decoration: none; }

/* --- Méga-menu ----------------------------------------------------------- */
.nv__mega {
  position: absolute; left: 0; right: 0; top: 100%; background: #fff;
  box-shadow: 0 12px 20px rgba(0,0,0,.12); border-bottom: 1px solid var(--nv-rule);
}
.nv__mega[hidden] { display: none; }
.nv__mega-inner {
  max-width: 1280px; margin: 0 auto; padding: 32px 40px 28px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 36px;
}
/* Le mega-menu ne s'affiche qu'au-dessus de 1200 px : on y repartit les
   colonnes plutot que de les egaliser, pour que « Médecine traditionnelle
   européenne » tienne sur une seule ligne. */
@media (min-width: 1200px) {
  /* entre 1200 et 1360 px la place manque : gouttiere resserree et premiere
     colonne plus large, pour que le libelle le plus long tienne quand meme */
  .nv__mega-inner { grid-template-columns: 1.6fr 1fr 1.05fr 0.95fr; gap: 28px; }
}
@media (min-width: 1360px) {
  .nv__mega-inner { grid-template-columns: 1.4fr 1fr 1.15fr 1.05fr; gap: 36px; }
}
.nv__group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* Les titres de colonne n'ont pas la meme longueur : on reserve deux lignes
   au titre et deux au surtitre pour que les trois listes demarrent a la
   meme hauteur, quelle que soit la largeur disponible. */
.nv__group-title {
  font-family: var(--nv-display); font-weight: 500; font-size: 21px; line-height: 26px;
  color: var(--nv-ink); min-height: 52px; display: flex; align-items: flex-start;
}
.nv__group-sur {
  font-family: var(--nv-medium); font-weight: 500; font-size: 13px; line-height: 17px;
  letter-spacing: .04em; text-transform: uppercase; color: var(--nv-brown);
  min-height: 34px; display: flex; align-items: flex-start;
}
.nv__group-items { display: flex; flex-direction: column; margin-top: 8px; }
.nv .nv__group-items a {
  display: flex; gap: 10px; align-items: center; padding: 9px 0;
  border-top: 1px solid var(--nv-rule);
  font-family: var(--nv-medium); font-weight: 500; font-size: 15px; line-height: 20px;
  color: var(--nv-ink); text-decoration: none; transition: color .3s ease-in-out;
}
.nv .nv__group-items a:hover { color: var(--nv-green); text-decoration: none; }
.nv__dot { width: 8px; height: 8px; border-radius: 8px; flex: none; background: var(--nv-rule); }
/* le libelle occupe la place disponible, la duree se cale a droite :
   chaque entree tient sur une ligne et les durees s'alignent en colonne */
.nv__item-label { flex: 1 1 auto; min-width: 0; }
.nv__item-duree {
  flex: none; font-family: var(--nv-text); font-weight: 400; font-size: 13px;
  color: var(--nv-ink-2); white-space: nowrap;
}
.nv .nv__group-items a:hover .nv__item-duree { color: var(--nv-green); }
.nv__badge {
  font-family: var(--nv-medium); font-weight: 500; font-size: 11px; letter-spacing: .04em;
  text-transform: uppercase; padding: 2px 7px; background: var(--nv-beige);
  color: var(--nv-brown); white-space: nowrap;
}

.nv__card { background: var(--nv-beige); display: flex; flex-direction: column; align-self: start; }
.nv__card img { width: 100%; height: 140px; object-fit: cover; display: block; }
.nv__card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.nv__card-title { font-family: var(--nv-display); font-weight: 500; font-size: 19px; line-height: 25px; }
.nv__card-text { font-size: 14px; line-height: 21px; color: var(--nv-ink-2); }
.nv .nv__card-cta {
  align-self: flex-start; margin-top: 6px; font-family: var(--nv-medium); font-weight: 500;
  font-size: 15px; background: var(--nv-green); color: #fff; padding: 10px 20px;
  border-radius: 50px; text-decoration: none; transition: all .3s ease-in-out;
}
.nv .nv__card-cta:hover { background: var(--nv-green-dark); color: #fff; text-decoration: none; }

.nv__mega-foot { border-top: 1px solid var(--nv-rule); background: var(--nv-blue-bg); }
.nv__mega-foot-inner {
  max-width: 1280px; margin: 0 auto; padding: 14px 40px;
  display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; font-size: 15px;
}
.nv .nv__mega-foot-inner a {
  font-family: var(--nv-medium); font-weight: 500; color: var(--nv-blue); text-decoration: none;
}
.nv .nv__mega-foot-inner a:hover { text-decoration: underline; }

/* --- Barre compacte et menu plein écran ---------------------------------- */
.nv__compact { display: none; }
.nv__mobile { display: none; }

.nv .nv__icon {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer; padding: 0;
}
.nv .nv__icon:hover, .nv .nv__icon:focus { background: none; }

@media (max-width: 1199.98px) {
  .nv__spacer { height: 64px; }
  .nv__utility, .nv__bar { display: none; }

  .nv__compact {
    height: 64px; background: #fff; border-bottom: 1px solid var(--nv-rule);
    display: flex; align-items: center; gap: 8px; padding: 0 8px 0 20px;
  }
  .nv__compact .nv__logo img { height: 32px; }
  .nv .nv__btn-cta--sm { margin-left: auto; font-size: 14px; padding: 9px 16px; box-shadow: none; }

  .nv__mobile {
    position: fixed; top: 64px; left: 0; right: 0; bottom: 0; background: #fff;
    overflow-y: auto; padding: 12px 20px 28px; display: flex; flex-direction: column;
  }
  .nv__mobile[hidden] { display: none; }
  .nv .nv__mobile-row {
    display: flex; align-items: center; justify-content: space-between; min-height: 52px;
    border-bottom: 1px solid var(--nv-rule); font-family: var(--nv-medium); font-weight: 500;
    font-size: 17px; color: var(--nv-ink); text-decoration: none;
  }
  .nv .nv__mobile-row:hover { color: var(--nv-green); text-decoration: none; }
  .nv__mobile-group { border-bottom: 1px solid var(--nv-rule); }
  .nv__mobile-group .nv__mobile-row { border-bottom: none; }
  .nv .nv__mobile-toggle {
    width: 100%; border: none; background: none; padding: 0; cursor: pointer; font: inherit;
    font-family: var(--nv-medium); font-weight: 500; font-size: 17px; color: var(--nv-ink);
  }
  .nv .nv__mobile-toggle:hover, .nv .nv__mobile-toggle:focus { background: none; }
  .nv .nv__mobile-toggle svg { transition: transform .3s ease-in-out; }
  .nv .nv__mobile-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .nv__mobile-mega { display: flex; flex-direction: column; padding: 0 0 12px; }
  .nv__mobile-mega[hidden] { display: none; }
  .nv__mobile-sur {
    margin-top: 10px; min-height: 32px; display: flex; align-items: center;
    font-family: var(--nv-medium); font-weight: 500; font-size: 12px; letter-spacing: .06em;
    text-transform: uppercase; color: var(--nv-brown);
  }
  .nv .nv__mobile-mega a {
    display: flex; gap: 10px; align-items: center; min-height: 44px;
    font-size: 15px; color: var(--nv-ink); text-decoration: none; padding-left: 4px;
  }
  .nv__group-title, .nv__group-sur { min-height: 0; }
  .nv .nv__mobile-mega a:hover { color: var(--nv-green); text-decoration: none; }

  .nv__mobile-tiles {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px;
    font-family: var(--nv-medium); font-weight: 500; font-size: 14px;
  }
  .nv .nv__mobile-tiles a {
    display: flex; align-items: center; justify-content: center; min-height: 44px;
    background: var(--nv-beige); color: var(--nv-ink); text-decoration: none; text-align: center;
  }
  .nv .nv__mobile-info {
    margin-top: 12px; text-align: center; font-family: var(--nv-medium); font-weight: 500;
    background: var(--nv-blue); color: #fff; padding: 14px; border-radius: 50px; text-decoration: none;
  }
  .nv .nv__mobile-info:hover { background: #1f6cb8; color: #fff; text-decoration: none; }
  .nv .nv__mobile-tel {
    margin-top: 12px; text-align: center; font-family: var(--nv-medium); font-weight: 500;
    color: var(--nv-ink); text-decoration: none;
  }
}
