I know how it works, but I didn't know what it was called until I did an internet search. 'it being dark in the room' is apparently a non-restrictive clause.
In my opinion: Whenever you see 'it being SOMETHING' you can think of it as 'since it was SOMETHING.'
In the example above, you could understand it as:
Since it was dark in the room, I couldn't find my book.