/*
 * zm-unanswered-sort (ZCS-17257): category pages only, loads in <head> before the page draws.
 * Registered in extensions_registry.src.json "stylesheets" (rule: pageType eq category).
 * Docs: https://developer-portal.gainsight.com/docs/custom-widgets/v2/stylesheets.html
 *
 * On a category page opened with ?sort=unanswered (a link, refresh or bookmark), Gainsight's
 * server draws its Recently active list (it ignores sorts it doesn't know), then the page
 * script scripts/zm-unanswered-sort/script.js swaps in the Unanswered list. Without this file
 * visitors would see Recently active first, then the swap.
 *
 * - Holds the topic list (its header and cards) until the page script marks the page done
 *   (html.zm-uns-done: our list is in, or the script decided not to act).
 * - Only on ?sort=unanswered: Gainsight's own <head> carries the full address in
 *   <meta property="og:url">, which CSS can read before the page draws.
 * - Safety: if the script never finishes, the list shows after 3 seconds, as Gainsight drew it.
 * - Gainsight's layout editor (body.is-customizing) is never held.
 */
html:has(meta[property="og:url"][content*="sort=unanswered"]):not(.zm-uns-done) body:not(.is-customizing) [data-preact="destination/modules/Content/TopicList/CategoryTopicList"] {
  animation: zm-uns-hold 3s step-end both;
}

@keyframes zm-uns-hold {
  from { visibility: hidden; }
  to { visibility: visible; }
}
