Self-assembly of liquid crystals in nanoporous solids for adaptive photonic metamaterials.