We present the computational methodology, which for the first time allows rigorous twelve-dimensional (12D) quantum calculations of the coupled intramolecular and intermolecular vibrational states of hydrogen-bonded trimers of flexible diatomic molecules. Its starting point is the approach that we introduced recently for fully coupled 9D quantum calculations of the intermolecular vibrational states of noncovalently bound trimers comprised of diatomics treated as rigid. In this paper, it is extended to include the intramolecular stretching coordinates of the three diatomic monomers. The cornerstone of our 12D methodology is the partitioning of the full vibrational Hamiltonian of the trimer into two reduced-dimension Hamiltonians, one in 9D for the intermolecular degrees of freedom (DOFs) and another in 3D for the intramolecular vibrations of the trimer, and a remainder term. These two Hamiltonians are diagonalized separately, and a fraction of their respective 9D and 3D eigenstates is included in the 12D product contracted basis for both the intra- and intermolecular DOFs, in which the matrix of the full 12D vibrational Hamiltonian of the trimer is diagonalized. This methodology is implemented in the 12D quantum calculations of the coupled intra- and intermolecular vibrational states of the hydrogen-bonded HF trimer on an abinitio calculated potential energy surface (PES). The calculations encompass the one- and two-quanta intramolecular HF-stretch excited vibrational states of the trimer and low-energy intermolecular vibrational states in the intramolecular vibrational manifolds of interest. They reveal several interesting manifestations of significant coupling between the intra- and intermolecular vibrational modes of (HF)3. The 12D calculations also show that the frequencies of the v = 1, 2 HF stretching states of the HF trimer are strongly redshifted in comparison to those of the isolated HF monomer. Moreover, the magnitudes of these trimer redshifts are much larger than that of the redshift for the stretching fundamental of the donor-HF moiety in (HF)2, most likely due to the cooperative hydrogen bonding in (HF)3. The agreement between the 12D results and the limited spectroscopic data for the HF trimer, while satisfactory, leaves room for improvement and points to the need for a more accurate PES.