/* Scoped to: portfolio-template-home-faq */
(function() {
  'use strict';
  var componentRoots = document.querySelectorAll('[data-component-slug="portfolio-template-home-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="portfolio-template-home-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
    document.querySelectorAll(".faq-item").forEach((item) => { item.addEventListener("click", () => { if (!item.classList.contains("open")) { document.querySelectorAll(".faq-item.open").forEach((openItem) => { openItem.classList.remove("open"); openItem.querySelector(".faq-arrow").classList.remove("rotate-180"); openItem.querySelector(".faq-answer").classList.add("hidden"); }); } item.classList.toggle("open"); const arrow = item.querySelector(".faq-arrow"); const answer = item.querySelector(".faq-answer"); if (item.classList.contains("open")) { arrow.classList.add("rotate-180"); answer.classList.remove("hidden"); } else { arrow.classList.remove("rotate-180"); answer.classList.add("hidden"); } }); });
  });
})();