/* Glossary tooltip theme for sphinx-tippy (``conf.py`` selects it
   with ``tippy_props['theme'] = 'edf-glossary'``). The extension's
   default ``light`` theme paints a flat near-white pill that
   disappears against ``sphinx_rtd_theme``'s body background; this
   stylesheet replaces that with a card that visually echoes the
   theme's table headers - white body, soft shadow, plus an orange
   header bar carrying the term name. The orange matches the
   dotted underline drawn on every ``:term:`` reference in
   ``custom.css`` (#ff6a13) so the hover surface reads as an
   expanded version of the cue the reader was already chasing.

   The selectors below follow the tippy.js theming convention:
   the popup root has class ``tippy-box`` and a per-theme
   ``data-theme`` attribute, and the call-out arrow lives inside
   ``.tippy-arrow``. The inner glossary entry rendered by Sphinx
   is a ``<dt>`` / ``<dd>`` pair; the ``<dt>`` becomes the header
   bar and the ``<dd>`` (and its child paragraphs) become the
   body. */

/* Card chrome: white body, deep enough shadow to lift the
   tooltip off the page on both light and dark images. */
.tippy-box[data-theme~="edf-glossary"] {
    background-color: #ffffff;
    color: #404040;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18),
                0 2px 6px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    font-size: 0.85rem;
    line-height: 1.45;
}

/* Arrow colour matches the body so the call-out blends into
   the card edge on every placement (top/bottom/left/right). */
.tippy-box[data-theme~="edf-glossary"] > .tippy-arrow {
    color: #ffffff;
}

/* The tooltip body itself; reset tippy.js's default padding so
   the header bar can paint flush with the card edge, then
   restore padding on the inner content surfaces. */
.tippy-box[data-theme~="edf-glossary"] > .tippy-content {
    padding: 0;
}

/* Header bar: orange slab carrying the glossary term name.
   ``<dt>`` is what sphinx-tippy copies in for a glossary
   definition, so style that directly. Multiple ``<dt>``
   siblings (the glossary's ``ADBUS`` / ``BDBUS`` / ``CDBUS`` /
   ``DDBUS`` cluster is the canonical example) share one
   ``<dd>`` body, so paint them as a single header band: the
   first ``<dt>`` carries the full vertical padding, and each
   subsequent ``<dt>`` collapses its top padding and gains a
   thin translucent rule so the aliases read as sub-rows of a
   single header instead of as four full-height stacked
   slabs. */
.tippy-box[data-theme~="edf-glossary"] dt {
    background-color: #ff6a13;
    color: #ffffff;
    font-weight: 600;
    padding: 6px 12px;
    margin: 0;
    border: none;
}
.tippy-box[data-theme~="edf-glossary"] dt + dt {
    padding-top: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.35);
}

/* Strip the theme's anchor styling from a permalink that
   sphinx-tippy did not manage to scrub (``strip_classes`` only
   removes ``.headerlink``; any other inline icon stays put). */
.tippy-box[data-theme~="edf-glossary"] dt a {
    color: inherit;
    text-decoration: none;
}

/* Body: definition text on white with comfortable padding.
   Glossary cross-references inside a definition keep their
   orange dotted underline from ``custom.css`` - no override
   needed here. */
.tippy-box[data-theme~="edf-glossary"] dd {
    padding: 8px 12px 10px;
    margin: 0;
    background-color: #ffffff;
    color: #404040;
}

.tippy-box[data-theme~="edf-glossary"] dd p {
    margin: 0;
}

.tippy-box[data-theme~="edf-glossary"] dd p + p {
    margin-top: 0.5em;
}
