Minecraft update, enchanting levels?

So I’ve been looking at tutorials and stuff but I can’t find anything that definitively says one way or the other since they all seem to focus on the mechanics of level BEFORE enchanting.

Does enchanting something take away full levels of XP or some set number? Like, if I’m at level 35 and my bar is halfway full, will I be taken down to 32 and a half full bar, 32 and an empty bar, or will I lose the amount of XP that would bring a level 30 down to level 27?

Should I maximize the value of my XP or should I be immediately enchanting things as soon as I hit level 30?

The enchantment cost is equal number of levels and lapis, i.e. 1, 2 or 3. The level requirement is just a threshold to unlock a certain enchantment option. If you don’t have access to easily obtainable XP in larger quantities, make your enchantings as soon as you hit level 30.