/* ---------------------------------------------------------------------------
   In-product explainers — the <info-tip> disclosure and the glossary page.

   Accessibility notes that are load-bearing, not decoration:
   · the panel is NEVER revealed on hover — it opens on click/Enter/Space only,
     which sidesteps WCAG 1.4.13 (content on hover) entirely; once open it is
     hoverable, persistent and ESC-dismissible (see js/infotip.js);
   · the trigger keeps a visible :focus-visible ring at 3:1 against its
     surroundings, and its hit area is 24×24 CSS px (WCAG 2.2 target size);
   · every colour pair below is ink-on-paper from the brand palette and clears
     4.5:1 for body text / 3:1 for the trigger border;
   · the open transition is dropped entirely under prefers-reduced-motion.
   ------------------------------------------------------------------------- */

.vp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.vp-infotip {
  position: relative;
  display: inline-flex;
  vertical-align: baseline;
  margin-inline-start: 0.25rem;
}

.vp-infotip__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem; /* 24px — WCAG 2.2 (2.5.8) minimum target */
  height: 1.5rem;
  padding: 0;
  font: 600 0.75rem/1 inherit;
  color: #4c3a72; /* deep purple on white ≈ 8.4:1 */
  cursor: pointer;
  background: #f3f0fa;
  border: 1px solid #7454b3;
  border-radius: 50%;
}

.vp-infotip__trigger:hover {
  background: #e6e0f5;
}

.vp-infotip__trigger:focus-visible {
  outline: 3px solid #271d3b;
  outline-offset: 2px;
}

.vp-infotip__trigger[aria-expanded="true"] {
  color: #fff;
  background: #7454b3;
  border-color: #271d3b;
}

.vp-infotip__glyph {
  transform: translateY(-0.5px);
}

.vp-infotip__panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(24rem, calc(100vw - 2rem));
  max-height: 22rem;
  padding: 0.875rem 1rem;
  overflow-y: auto;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: #271d3b;
  text-align: left;
  white-space: normal;
  background: #fff;
  border: 1px solid #cfc6e6;
  border-radius: 10px;
  box-shadow: 0 12px 32px -12px rgb(39 29 59 / 45%);
  transform: translateX(-50%);
  animation: vp-infotip-in 120ms ease-out;
}

/* Right-hand tips would otherwise overflow the viewport. */
.vp-infotip--end .vp-infotip__panel {
  left: auto;
  right: 0;
  transform: none;
}

.vp-infotip__panel[hidden] {
  display: none;
}

.vp-infotip__term {
  font-weight: 700;
}

.vp-infotip__caveat {
  padding-top: 0.5rem;
  color: #4a4459;
  border-top: 1px solid #eae5f4;
}

.vp-infotip__caveat strong {
  color: #271d3b;
}

.vp-infotip__more {
  align-self: flex-start;
  font-weight: 600;
  color: #5b3fa0; /* ≥ 4.5:1 on white */
}

@keyframes vp-infotip-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vp-infotip__panel {
    animation: none;
  }
}

@media (prefers-contrast: more) {
  .vp-infotip__panel {
    border-color: #271d3b;
  }
}

/* --- the glossary page --------------------------------------------------- */

.vp-glossary__toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 1rem 0 2rem;
  list-style: none;
}

.vp-glossary__toc a {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  font-size: 0.8125rem;
  color: #4c3a72;
  background: #f3f0fa;
  border: 1px solid #d9d0ee;
  border-radius: 999px;
}

.vp-glossary__toc a:focus-visible {
  outline: 3px solid #271d3b;
  outline-offset: 2px;
}

.vp-glossary__entry {
  padding: 1.25rem 0;
  scroll-margin-top: 6rem;
  border-top: 1px solid #eae5f4;
}

.vp-glossary__entry h2 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}

.vp-glossary__badge {
  padding: 0.1rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #3d2f5c;
  background: #ede8f8;
  border-radius: 999px;
}

.vp-glossary__lead {
  font-weight: 600;
}

.vp-glossary__meta {
  padding: 0.75rem 0.9rem;
  margin-top: 0.75rem;
  background: #faf9fd;
  border-left: 3px solid #7454b3;
  border-radius: 0 6px 6px 0;
}

.vp-glossary__meta + .vp-glossary__meta {
  margin-top: 0.5rem;
}

.vp-glossary__meta--caveat {
  background: #fdf7f2;
  border-left-color: #b4722a;
}

.vp-glossary__meta dt {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5a5468;
}

.vp-glossary__meta dd {
  margin: 0.25rem 0 0;
}

.vp-glossary__doc {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: #5a5468;
}
