I'm using the titlesec package to style my section titles, including centring and colouring them. Sometimes my sections appear in a minipage because I often have long narrow diagrams that run the length of the page, and I want the text alongside it. However, I'm finding that when the \section occurs at the start of a minipage, there's extra vertical space at the top of the page. The following MWE shows this:
\documentclass[10pt]{article}
\usepackage[a6paper,showframe]{geometry}
\usepackage{xcolor}
\definecolor{headcol}{cmyk}{0,.75,.75,.2}
\usepackage{titlesec}
\newcommand\sectheadfont{\fontsize{12pt}{14.4pt}\selectfont\color{headcol}}
\titleformat{\section}[block]{\sectheadfont}{}{0pt}{\filcenter}
\begin{document}
\section{Foo}
\clearpage
\begin{minipage}[t]{0.8\textwidth}
\section{Bar}
\end{minipage}
\end{document}
The first page has no space before the title, while the second page has 1em of space above it. If I comment out the \titleformat line, this doesn't happen. Moreover, if I remove \color{headcol} from the definition of \sectheadfont it doesn't. Something about the way I'm requested a coloured heading is responsible for the extra space.
I know I can manually sort it out with a \vspace{-1em} at the start of the minipage, but this seems a bit fragile as the exact space needed seems to be dependent on the font size and other such things, and not always exactly 1em. Can anyone help me fix this in my preamble?

\begin{minipage}[b]{0.8\textwidth}? – Ivan Apr 25 '21 at 14:43minipageenvironments of unequal heights next to each other, and rely on the[t]to align them relative to each other. This is perhaps a clue as to why the MWE is incorrectly aligned, though I'm not sure I can interpret that clue. – richard Apr 25 '21 at 15:13