/* Structural glossary-hint chrome. Articles override CSS variables for signature. */
:root {
  --glossary-underline: currentColor;
  --glossary-tip-bg: #1a1814;
  --glossary-tip-fg: #f4efe6;
  --glossary-tip-border: rgba(244, 239, 230, 0.22);
  --glossary-tip-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  --glossary-tip-radius: 4px;
  --glossary-tip-font: system-ui, sans-serif;
  --glossary-tip-size: 0.78rem;
  --glossary-toggle-fg: inherit;
  --glossary-toggle-size: 1.15em;
}

.glossary-hints-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  box-sizing: border-box;
  width: var(--glossary-toggle-size);
  height: var(--glossary-toggle-size);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--glossary-toggle-fg);
  font-size: 1em;
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  flex: 0 0 auto;
}

.glossary-hints-toggle input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.glossary-hints-toggle-icon {
  display: block;
  width: 0.92em;
  height: 0.92em;
  margin: 0;
  pointer-events: none;
  opacity: 0.92;
  line-height: 0;
}

.glossary-hints-toggle.is-off .glossary-hints-toggle-icon {
  opacity: 0.45;
}

.glossary-hints-toggle:hover .glossary-hints-toggle-icon,
.glossary-hints-toggle:focus-within .glossary-hints-toggle-icon {
  opacity: 1;
}

.glossary-hints-toggle-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.glossary-term {
  position: relative;
  display: inline;
  cursor: help;
  text-decoration: none;
  border-bottom: 1px dotted var(--glossary-underline);
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: from-font;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--glossary-underline);
}

.glossary-term .glossary-tip {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.45rem);
  transform: translateX(-50%);
  z-index: 40;
  box-sizing: border-box;
  min-width: 7.5rem;
  max-width: min(18rem, calc(100vw - 2rem));
  padding: 0.4rem 0.55rem;
  border-radius: var(--glossary-tip-radius);
  border: 1px solid var(--glossary-tip-border);
  background: var(--glossary-tip-bg);
  color: var(--glossary-tip-fg);
  font-family: var(--glossary-tip-font);
  font-size: var(--glossary-tip-size);
  font-style: normal;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: break-word;
  box-shadow: var(--glossary-tip-shadow);
  pointer-events: none;
  user-select: none;
}

.glossary-term .glossary-tip.has-links {
  pointer-events: auto;
  user-select: text;
}

.glossary-term .glossary-tip-links {
  display: block;
  margin-top: 0.35em;
  font-size: 0.92em;
  font-weight: 600;
  line-height: 1.3;
}

.glossary-term .glossary-tip-links a {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.12em;
}

.glossary-term .glossary-tip-links a:hover,
.glossary-term .glossary-tip-links a:focus-visible {
  text-decoration-style: solid;
}

.glossary-term .glossary-tip.is-placed {
  position: fixed;
  right: auto;
  bottom: auto;
  transform: none;
  z-index: 80;
}

.glossary-term .glossary-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: var(--tip-arrow-left, 50%);
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: var(--glossary-tip-bg);
}

.glossary-term .glossary-tip.tip-below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--glossary-tip-bg);
}

.glossary-term:hover .glossary-tip,
.glossary-term:focus-visible .glossary-tip,
.glossary-term.is-hovering .glossary-tip,
.glossary-term.is-tip-open .glossary-tip {
  display: block;
}

@media (hover: none) {
  .glossary-term {
    -webkit-tap-highlight-color: transparent;
  }
}

html.glossary-hints-off .glossary-term {
  cursor: inherit;
  border-bottom: none;
  text-decoration: none;
}

html.glossary-hints-off .glossary-term .glossary-tip,
html.glossary-hints-off .glossary-term:hover .glossary-tip,
html.glossary-hints-off .glossary-term:focus-visible .glossary-tip,
html.glossary-hints-off .glossary-term.is-hovering .glossary-tip,
html.glossary-hints-off .glossary-term.is-tip-open .glossary-tip {
  display: none !important;
}
