/* Scoped to: marathon-faq */
(function() {
  'use strict';
  var componentRoots = document.querySelectorAll('[data-component-slug="marathon-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="marathon-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
    (function () { setTimeout(function () { var accordion = document.querySelector("[data-accordion]"); if (!accordion) return; var items = accordion.querySelectorAll("[data-accordion-item]"); items.forEach(function (item) { var trigger = item.querySelector("[data-accordion-trigger]"); var content = item.querySelector("[data-accordion-content]"); var icon = trigger.querySelector(".accordion-icon"); if (!trigger || !content) return; trigger.addEventListener("click", function () { var isOpen = trigger.getAttribute("aria-expanded") === "true"; items.forEach(function (otherItem) { var otherTrigger = otherItem.querySelector( "[data-accordion-trigger]" ); var otherContent = otherItem.querySelector( "[data-accordion-content]" ); var otherIcon = otherTrigger.querySelector(".accordion-icon"); var otherBorder = otherItem; otherTrigger.setAttribute("aria-expanded", "false"); otherContent.classList.add("hidden"); otherIcon.classList.remove("rotate-180"); otherTrigger.classList.remove("bg-[#CBEB4F]"); otherTrigger.classList.add("bg-white"); otherBorder.classList.remove("border-[#DCFC62]"); otherBorder.classList.add("border-gray-200"); otherIcon.innerHTML = '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/>'; }); if (!isOpen) { trigger.setAttribute("aria-expanded", "true"); content.classList.remove("hidden"); icon.classList.add("rotate-180"); trigger.classList.remove("bg-white"); trigger.classList.remove("hover:bg-gray-50"); trigger.classList.add("bg-[#CBEB4F]"); item.classList.remove("border-gray-200"); item.classList.add("border-[#DCFC62]"); icon.innerHTML = '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>'; } }); }); }, 0); })();
  });
})();