/* NAVBAR
   Barre blanche pleine largeur, collée en haut, avec ombre en dessous.
   Le contenu reste aligné sur la largeur du site (1160px). */

#app-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  margin: 0;
  padding-inline: max(24px, calc((100% - 1160px) / 2));
  background: #fff;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, .04),
    0 6px 18px rgba(0, 0, 0, .07);
}

.app-navbar {
  width: 100%;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* BRAND (logo + titre) */

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.navbar-logo {
  display: block;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 11px;
}

.navbar-title {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ACTIONS (langue + explore) */

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* EXPLORE LINK : simple texte, style titre */

.navbar-explore {
  flex-shrink: 0;
  margin-right: 20px;
  padding: 4px 2px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s;
}

.navbar-explore:hover {
  color: var(--green);
}

.navbar-explore:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}


/* LANGUAGE MENU */

.lang-menu {
  position: relative;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .2s;
}

.lang-toggle:hover,
.lang-toggle[aria-expanded="true"] {
  background: var(--bg);
}

/* Cadre commun à tous les drapeaux.
   Le contour est posé PAR-DESSUS le drapeau (::after) : il reste visible
   même sur une bande blanche comme celle du drapeau français. */
.lang-flag {
  position: relative;
  display: block;
  flex-shrink: 0;
  width: 22px;
  height: 16px;
  overflow: hidden;
  border-radius: 4px;
  background: #e9ebe6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

.lang-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.lang-flag::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
  background: linear-gradient(180deg, rgba(255, 255, 255, .18) 0%, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, .06) 100%);
  pointer-events: none;
}

.lang-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  min-width: 180px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .14), 0 2px 6px rgba(0, 0, 0, .06);
  animation: lang-pop .14s ease-out;
}

.lang-list[hidden] {
  display: none;
}

@keyframes lang-pop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.lang-option:hover,
.lang-option:focus-visible {
  background: var(--bg);
  outline: none;
}

.lang-option.is-active {
  font-weight: 600;
  color: var(--green);
}

.lang-name {
  flex: 1;
}

.lang-check {
  visibility: hidden;
  font-size: 16px;
}

.lang-option.is-active .lang-check {
  visibility: visible;
}

.lang-toggle:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* MOBILE */

@media (max-width: 480px) {
  .navbar-explore {
    margin-right: 6px;
    font-size: 14px;
  }

  .navbar-actions {
    gap: 8px;
  }

  .navbar-title {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .navbar-explore,
  .lang-toggle {
    transition: none;
  }

  .lang-list {
    animation: none;
  }
}
