Spain declares emergency as wildfires force thousands to evacuate amid extreme heat.