\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{cv}[2022/09/17 Custom CV Class]
\LoadClass[letterpaper, 11pt]{cv_base}


% change geometry
\RequirePackage[left=.9in, right=.9in, bottom=1in, top=1in]{geometry}


% section / subsection formatting
\RequirePackage{titlesec}

\titleformat{\section}         % Customise the \section command 
  {\Large\latolight\selectfont \raggedright\uppercase} % Make the \section headers large (\Large),
                               % small capitals (\scshape) and left aligned (\raggedright)
  {}{0em}                      % Can be used to give a prefix to all sections, like 'Section ...'
  {}                           % Can be used to insert code before the heading
  [\titlerule]                 % Inserts a horizontal line after the heading

\titleformat{\subsection}
  {\large\latolight\selectfont \raggedright\uppercase}
  {}{0em}
  {}


% no paragraph indent
\setlength{\parindent}{0cm}

% larger line spaces
\renewcommand{\baselinestretch}{1.15}

% sizing parameters
\RequirePackage{setspace, longtable, multicol}

\newcommand{\tblitemsep}{\vspace{.5cm}}
\newcommand{\tblitemsepsmall}{\vspace{.2cm}}
\newcommand{\preitemizesep}{\vspace{.3em}}
\newcommand{\initemizesep}{
    \setlength{\itemsep}{.2em}
    \setlength{\parsep}{0em}
    \setlength{\parskip}{.3em}
}
\newcommand{\crule}{{\color{\hicolor}\hrule}}
\newcommand{\notextitemizepre}{\vspace{-.5cm}}

\setlength{\multicolsep}{0pt}


% fancy header
\RequirePackage{lastpage, fancyhdr, datetime}

\newcommand{\MakeHeader}[2]{
  \fancyhf{}
  \rfoot{\thepage \,/ \pageref{LastPage}}
  \lhead{\latolight\footnotesize #1}
  \chead{}
  \rhead{\latolight\footnotesize\colorhi{#2}}
  
  \fancypagestyle{firstpage}{  %section openning
          \fancyhf{}
          \fancyfoot[RO]{Seite \thepage}
          \renewcommand{\headrulewidth}{0pt}
  }
  
}

\pagestyle{fancy}

% header color
\let\oldheadrule\headrule% Copy \headrule into \oldheadrule
\renewcommand{\headrule}{\color{\hicolor}\oldheadrule}

% footnote color
\let\oldfootnoterule\footnoterule
\renewcommand{\footnoterule}{{\color{\hicolor}{\oldfootnoterule}}}
