/**
 * FAQ Wizard — Accordion and search-box styles.
 *
 * Supplements Joomla-bundled Bootstrap 5 accordion classes with package-
 * specific refinements and the JS-toggled hidden-entry helper class.
 *
 * No @import — all Bootstrap base styles arrive via the WebAssetManager
 * bootstrap.css asset registered by the consuming surface adapter
 * Markup is owned by the shared JLayout; this file only styles it.
 *
 * @package  Faqwizard
 * @since    1.1.0
 */

/* -------------------------------------------------------------------------
 * Helper class toggled by accordion-search.js to hide non-matching entries.
 * Using a CSS class (not inline style.display) means:
 *  - The "no display= before first addEventListener" pin in AssetRegistryTest
 *    holds cleanly.
 *  - Overrides are possible without JS changes.
 *  - The !important guard ensures Bootstrap utility classes cannot accidentally
 *    override the hidden state.
 * ------------------------------------------------------------------------ */
.faqwizard-entry-hidden {
    display: none !important;
}

/* -------------------------------------------------------------------------
 * Search input wrapper — consistent bottom spacing before the accordion.
 * The .mb-3 class in the JLayout already provides this; this rule acts as
 * a fallback when Bootstrap utilities are not available (progressive).
 * ------------------------------------------------------------------------ */
.faqwizard-search-wrapper {
    margin-bottom: 1rem;
}

/* -------------------------------------------------------------------------
 * Accordion item — smooth show/hide for the filtered state transition.
 * Browsers that support prefers-reduced-motion will honour the media query
 * below, consistent with Bootstrap's own reduced-motion handling.
 * ------------------------------------------------------------------------ */
.accordion-item.faqwizard-entry-hidden {
    display: none !important;
}

/* -------------------------------------------------------------------------
 * Result-count live region under the search input (since 1.10.0).
 * min-height reserves the line so the accordion does not jump down by one
 * line the instant the first character is typed — the region renders empty
 * and only gains text once a query runs.
 * font-size/opacity duplicate what Bootstrap's .form-text gives it, as a
 * fallback for templates that do not load Bootstrap's full CSS. opacity
 * rather than a literal colour so the line stays legible in a dark theme.
 * ------------------------------------------------------------------------ */
.faqwizard-search-status {
    min-height: 1.5em;
    font-size: 0.875em;
    opacity: 0.75;
}

/* -------------------------------------------------------------------------
 * No-results message (since 1.10.0), toggled through the `hidden` attribute
 * by accordion-search.js. The !important guard is here for the same reason
 * .faqwizard-entry-hidden carries one: `hidden` is only a UA-stylesheet
 * `display: none`, so any Bootstrap display utility on the same element
 * outranks it and would pin the message permanently visible.
 * ------------------------------------------------------------------------ */
.faqwizard-no-results[hidden] {
    display: none !important;
}

/* -------------------------------------------------------------------------
 * Empty-state alert — ensure the Bootstrap .alert.alert-info block used by
 * the JLayout when items is empty sits flush with surrounding content.
 * ------------------------------------------------------------------------ */
.faqwizard-empty-state {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* -------------------------------------------------------------------------
 * Reduced-motion: disable collapse animation inside the accordion for users
 * who prefer reduced motion (augments Bootstrap's own handling in case the
 * site template does not load Bootstrap's full CSS).
 * ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .accordion-collapse {
        transition: none;
    }
}
