/* ============================================================
   Commutalisme — Glossaire interactif
   Termes soulignés + modale de définition
   ============================================================ */

/* ── Terme cliquable ─────────────────────────────────────────── */
.glossary-term {
  border-bottom: 1.5px dotted currentColor;
  cursor: help;
  opacity: 0.92;
  transition: opacity 0.15s ease, border-color 0.15s ease;
  display: inline;
}

.glossary-term:hover,
.glossary-term:focus {
  opacity: 1;
  border-bottom-color: #7C3AED;
  outline: none;
}

.glossary-term:focus-visible {
  outline: 2px solid #7C3AED;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Sur fond sombre, utiliser le violet clair */
.section-dark .glossary-term:hover,
.section-dark .glossary-term:focus,
.section-cta .glossary-term:hover,
.section-cta .glossary-term:focus {
  border-bottom-color: #A78BFA;
}

/* ── Verrou de scroll ────────────────────────────────────────── */
body.glossary-lock {
  overflow: hidden;
}

/* ── Overlay ─────────────────────────────────────────────────── */
.glossary-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(10, 22, 40, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.glossary-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ── Boîte modale ────────────────────────────────────────────── */
.glossary-modal {
  position: relative;
  width: 100%;
  max-width: 540px;
  background: linear-gradient(145deg, #131f38 0%, #0f1c35 100%);
  border: 1px solid rgba(124, 58, 237, 0.28);
  border-radius: 18px;
  padding: 2rem 2.25rem 2.25rem;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 24px 60px rgba(0,0,0,0.6),
    0 0 40px rgba(124,58,237,0.12);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), opacity 0.22s ease;
  opacity: 0;
}

.glossary-overlay.is-open .glossary-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ── Bouton fermer ───────────────────────────────────────────── */
.glossary-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.glossary-close:hover {
  background: rgba(124,58,237,0.25);
  color: #fff;
}

.glossary-close:focus-visible {
  outline: 2px solid #7C3AED;
  outline-offset: 2px;
}

/* ── Sigle (badge violet) ────────────────────────────────────── */
.glossary-abbr {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #A78BFA;
  background: rgba(124,58,237,0.18);
  border: 1px solid rgba(124,58,237,0.35);
  border-radius: 6px;
  padding: 0.2em 0.65em;
  margin-bottom: 0.85rem;
}

/* ── Nom complet ─────────────────────────────────────────────── */
.glossary-full {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 1rem;
  padding-right: 2rem; /* espace pour le bouton ✕ */
}

/* ── Description ─────────────────────────────────────────────── */
.glossary-desc {
  font-size: 0.875rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.78);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .glossary-modal {
    padding: 1.5rem 1.25rem 1.75rem;
    border-radius: 14px;
  }

  .glossary-full {
    font-size: 1rem;
  }
}
