% Example not working properly
%\makeatletter
%   \def\vhrulefill#1{\leavevmode\leaders\hrule\@height#1\hfill \kern\z@}
%\makeatother

% Better solution
\newcommand*\varhrulefill[1][0.4pt]{\leavevmode\leaders\hrule height#1\hfill\kern0pt}

% Chapter (general) styling
\renewcommand*{\chapterformat}{%
  \enskip\mbox{\scalebox{3}{\thechapter\autodot}}}
% Chapter (line) styling
\renewcommand\chapterlinesformat[3]{%
  \parbox[b]{\textwidth}{\varhrulefill[0.4pt]#2}\par%
  #3\par%
  \vspace*{27.5pt}%
  \hrule height 0.4pt}
\RedeclareSectionCommand[afterskip=1.5\baselineskip]{chapter}

% Section (general) styling
\renewcommand*{\sectionformat}{%
  {\thesection\autodot}\hspace{12.5pt}|\hspace{12.5pt}}
 
% Subsection (general) styling
\renewcommand*{\subsectionformat}{%
  {\thesubsection\autodot}\hspace{7.25pt}|\hspace{7.25pt}}
  
% Section and subsection (line) styling
\makeatletter
\renewcommand{\sectionlinesformat}[4]{%
\ifstr{#1}{section}{%
    % Section styling
    \parbox[t]{\linewidth}{%
      \raggedsection\@hangfrom{\hskip #2#3}{#4}\par%
      \vspace*{10pt}%
      \hrule height 0.4pt%
    }%
  }{%
    % Subsection, subsubsection styling
    \@hangfrom{\hskip #2#3}{#4}\enskip\varhrulefill[0.4pt]
    }
}
\makeatother