/* glossary.css - the `?` info chip + the shared definition popover.
 * Paired with render/glossary.js. Palette/tokens from orgforge.css. */

/* ── The inline `?` affordance ──────────────────────────────────────────── */
.gl-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  padding: 0;
  vertical-align: middle;
  border: 1px solid var(--mist);
  border-radius: 50%;
  background: var(--white);
  color: var(--muted-text);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  /* The chip frequently sits inside clickable tiles/cards - keep it from
     inheriting their pointer semantics or text styling. */
  -webkit-user-select: none;
  user-select: none;
  flex: 0 0 auto;
}
.gl-chip:hover,
.gl-chip:focus-visible {
  background: var(--orange-text);
  border-color: var(--orange-text);
  color: var(--white);
  outline: none;
}
.gl-chip:focus-visible {
  box-shadow: 0 0 0 2px var(--yellow-bg);
}
.gl-chip > span { pointer-events: none; }

/* ── The floating popover card ──────────────────────────────────────────── */
.gl-popover {
  position: absolute;
  z-index: 4000;            /* above detail panels (1200) + drawers */
  max-width: 280px;
  padding: 11px 13px;
  border: 1px solid var(--smoke);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-lg);
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.45;
  /* Hidden until .gl-open; opacity transition for a soft entrance. */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-2px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  pointer-events: none;
}
.gl-popover.gl-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.gl-pop-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 4px;
}
.gl-pop-def {
  color: var(--steel);
  margin-bottom: 7px;
}
.gl-pop-why {
  color: var(--muted-text);
  font-size: 11.5px;
  padding-top: 7px;
  border-top: 1px solid var(--smoke);
}
.gl-pop-why-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--orange-text);
  margin-bottom: 2px;
}
.gl-pop-bench {
  margin-top: 7px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--paper);
  color: var(--steel);
  font-size: 11px;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .gl-popover { transition: none; }
}
