/* Sélecteur de langue statique — Terre Marrakech (UX mobile + bureau)
   Remplace le menu « Langues » qui pointait vers #pll_switcher (rempli par le JS de
   Polylang, donc mort en statique sur 981 pages).
   Palette du site : vert #0F5B4F / #062823, crème #F6F1EB, sable #D9CEC2, encre #211C18. */

.tm-lang-panel {
  position: absolute; z-index: 9999; width: max-content; min-width: 208px; max-width: 272px;
  max-height: min(80vh, 560px); overflow-y: auto; overscroll-behavior: contain;
  background: #F6F1EB; border: 1px solid #D9CEC2; border-radius: 12px;
  box-shadow: 0 12px 30px rgba(6, 40, 35, .18);
  padding: 8px; margin: 0; list-style: none;
  font-family: inherit; font-size: 15px; color: #211C18;
}
.tm-lang-panel[hidden] { display: none; }
.tm-lang-panel__title {
  padding: 6px 10px 8px; margin: 0 0 4px; font-size: 12px; letter-spacing: .04em;
  text-transform: uppercase; color: #4B413A; border-bottom: 1px solid #D9CEC2;
}
.tm-lang-panel a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 44px; padding: 11px 12px;              /* cible tactile recommandée */
  border-radius: 8px; color: #211C18 !important;
  text-decoration: none; line-height: 1.3;
}
.tm-lang-panel a:hover, .tm-lang-panel a:focus-visible { background: #E6F1EE; color: #062823 !important; }
.tm-lang-panel a:focus-visible { outline: 3px solid rgba(15, 91, 79, .35); outline-offset: 1px; }
.tm-lang-panel a[aria-current="true"] { background: #0F5B4F; color: #fff !important; font-weight: 600; }
.tm-lang-panel a[aria-current="true"]:hover { background: #062823; color: #fff !important; }
.tm-lang-panel__code { font-size: 12px; text-transform: uppercase; opacity: .7; letter-spacing: .04em; }
.tm-lang-panel__drapeau { font-size: 17px; line-height: 1; margin-right: 2px; }

/* le code de la langue courante, ajouté sur le déclencheur du menu */
.tm-lang-courant { font-size: .78em; letter-spacing: .06em; opacity: .75; white-space: nowrap; }

/* Mobile : panneau en feuille en bas, pleine largeur — pas de panneau qui sort de l'écran */
@media (max-width: 640px) {
  .tm-lang-panel--feuille {
    position: fixed !important; top: auto !important; bottom: 0 !important;
    left: 0 !important; right: 0 !important;
    width: 100% !important; max-width: 100% !important;
    max-height: 72vh;
    border-radius: 16px 16px 0 0; border-bottom: 0;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -10px 34px rgba(6, 40, 35, .22);
    animation: tm-lang-monte .18s ease-out;
  }
  .tm-lang-panel--feuille a { min-height: 48px; }
}
@keyframes tm-lang-monte { from { transform: translateY(14px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tm-lang-panel--feuille { animation: none; } }

/* Suggestion de langue à la première visite — non bloquante, refusable, sans redirection */
.tm-lang-suggestion {
  position: fixed; z-index: 9998; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: min(680px, calc(100vw - 24px));
  padding: 12px 14px; border-radius: 12px;
  background: #062823; color: #F6F1EB; font-size: 15px;
  box-shadow: 0 14px 34px rgba(6, 40, 35, .3);
}
.tm-lang-suggestion p { margin: 0; flex: 1 1 auto; min-width: 200px; }
.tm-lang-suggestion a {
  flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 44px; padding: 9px 16px;
  background: #0F5B4F; color: #fff !important; border-radius: 999px; text-decoration: none; font-weight: 600;
}
.tm-lang-suggestion a:hover, .tm-lang-suggestion a:focus-visible { background: #14705f; color: #fff !important; }
.tm-lang-suggestion button {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 9px 14px; cursor: pointer;
  background: transparent; color: #F6F1EB; border: 1px solid rgba(246, 241, 235, .45);
  border-radius: 999px; font: inherit;
}
.tm-lang-suggestion button:hover, .tm-lang-suggestion button:focus-visible { background: rgba(246, 241, 235, .14); }
.tm-lang-suggestion__fermer { padding: 9px 12px !important; font-size: 20px; line-height: 1; }
@media (max-width: 640px) {
  .tm-lang-suggestion { flex-direction: column; align-items: stretch; text-align: center; left: 12px; right: 12px; transform: none; max-width: none; }
  .tm-lang-suggestion p { min-width: 0; }
  .tm-lang-suggestion a, .tm-lang-suggestion button { justify-content: center; }
  .tm-lang-suggestion__fermer { position: absolute; top: 6px; right: 6px; }
}
