# Contributing to Commerce Learning Hub

Thank you for your interest in contributing! This document provides guidelines and workflows.

## Code of Conduct

Be respectful, inclusive, and constructive. We follow the Contributor Covenant.

## How to Contribute

### Reporting Bugs
1. Check existing issues first
2. Open a new issue with:
   - Clear title
   - Steps to reproduce
   - Expected vs actual behavior
   - Browser and OS
   - Screenshots if applicable

### Suggesting Features
1. Open an issue labeled `enhancement`
2. Describe the use case and value
3. Suggest implementation approach if possible

### Submitting Code
1. Fork the repository
2. Create a feature branch: `git checkout -b feature/your-feature`
3. Follow coding standards (see below)
4. Test locally in multiple browsers
5. Commit with clear messages
6. Push and open a Pull Request

## Coding Standards

### HTML
- Semantic elements (`<header>`, `<main>`, `<section>`, `<article>`)
- Valid HTML5
- Descriptive `alt` attributes
- ARIA labels where needed

### CSS
- Use CSS variables from `base.css`
- BEM-like naming: `.block__element--modifier`
- Mobile-first responsive design
- No `!important` unless absolutely necessary
- Comment complex selectors

### JavaScript
- ES6+ syntax
- Modular functions (single responsibility)
- Clear variable names
- Comments for complex logic
- No global pollution (use IIFE or modules)
- Error handling for all async operations

### Documentation
- Update README if adding features
- Add JSDoc comments to functions
- Keep docs in sync with code

## Development Workflow

1. All changes happen via Pull Requests
2. One module per phase — don't mix modules
3. Test checklist must pass before merge
4. Documentation must be updated

## Testing Checklist

Before submitting:
- [ ] Works in Chrome, Firefox, Safari
- [ ] Mobile responsive
- [ ] Keyboard navigable
- [ ] Screen reader friendly
- [ ] No console errors
- [ ] Lighthouse score ≥ 90
- [ ] Documentation updated

## Questions?

Open a discussion or issue. We're happy to help!

---

Thank you for helping make Commerce Learning Hub better!