function toggleCard(element) { // Check if clicked card is already expanded const isExpanded = element.classList.contains('expanded'); // Close all other cards first (Accordion behavior) document.querySelectorAll('.era-card').forEach(card => { card.classList.remove('expanded'); }); // If it wasn't expanded, expand it now if (!isExpanded) { element.classList.add('expanded'); // Smooth scroll to the expanded card setTimeout(() => { element.scrollIntoView({ behavior: 'smooth', block: 'center' }); }, 300); } }