Magic configurations in moiré superlattice of bilayer photonic crystals: Almost-perfect flatbands and unconventional localization