/* Scoped to: sports-template-gallery */
(function() {
  'use strict';
  var componentRoots = document.querySelectorAll('[data-component-slug="sports-template-gallery"]');
  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="sports-template-gallery"] ~ ' + 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 buttons = document.querySelectorAll(".tab-btn"); const galleryItems = document.querySelectorAll("#gallery > div"); buttons.forEach(button => { button.addEventListener("click", () => { const category = button.dataset.category; galleryItems.forEach(item => { if (category === "all" || item.dataset.category === category) { item.classList.remove("hidden"); } else { item.classList.add("hidden"); } }); buttons.forEach(btn => { btn.classList.remove("text-red-600", "font-bold"); btn.classList.add("text-black", "font-semibold"); }); button.classList.add("text-red-600", "font-bold"); button.classList.remove("text-black", "font-semibold"); }); });
  });
})();