Deeply rooted in pagan customs handed down from generation to generation , the " Jani " festival is held on June 23 as the summer solstice marks northern Europe 's longest day of the year -- when Latvia enjoys almost 18 hours of daylight .