(CNN) On a recent Sunday, a Catholic cardinal in New Jersey welcomed gay and lesbian Catholics to a special Mass at his cathedral in Newark. "I am your brother," Cardinal Joseph Tobin told the congregation , "as a disciple of Jesus."

Weeks later, a Catholic bishop in Illinois instructed priests not to offer Holy Communion or funeral rites to anyone engaged in a same-sex union, unless they had "given some signs of repentance" before their death. Bishop Thomas Paprocki said he has a duty to warn wayward Catholics, with charity, but also "without compromising the truth."

Many of this country's bishops -- who are free, to some extent, to set their own priorities -- linger somewhere between Tobin's welcome and Paprocki's warning. But if the bishops are divided on LGBT issues, there is a greater gulf between church leaders and gay and lesbian Catholics themselves, church experts say.

Into that breach steps the Rev. James Martin, a Jesuit priest and popular author with a large following on social media. In a new book, called "Building a Bridge," Martin urges LGBT Catholics and their bishops to begin conversations rooted in mutual respect, compassion and sensitivity.

Those conversations can be difficult in a church that calls homosexual acts "intrinsically disordered," and, in some dioceses, fires employees who have same-sex partners or advocate for LGBT rights. One conservative website called Martin "a wolf in sheep's clothing (or a Roman collar)."

But Martin's book has won endorsements from high places. Two cardinals and a bishop contributed favorable blurbs, including the head of the Vatican's office of Laity, Family and Life, who called it "welcome and much-needed." Martin himself was recently named a consultor to the Vatican's communications team.

Martin spoke to CNN recently about homophobia, why gay priests stay in the closet and his message to LGBT Catholics who consider leaving the church. This interview has been edited for length and clarity.

What prompted you to write this book?

After the massacre at the gay nightclub in Orlando last year, only a few Catholic bishops expressed their sympathy or reached out to the LGBT community, and even fewer used the words "LGBT" or "gay" in their statements. That was revelatory to me. Even in death, LGBT people are largely invisible in the church.

Why do think so few bishops explicitly mentioned LGBT people after Orlando?

That is a great question. I'm hoping it's not homophobia. I assume it's because for some of them acknowledging the LGBT community is a kind of tacit approval of everything the community says and does, which is certainly not true. And I think there may be a certain amount of fear of the unknown. In my experience, not many bishops know, as friends, LGBT people who are public about their identity or sexuality. That unfamiliarity may lead to a certain amount of fear and suspicion.

One bishop, Robert Lynch in Florida, said that religion is partly to blame for attacks on LGBT people.

He is absolutely right. That doesn't mean that church teaching caused the shooting, but the ways in which religious leaders speak about the LGBT community influences the way the culture at large talks about them. Oftentimes it can give people cover for simply being homophobic, and they can use church teaching as a mask for their homophobia.

Your book doesn't mention much about the church's strong opposition to same-sex marriage, including several bishops' dire responses to the Supreme Court decision legalizing it. Why is that?

For two reasons. First, I'd rather not focus on areas where the LGBT community and the institutional church are still miles apart; I'd prefer to focus on possible areas of common ground. And second, I really didn't want to single out any individual bishops for criticism. But it was mainly the first issue, because they are so far apart on that issue.

You call the firings of gay Catholics by church officials unjust. But aren't they causing "scandal," as the church defines it, by flouting Catholic teaching?

You could make the "scandal" case about a whole raft of people: people who are divorced; people who are divorced and remarried without an annulment; women who have given birth to, or men who have fathered, a child out of wedlock; an unmarried couple who are living together. All these things are very public and we chose not to thunder over them. That, to me, is classic discrimination. Either you require everyone to adhere to church teaching -- on everything, not just sexual morality -- or not. But you don't put one person's life under a moral microscope simply because they are LGBT.

A bishop in Illinois recently said that Catholics in same-sex unions should be denied Holy Communion and funeral rites. Is that new?

That is relatively new. And, again, if the church wants to discriminate against LGBT people, it also has to focus on the moral and sexual behavior of straight people. And we should remember that burying the dead is one of the traditional "corporal works of mercy." It's not a punishment. I find statements like that [from the Illinois bishop] to be needlessly cruel.

Is there any theological justification for denying burial rights to a person in a gay marriage?

Any person prepares himself or herself to enter into the sacraments. So before we go to Mass, for example, we are hopefully in a "state of grace" and have gone to Confession. But to single a group out and target them with statements like this is discriminatory. No other group have their lives put under a microscope like this. None. It's like giving a homily at Mass and, rather than talking to all of us, singling out one person in the pew. And this is a group that has already felt marginalized enough. The place where they should feel most at home is often the place where they feel most excluded. And that is not the way that Jesus operated. When Jesus met people who were seen as on the outskirts of society, he welcomed them. The welcome comes first, and we're not doing that if we call people sinners before we even shake their hands.

OK, but what happens after the church welcomes LGBT people? Is there a Part II, when you have honest conversations about church teaching on homosexuality?

I'm just inviting people to take the first steps, and for many LGBT people those conversations can't even happen, because they don't feel like they are even welcome to step foot in a church.

JUST WATCHED Catholic church changing tone on gays? Replay More Videos ... MUST WATCH Catholic church changing tone on gays? 04:30

I'll give you an example. I've been getting a torrent of messages and requests for help through my public Facebook page recently. Probably 50 a day. And I had one from a woman who asked me if I knew a priest in her city, because she worked in a hospice and the priest assigned to the hospice was refusing to anoint a man who was dying — because he was gay. That's the kind of stuff that LGBT people face every day in the church. Another man told me that he decided to go back to church, and it was Easter, and the homily was on same-sex marriage. We tend to speak about the LGBT community only as problems, rather than people.

A number of surveys show that many, if not most Catholics support gay rights, especially young Catholics. Do you get the sense that this is a generational thing, and that in 20 or 30 years the church hierarchy won't be talking about or treating LGBT people in the same way?

I don't think the church will ever change its position on same-sex marriage, but there is a sea change happening in their approach to LGBT Catholics in general. You have someone like Cardinal Joseph Tobin of New Jersey who is not advocating changing church teaching but is welcoming LGBT people, listening to them and trying to inculcate what Pope Francis calls a "culture of encounter."

There are two reasons for this shift. One is Pope Francis. His saying " Who am I to judge?" about gay people; his public meeting with Yayo Grassi , his former student who is gay, during his papal visit to the United States; his comments in Amoris Laetitia [a papal document in which he opposes gay marriage but says that gay Catholics should receive "respectful pastoral guidance."] And the bishops who Pope Francis is appointing in the United States are much more LGBT friendly.

The second thing is the increased number of LGBT Catholics who are coming out and making LGBT issues much more important for the church as a whole. At St. Cecilia's Church in Boston recently we had 700 people at a talk, and I stayed afterward signing books for two hours. LGBT people are so hungry for a place in what is, after all, their own church, and they are grateful that someone in a collar would bring this up.

You write that there are hundreds, if not thousands of gay and lesbian Catholic clergy. Why aren't they "out"?

Several reasons. One, their bishops or religious superiors ask them not to come out. Two, they fear reprisals from parishioners. Three, they fear it would be divisive. Four, they are private people. Five, they are not fully aware of their sexuality. And lastly, people have mistakenly conflated homosexuality and pedophilia, and so priests don't want to come out because they fear they'll be labeled a pedophile.

Would it make a difference if more clergy came out?

Of course it would. It would help to show Catholics in the pews what a gay person is like and, incidentally, how gay people can live chastely. The great irony is that these men and women are living out exactly what the church asks of LGBT people -- chastity and celibacy -- and they are not allowed to talk about it. They are doing great work under a strange cloud that should not exist.

It seems the "T" in LGBT raises such different and complex questions for the church. Transgender advocates have taken issue with the Pope, particularly his comments comparing the danger of gender theory to nuclear war.

This phenomenon is the leading edge of reflection on human sexuality, even in our American culture. So it is not surprising that the church is still grappling with this. It is something that people have only been grappling with publicly for about 10 years.

The other night in Boston, a couple came up to me. The husband was transgender, and had become a woman, and the woman had stayed with her spouse. That is, she married someone who was a man and who was now a woman. I was amazed and had a hard time even processing it. I said to the wife, "How are you able to do this?" And she said, "Love is love." I thought, here is a new kind of love, a new kind of fidelity, to consider and ponder, as some sort of expression of God's love for us. The church needs to reflect on that.

What do you say when someone asks, "Father Jim, why should I stay in a church that doesn't welcome me?"

I say: Jesus Christ called you into this church at your baptism, and it is just as much your church as it is the Pope's, the local bishop's and mine. You have just as much right to be in the church as anyone else. Don't let anyone ever push you out of your church.

I'm very clear on that.

Are people surprised to hear that from a priest?

They're sometimes surprised but on reflection they understand it. The other day I was at a baptism in New York and at the end of the baptism the priest lifted the child up and the organ boomed out "Alleluia," and it sent chills down my spine. I thought: This is the most sacred moment in a person's life. This is entrance into the Christian community and it should never be forgotten. That child is in the church now and forever. Straight. Lesbian. Gay. Transgender. Bisexual. And no one should ever seek to kick that person out of the church.