Are there any rules for how to determine the gender of a compound word? In German, for instance, the last word determines the gender, and that seems to be what is happening here. Is that a rule, or just a coincidence? And then how would words like sú talún work, that are actually written as two words?
All of the compound words that I’ve seen written as a single word mirror the German behavior, so consider it a rule until you find sufficient counter-examples to disprove it. Lexemes such as sú talún that are written as two words retain the gender of the first word; in the case of sú talún, talún is the feminine genitive form of talamh, which matches the gender of the berry sú. (The juice sú is masculine; if one wanted to speak of “land juice”, then sú talaimh would be used, since talaimh is the masculine genitive form of talamh.)