absorption line from the chromosphere If I understand correctly, the H-alpha and Ca II K lines are absorption lines of the sun and allow to see the chromosphere. Following the Kirchhoff-Bunsen law, an absorption line is produced by a gas which is cooler than the source of light.

However the chromosphere is hotter than the photosphere and the temperature increases outward (https://www.researchgate.net/figure/The-figure-plots-profiles-of-mass-density-dashed-line-and-temperature-solid-line-in_fig6_312376685). This is in contradiction with the previous hypothesis. Then how can we see the chromosphere in absorption line? What am I missing in the reasoning? Is the Krichhoff-Bunsen law only valid for a thin medium and here we would be in presence of a thick one?

thank you in advance for your help.
Most of the absorption line comes from the photosphere in the region where the temperature is still dropping.  Nevertheless, you can also get an absorption line where the temperature is rising, due to scattering effects.  The Kirchoff-Bunsen law you describe is a simplified rule that assumes the lines form in thermal equilibrium with the local temperature, but sometimes scattering produces non-thermal-equilibrium ("non-LTE") effects.  With scattering, line photons that get absorbed get re-radiated right away without coupling to the local temperature, and their re-emission has a 50% chance of being radiated back downward, where they will be reabsorbed deeper in the atmosphere.  This contributes to absorption, especially near line center (and can cause a feature called "central reversal" there).  But it is true that you can also get emission lines from very strong chromospheres where the Kirchoff-type effect does occur, see the profiles from chromospherically active dwarf stars (called "dMe stars").