/* =========================================================
   MENU - version finale
   Basé sur le HTML avec :
   .topnav
   .topnav-inner
   .menu-toggle
   .nav-panel
   .menu
   .menu-item
   .menu-link-row
   .menu-link
   .submenu-toggle
   .dropdown
   .agenda-link
   ========================================================= */

.topnav {
  border-bottom: 1px solid #e5e5e5;
  width: 100%;
  position: relative;
  z-index: 1000;
}

.topnav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
}

/* -------------------------
   Bouton hamburger
   ------------------------- */
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
}

.menu-toggle:hover {
  background: #f3f3f3;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 4px auto;
  background: #111;
  border-radius: 2px;
}

/* -------------------------
   Bloc principal menu
   ------------------------- */
.nav-panel {
  display: flex;
  align-items: center;
  gap: 18px;
}

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 14px;
  align-items: center;
}

.menu-item {
  position: relative;
}

.menu-link-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.menu-link {
  text-decoration: none;
  color: #111;
  padding: 8px 10px;
  border-radius: 8px;
  display: inline-block;
  font-weight: 500;
}

.menu-link:hover {
  background: #f3f3f3;
}

/* -------------------------
   Lien agenda
   ------------------------- */
.agenda-link {
  font-weight: 700;
  text-decoration: none;
  color: #111;
  padding: 8px 10px;
  border-radius: 8px;
  display: inline-block;
}

.agenda-link:hover {
  background: #f3f3f3;
}

/* -------------------------
   Bouton sous-menu
   caché sur desktop
   ------------------------- */
.submenu-toggle {
  display: none;
  border: 0;
  background: transparent;
  color: #111;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 1.2rem;
  line-height: 1;
}

.submenu-toggle:hover {
  background: #f3f3f3;
}

/* -------------------------
   Dropdown desktop
   ------------------------- */
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,.08);
  z-index: 1000;
  max-height: 60vh;
  overflow: auto;
}

.dropdown li {
  list-style: none;
}

.dropdown a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: #111;
}

.dropdown a:hover {
  background: #f6f6f6;
}

/* hover bridge pour éviter la coupure */
.menu-item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 10px;
}

/* ouverture desktop */
.menu-item:hover .dropdown,
.menu-item:focus-within .dropdown {
  display: block;
}

/* -------------------------
   Logo si tu veux le sortir du inline style
   ------------------------- */
.site-logo {
  height: 110px;
  display: block;
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 860px) {
  .site-header {
    display: block;
    margin: 12px;
  }

  .site-header > div:first-child {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
  }

  .site-logo {
    height: 72px;
  }

  .topnav-inner {
    padding: 0;
    justify-content: flex-end;
  }

  .menu-toggle {
    display: block;
  }

  .nav-panel {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0,0,0,.10);
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    z-index: 2000;
  }

  .nav-panel.is-open {
    display: flex;
  }

  .menu {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .menu-item {
    width: 100%;
  }

  .menu-item::after {
    display: none;
  }

  .menu-link-row {
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }

  .menu-link {
    flex: 1;
    padding: 10px 12px;
  }

  .submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .dropdown {
    position: static;
    min-width: auto;
    margin-top: 2px;
    border: 0;
    border-radius: 0;
    padding: 4px 0 8px 14px;
    box-shadow: none;
    background: transparent;
    max-height: none;
  }

  .dropdown a {
    padding: 8px 10px;
  }

  /* en mobile, on annule le hover desktop */
  .menu-item:hover .dropdown,
  .menu-item:focus-within .dropdown {
    display: none;
  }

  /* ouverture via JS */
  .menu-item.open > .dropdown {
    display: block;
  }

  .agenda-link {
    display: block;
    margin-top: 4px;
    padding: 10px 12px;
  }
}