What does my textbook mean by saying this about petroleum? It reads:


  Petroleum consists of crude oil and natural gas and contains a mixture of up to 300 hydrocarbons, including sulfur and nitrogen compounds. It is formed over thousands of years from the remains of fossilised marine organisms.


Is petroleum a single entity that is simultaneously a gas and a liquid oil compounds? How does that work? It is also a mixture of up to 300 hydrocarbons, so it is a liquid and gas in one? I don't understand? Do they mean that petroleum can be either gas OR it can be either liquid? What about the 'mixture of 300 hydrocarbons bit'. Does that mean you will never extract petroleum of a single hydrocarbon eg pure $\ce{C6H14}$ etc? I haven't revised this in a long time so I forgot..
Petroleum is a mixture of many different compounds.
Some of those compounds are gas.  Some are liquid.  Some are solid.
Many of them are hydrocarbons, and there are many different hydrocarbons included in the mix (e.g. different numbers on the C and H).
Petroleum is generally refined into more specific products before use, at a refinery.
Another example to consider might be "mud" - that's a mixture of some liquids, maybe some dissolved gases, and a bunch of different solids, usually including clay, maybe a bit of gravel, and some organic materials formed from decaying plants and animals.
If you take mud and compress it underground for thousands of years, then you'll have petroleum. 

The second sentence seems clear enough.