\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{conjugationtables}[2025/01/22 Conjugation Tables]

\LoadClass[12pt]{scrartcl}

\RequirePackage{kvoptions}

\SetupKeyvalOptions{
  family=ct,
  prefix=ct@
}

\DeclareStringOption{language}

\ProcessKeyvalOptions*

\RequirePackage[\ct@language]{babel}
\RequirePackage[margin=2cm]{geometry}
\RequirePackage{multicol}
\RequirePackage{tabularx}
\RequirePackage{tcolorbox}
\RequirePackage[table]{xcolor}
\RequirePackage{xifthen}
\RequirePackage{xparse}

\pagestyle{empty}
\renewcommand{\familydefault}{\sfdefault}
\rowcolors{1}{black!5!white}{white}

\NewDocumentCommand{\conheader}{O{}O{}m}{%
\begin{center}
  {\phantom{(}\Huge \ifthenelse{\equal{#2}{}}{}{{\ifthenelse{\equal{\ct@language}{french}}{\NoAutoSpacing}{}#2: }} \textbf{#3} \ifthenelse{\equal{#1}{}}{}{({\ifthenelse{\equal{\ct@language}{french}}{\NoAutoSpacing}{}example: #1})}\phantom{)}}
\end{center}
}

\NewDocumentEnvironment{contables}{O{}O{}m}{%
\begin{minipage}{\textwidth}
\conheader[#1][#2]{#3}
\vspace{1em}
\begin{multicols}{2}
}{%
\end{multicols}
\vspace{3em}
\end{minipage}
}

\newtcolorbox{contable}[1]{before title={\setcounter{rownum}{0}}, title={\textbf{#1}\phantom{(}}, tabularx={l|X}}
