/* Scoped to: real-estate-template-Faq */
(function() {
  'use strict';
  var componentRoots = document.querySelectorAll('[data-component-slug="real-estate-template-Faq"]');
  componentRoots.forEach(function(componentRoot) {
    // Helper to query within component, with fallback to document for sibling elements
    var $ = function(sel) { 
      return componentRoot.querySelector(sel) || document.querySelector('[data-component-slug="real-estate-template-Faq"] ~ ' + sel) || document.querySelector(sel);
    };
    var $$ = function(sel) { 
      var results = componentRoot.querySelectorAll(sel);
      return results.length ? results : document.querySelectorAll(sel);
    };
    // Original component JS runs in this scope
    const accordions = document.querySelectorAll(".accordion"); accordions.forEach((item) => { const btn = item.querySelector(".accordion-toggle"); const content = item.querySelector(".accordion-content"); const arrow = item.querySelector(".accordion-arrow"); btn.addEventListener("click", () => { const isOpen = item.classList.contains("open"); accordions.forEach((acc) => { acc.classList.remove("open", "bg-[#F8FAFB]"); acc.querySelector(".accordion-content").style.maxHeight = "0px"; acc.querySelector(".accordion-arrow").classList.remove("rotate-180"); }); if (!isOpen) { item.classList.add("open", "bg-[#F8FAFB]"); content.style.maxHeight = content.scrollHeight + "px"; arrow.classList.add("rotate-180"); } }); }); if (accordions.length > 0) { const firstAccordion = accordions[0]; const firstContent = firstAccordion.querySelector(".accordion-content"); const firstArrow = firstAccordion.querySelector(".accordion-arrow"); firstAccordion.classList.add("open", "bg-[#F8FAFB]"); firstContent.style.maxHeight = firstContent.scrollHeight + "px"; firstArrow.classList.add("rotate-180"); }
  });
})();