export class AccessibilityToggleController {
    constructor({
        triggerSelector = '[data-accessibility-toggle]',
        panelId = 'access-panel',
    } = {}) {
        this.triggers = Array.from(document.querySelectorAll(triggerSelector));
        this.panel = document.getElementById(panelId);
    }

    init() {
        if (this.triggers.length === 0) return;
        this.triggers.forEach(trigger => {
            trigger.addEventListener('click', () => this.toggle());
        });
    }

    toggle() {
        if (!this.panel) return;
        this.panel.classList.toggle('hidden');
        this.panel.classList.toggle('flex');
    }
}
