Grade: A-

Even those of us who believed that Pedro Almodovar’s early films were wildly overpraised should find his newest a revelation, combining the colorful flash of the writer-director’s previous work with a richer, deeper emotional vein than ever before. The growth that was palpable in “Talk to Her” is fully realized in “Bad Medicine.” It’s both hugely entertaining and very moving.

Typically for the movie-obsessed Almodovar, the picture hearkens back to a beloved genre–in this case the film noir, as some of the characters themselves observe toward the close. But also characteristically, it does so through the prism of his own experience and sensibility; thus the titular education points to the filmmaker’s early years in a Catholic school, and the script is suffused with elements related to both gay culture and the difficulties of artistic creativity. It’s also constructed like a funhouse mirror, with episodes reflecting on other episodes as “fiction” mixes with “fact,” truth with falsehood, memory with reality. That gives the film a maze-like quality that surprises and delights even as the narrative undercurrents add melancholy counterpoint to the extravagant surface.

Following a dazzling title sequence reminiscent of Saul Bass’ classic creations for Hitchcock (in its color and richness it most resembles “Vertigo,” and is accompanied by an appropriately Herrmannesque score by Alberto Iglesias–though the style recalls the master’s late music for “Obsession,” “Sisters” and “It’s Alive!” more than his 1950s work), the picture opens in 1980. Movie auteur Enrique Goded (Fele Martinez) is scanning newspapers for ideas for a new script. A young man (Gael Garcia Bernal) shows up claiming to be his old classmate Ignacio Rodriguez; he’s now a struggling actor looking for work, and bearing a story he’s written, called “The Visit,” which is partially about their school days but with an imaginary continuation. As Enrique reads the typescript, the film suddenly moves into Ignacio’s story as seen through the director’s eyes–indicated in cinematic shorthand by a slight trimming of the widescreen size. We see Ignacio, now a transvestite singer called Zahara (also Bernal), having a one-night stand with an inebriated customer named Enrique (Alberto Ferreiro), whom he learns is his old classmate. The encounter encourages Ignacio/Zahara to return to their school, where he and his bosom friend Paquito (Javier Camara) steal the chapel vessels before Zahara accosts the principal Fr. Manolo (Daniel Gimenez Cacho), whom he blackmails with “The Visit,” which he claims was written by “her” dead brother Ignacio. The narrative then shifts into the “earlier” part of the typescript, ca. 1965, in which Ignacio, now an angelic-faced boy (Nacho Perez) with a beautiful treble voice, is molested by Manolo, who expels Ignacio’s fellow student Enrique (Raul Garcia Forneiro) when he discovers the two boys have been engaging in sexual experimentation. “Education” then comes back into the present, with Goded deciding to use “The Visit” as the basis for his next film; the excited Rodriguez wants to play Zahara in it, but Enrique thinks he’s all wrong for the part, and wants him to play the drunken one-night stand instead. He’s even suspicious that Ignacio might not be who he claims to be. It would be unfair to go further into the labyrinthine convolutions that follow; suffice it to say that Goded goes to Galicia to ask Ignacio’s kindly mother (Petra Martinez) for information; that a publishing executive named Berenguer (Lluis Homar), who read “The Visit” some time before, comes on the scene as the film is being made, bringing revelations about himself and the story; and that yet another Ignacio (Francisco Boira) is an important part of the tale Berenguer tells, as also is this Ignacio’s brother Juan.

“Bad Education” is like a Chinese box with chambers within chambers–a story with layer upon layer of competing narrative, duplicate characters and altered identities. Yet Almodovar’s writing and construction have such clarity, and his quicksilver direction and editing (assisted in the latter capacity by Jose Salcedo) are so assured, that the attentive viewer is unlikely to become confused despite all the swerves. (“Bad Education” is like vintage Hitchcock in that respect.) And the acting is extraordinary. Martinez anchors the film with a quietly simmering turn as the director who’s, after a fashion, Almodovar’s surrogate, but it’s Bernal, in a part that demands a range that can only be suggested in a review like this one, who will be most remembered. (He makes, for example, a very sultry femme fatale in “The Visit” sequences, but becomes even more dangerous sans wig in the later reels.) Gimenez Cacho is both horrifying and pitiful as the obsessive Father Manolo–his is no simplistic portrait of a tormented man (nor is the picture a simplistic assault on clerical corruption, certainly not in the way Goded’s seems to be); and Homar gives Berenguer similar complexity. Boira pulls out all the stops in a role that’s quintessentially Almodovarian, while Petra Martinez earns immediate sympathy with a touchingly understated turn. One shouldn’t overlook Francisco Maestre, who makes Manolo’s assistant Father Jose a nastily competent presence, or Perez and Forneiro, who strike the right chords of innocence and camaraderie as the young Ignacio and Enrique.

Like all of Almodovar’s films, “Bad Education” is a visual feast, with Antxon Gomez’s art direction emphasizing the swirls of gaudy color that the director loves and Paco Delgado’s doing likewise; Jose Luis Alcaine’s cinematography serves it all up in a luscious package. Some of the images are absolutely intoxicating. But then so is the entire picture. There is one minor glitch in the storytelling–the reluctance of a character named Angel to give in to a sexual advance that could significantly advance his career, which retrospectively makes little sense in view of what we learn the fellow has already done. But that’s the only flaw in a screenplay that otherwise clicks into place perfectly despite its intricacy. The education may be bad, but the film is great.