/* Glossary hover tooltips (book-installer feature 13).
   <abbr> elements come from the auto-appended includes/glossary-abbr.md
   (generated by scripts/build-glossary-tooltips.py); Material's
   `content.tooltips` turns their title into a .md-tooltip2 popover. */

.md-typeset abbr[title] {
  border-bottom: none;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
  /* book indigo, softened so a paragraph with several terms stays calm */
  text-decoration-color: color-mix(in srgb, var(--md-primary-fg-color) 55%, transparent);
  cursor: help;
}

.md-typeset abbr[title]:hover,
.md-typeset abbr[title]:focus-visible {
  text-decoration-color: var(--md-accent-fg-color);
  text-decoration-style: solid;
  outline: none;
}

/* Never decorate a term that sits in a heading, link or code (the
   plugins/abbr_scope.py hook already removes those; this is the CSS backstop). */
.md-typeset :is(h1, h2, h3, h4, h5, h6, a, code) abbr {
  text-decoration: none;
  cursor: inherit;
}

/* Readable tooltip. Material styles title tooltips ([role=tooltip]) as
   small bold labels (0.5rem, 700, max 400px); a definition is a sentence,
   so use body weight, a legible size and a wider box, with an indigo top
   rule to tie it to the book palette. */
.md-tooltip2[role="tooltip"] > .md-tooltip2__inner {
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.45;
  padding: 0.4rem 0.6rem;
  max-width: min(100vw - 1.6rem, 24rem);
  border-top: 0.15rem solid var(--md-primary-fg-color);
}
