/*
 * Zammad host-layout contract for markdown-rendered articles.
 *
 * Zammad measures an article BEFORE this plugin renders it, so it sizes the
 * raw markdown — including the whole fenced ```form block that we turn into a
 * compact widget. It then collapses by writing an inline pixel `height` onto
 * .textBubble-content and revealing .textBubble-overflowContainer, stashing
 * the expanded/folded measurements in data-height and data-height-origin for
 * its .js-toggleFold handler.
 * Both reported symptoms come from that one stale measurement: AI articles
 * arrive collapsed when the rendered result never needed collapsing, and
 * unfolding one leaves a large empty gap because the restored height belongs
 * to content that no longer exists.
 *
 * The renderer-owned data attribute is stable across Zammad's deferred passes,
 * and author !important rules beat the non-important inline styles Zammad
 * writes — so this holds without an observer fighting the host application on
 * every mutation.
 *
 * Class names verified against Zammad 7.1's compiled application.js. Earlier
 * versions of this file targeted .js-toggleSeeMore / .see-more /
 * .article-see-more, none of which exist in this Zammad; they were inert.
 */
.ticket-article-item[data-nmd-rendering="true"] .textBubble-content,
.ticket-article-item[data-md-rendered="true"] .textBubble-content {
  height: auto !important;
}

/* Zammad owns creation of the control. Once the article is renderer-owned it
 * has no valid collapsed state to reveal, so the control must stay hidden even
 * if a later pass removes Zammad's own `hide` class. Hiding the container also
 * removes its ::before gradient, which would otherwise fade out the last lines
 * of an article that is no longer clipped. */
.ticket-article-item[data-nmd-rendering="true"] .textBubble-overflowContainer,
.ticket-article-item[data-md-rendered="true"] .textBubble-overflowContainer {
  display: none !important;
}
