‘You who enter my door, may your highest hopes be exceeded’ reads the inscription over the entryway to the Ali Ben Youssef Medersa, and after almost six centuries, the blessing still works its charms on visitors. Sight lines are lifted in the entry with carved Atlas cedar cupolas and mashrabiyya (wooden-lattice screen) balconies, while the courtyard is a mind-boggling profusion of Hispano-Moresque ornament: five-colour zellij walls, stucco archways, cedar windows, and a marble mihrab (niche in a mosque indicating the direction of Mecca).

Founded in the 14th century under the Merenids, but fully kitted-out with its exuberantly ornate decoration in 1565 in the Saadian era, this Quranic learning centre was once the largest in North Africa, and remains among the most splendid.

The medersa (theological college) is affiliated with nearby Ali ben Youssef Mosque, and once 900 students in the 132 dorms arranged around the courtyard studied religious and legal texts here. Despite upgrades with its 19th-century renovation, the Ali ben Youssef Medersa gradually lost students to its collegiate rival, the Medersa Bou Inania in Fez, but even today – long after the students finally left – this old seminary still exudes magnificent, studious calm.