/* ============================================================
   Glossary term + popover
   Palette locked to Cosmic Shoreline.
   ============================================================ */

.term {
  color: inherit;
  cursor: help;
  border-bottom: 1px dotted #72A0C1;
  padding-bottom: 1px;
  transition: color 150ms ease, border-color 150ms ease;
  white-space: nowrap;
}
.term::after {
  content: "?";
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 0.62em;
  vertical-align: super;
  line-height: 1;
  color: #72A0C1;
  margin-left: 2px;
  border: 1px solid #72A0C1;
  border-radius: 9999px;
  width: 1.15em;
  height: 1.15em;
  text-align: center;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}
.term:hover,
.term:focus-visible,
.term[aria-expanded="true"] {
  color: #008080;
  border-bottom-color: #008080;
  outline: none;
}
.term:hover::after,
.term:focus-visible::after,
.term[aria-expanded="true"]::after {
  color: #ffffff;
  background-color: #008080;
  border-color: #008080;
}

/* Popover */
.glossary-pop {
  position: absolute;
  z-index: 60;
  max-width: 320px;
  animation: glossFadeIn 150ms ease-out;
}
@keyframes glossFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.glossary-pop-inner {
  background: #FFFFFF;
  border: 1px solid #E8DFC8;
  border-radius: 14px;
  padding: 14px 16px 16px;
  box-shadow:
    0 12px 30px -8px rgba(30, 58, 95, 0.18),
    0 6px 14px -4px rgba(0, 128, 128, 0.08);
  color: #0F1F35;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
.glossary-pop-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.glossary-pop-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #1E3A5F;
  flex: 1;
  font-weight: 600;
}
.glossary-pop-close {
  background: transparent;
  border: 0;
  color: #5C6B73;
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
  line-height: 1;
  border-radius: 9999px;
}
.glossary-pop-close:hover { color: #008080; }
.glossary-pop-text { color: #0F1F35; }

/* When the term appears on a dark background (like the nav CTA card), invert. */
.on-dark .term { color: #ffffff; border-bottom-color: rgba(255,255,255,0.5); }
.on-dark .term::after { color: rgba(255,255,255,0.7); border-color: rgba(255,255,255,0.5); }
.on-dark .term:hover,
.on-dark .term:focus-visible,
.on-dark .term[aria-expanded="true"] { color: #E6F2F2; border-bottom-color: #E6F2F2; }
.on-dark .term:hover::after,
.on-dark .term:focus-visible::after,
.on-dark .term[aria-expanded="true"]::after { background:#E6F2F2; color:#1E3A5F; border-color:#E6F2F2; }
