"Does the girl want fruit?"
Translation:An bhfuil torthaí ón gcailín?
Can I follow up on that one? As you say, if it was "a girl" instead of "the girl", we would have "ó chailín". On the other hand, "the girl" is "an cailín" (no change as "cailín" is a male noun if I understand it correctly). Now why does the combination "ó"+"an" result in eclipsis?
I couldn't tell you exactly why, but section 3 of the notes under Eclipsis and section 6 of Lenition give a great summary of the prepositions that trigger those respective mutations.
I noticed that den, don, and sa/san (off the, to the, in the) were the only definite forms that triggered lenition, while a significantly greater number of uncombined definite forms (ag an, ar an, etc.) triggered eclipsis, in addition to faoin and ón. (Regarding prepositions without the definite article, a handful were associated with lenition and none with eclipsis.)
Isn't torthaí technically the subject? "fruit is away from the girl"
Think of phrases with a pronoun, like "Tá torthaí uaim" - "uaim" is in the same position as "ón gcailín".
(It was the eclipsis that threw me off. And for once I had remembered to phrase it as a question, with "an bhfuil" instead of "tá"...)