/**
 * cbdm-glossary.css
 * Styles for the glossary tooltip system.
 * Add to your child theme's bundle or enqueue separately.
 */

/* ── Term trigger ──────────────────────────────────────────────────────────── */

.cbdm-gloss-term {
  cursor: help;
  text-decoration: underline;
  text-decoration-color: #8BBF5A;
  text-decoration-style: dotted;
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
  color: inherit; /* never change the text color */
  border-bottom: none;
}

.cbdm-gloss-term:hover,
.cbdm-gloss-term:focus {
  text-decoration-style: solid;
  outline: none;
}


/* ── Tooltip container ─────────────────────────────────────────────────────── */

#cbdm-tooltip {
  position: absolute;
  z-index: 9999;
  width: 280px;
  padding: 12px 14px;
  background: #2b2b2b;
  color: #f2f0eb;
  font-family: 'Poppins', sans-serif;
  font-size: 0.925rem;
  font-weight: 300;
  line-height: 1.5;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  pointer-events: auto;
}

/* Arrow — direction set by JS via data-placement attribute */
#cbdm-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-style: solid;
}

/* Default: tooltip above term, arrow points down */
#cbdm-tooltip[data-placement="above"]::after {
  bottom: -10px;
  border-width: 10px 10px 0;
  border-color: #2b2b2b transparent transparent;
}

/* Flipped: tooltip below term, arrow points up */
#cbdm-tooltip[data-placement="below"]::after {
  top: -10px;
  border-width: 0 10px 10px;
  border-color: transparent transparent #2b2b2b;
}

#cbdm-tooltip[hidden] {
  display: none;
}


/* ── "Read more" link inside tooltip ───────────────────────────────────────── */

.cbdm-gloss-more {
  display: inline-block;
  margin-top: 6px;
  color: #B5D97A;
  font-size: 0.85rem;
  text-decoration: none;
}

.cbdm-gloss-more:hover {
  color: #8BBF5A;
  text-decoration: underline;
}
