We prove that, given $2< p<\infty$, the Fourier coefficients of functions in $L_2(\mathbb {T}, |t|^{1-2/p}\,{\rm d}t)$ belong to $\ell _p$, and that, given $1< p<2$, the Fourier series of sequences in $\ell _p$ belong to $L_2(\mathbb {T}, \vert {t}\vert ^{2/p-1}\,{\rm d}t)$. Then, we apply these results to the study of conditional Schauder bases and conditional almost greedy bases in Banach spaces. Specifically, we prove that, for every $1< p<\infty$ and every $0\le \alpha <1$, there is a Schauder basis of $\ell _p$ whose conditionality constants grow as $(m^{\alpha })_{m=1}^{\infty }$, and there is an almost greedy basis of $\ell _p$ whose conditionality constants grow as $((\log m)^{\alpha })_{m=2}^{\infty }$.