middag means dinner, at first sight you would think middag means lunch because lunch happens mid day. I believe that the largest meal of the day used to be in the middle of the day which is why they call it that but nowadays it is in the evening but it has retained the same name
Attributive vs predicative. Quoting myself from https://forum.duolingo.com/comment/26420394/Answers-to-some-common-questions-on-grammar-that-beginners-have
if the adjective comes before the noun, you use the definite form - and if it comes after the noun, you use the indefinite. Think of it as "the silly jester" versus "the jester is silly" - in English, there's no difference in the adjective, but Swedish frequently has different forms for the two.