# ===== .htaccess — Security & Config =====

Options -Indexes

# Protect sensitive directories
<FilesMatch "\.(json|php)$">
  Order Allow,Deny
  Allow from all
</FilesMatch>

# Protect data folder from direct access
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule ^data/ - [F,L]
</IfModule>

# PHP settings
<IfModule mod_php.c>
  php_value upload_max_filesize 10M
  php_value post_max_size 12M
  php_value max_execution_time 60
</IfModule>

# Cache static assets
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/css         "access plus 1 week"
  ExpiresByType application/javascript "access plus 1 week"
  ExpiresByType image/png        "access plus 1 month"
  ExpiresByType application/pdf  "access plus 1 day"
</IfModule>

# Gzip compression
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/css application/javascript
</IfModule>
