So we say e.g. dobrý muž, because muž is masculine. We say hezká žena, because žena is feminine. And we say dobré moře, because moře is neuter.
I get this, -ý, -á and -é change at the end of the hard adjectives according to the gender of the noun they are followed by.
But how come we say dobrou noc? Isn't noc feminine? Shouldn't we say dobrá noc?
Please explain this to me if you can, I've only started learning Czech a few days ago and I'm curious about it.
These expressions, like dobrý den, dobrou noc are actually a shortened form of a fuller greeting:
Přeji vám dobrý den - I wish a good day to you
Přeji vám dobrou noc - I wish a good night to you
where dobrý den and dobrou noc are in their accusative form because they are the direct object of the verb "wish":
I (subject) wish something (direct object) to someone (indirect object).
The masculine noun "den" and its adjective "dobrý" look the same in the accusative as they do in their basic (nominative) form.
But for the feminine noun "noc" it's a bit different. The noun "noc" looks the same in the accusative, but its adjective "dobrá" (dobrá noc = a good night) changes to "dobrou".
You can see the change more clearly with a feminine noun like kočka (cat), where the noun changes in the accusative too:
Nominative - dobrá kočka - a good cat
Accusative - Já mám dobrou kočku - I have a good cat
P.S. You can only really say "dobrou noc" in the sense of "goodnight", like before someone goes to bed or at the end of the night in general. The greeting you want here is "Dobrý večer!" = "Good evening!"
Now I see! Thank you for explaining it! Are you a native speaker?
P.S.: Lingot is given
No worries :) Native? No, I'm from a part Czech, part French background, but I'd only call English my real "native" tongue.
Just for completeness, there is also an obsolete form of expressing the greetings by using partitive genitive. The Slavic languages do not have a proper case for partitive like Finnish, so they express the same idea with genitive. Nowadays it sounds a little funny or poetic.
Dobrého dne (vám přeji)! - (I wish a) good day (to you)!
Dobré noci (vám přeji)! - (I wish a) good night (to you)!
The Finnish has special partitive case to express it, like hyvää paivää, hyvää yotä.
The idea of partitive is that you speak about a part of something whole. By wishing Dobrého dne! you kind of wish the addressee to participate on the goodness of the whole good day.