%%%%%%%%%%%%%%%%%%%%%%%
% Semirounded style and sizes
%


\usepackage{\templates/semirounded}
\useinnertheme{rounded}

% uses tabularx below, need to include it
\usepackage{tabularx}
% in case of animated slides: hide upcoming content
\setbeamercovered{transparent}

% define size 
\usepackage{geometry}
\geometry{papersize={17.07cm,9.6cm}}
\setlength{\unitlength}{1mm}

\usepackage[absolute,overlay]{textpos}
\setbeamersize{text margin left=6mm,text margin right=6mm} 



%%%%%%%%%%%%%%%%%%%%%%%
% Font size in itemize
\setbeamerfont{itemize/enumerate body}{size=\normalsize}
\setbeamerfont{itemize/enumerate subbody}{size=\normalsize}
\setbeamerfont{itemize/enumerate subsubbody}{size=\normalsize}


%%%%%%%%%%%%%%%%%%%%%%%
% keine Navigationsleiste
%
\beamertemplatenavigationsymbolsempty    


%%%%%%%%%%%%%%%%%%%%%%%
% anderer Font zur Nutzung des "normalen Latex-Beamer-Fonts"
%
%\usepackage{lmodern}
\usepackage[scaled=.92]{helvet}


%%%%%%%%%%%%%%%%%%%%%%%
% KIT-Farben
%
\definecolor{kit-green100}{rgb}{0,.59,.51}
\definecolor{kit-green70}{rgb}{.3,.71,.65}
\definecolor{kit-green50}{rgb}{.50,.79,.75}
\definecolor{kit-green30}{rgb}{.69,.87,.85}
\definecolor{kit-green15}{rgb}{.85,.93,.93}
\definecolor{KITgreen}{rgb}{0,.59,.51}



%%%%%%%%%%%%%%%%%%%%%%%%    
% Definition der KIT-Itemize-Umgebung
%
\setbeamertemplate{itemize items}
{
	
	\begin{pgfpicture}{0mm}{0mm}{1.5ex}{1.5ex}
		{\pgfsetcornersarced{\pgfpoint{.3ex}{.3ex}} 
			\pgfpathmoveto{\pgfpoint{0cm}{1.5ex}} 
			\pgfpathlineto{\pgfpoint{1.5ex}{1.5ex}}
			\pgfpathlineto{\pgfpoint{1.5ex}{0cm}}}
		{\pgfsetcornersarced{\pgfpoint{.3ex}{.3ex}}
			\pgfpathmoveto{\pgfpoint{1.5ex}{0cm}}
			\pgfpathlineto{\pgfpointorigin}
			\pgfpathlineto{\pgfpoint{0cm}{1.5ex}}}
		\color{kit-green100}
		\pgfusepath{fill}
	\end{pgfpicture}%
}

\setbeamertemplate{enumerate item}{%
  \usebeamercolor[bg]{item projected}%
   %\raisebox{1.5pt}{{\color{black}\footnotesize\insertenumlabel}}%
   \begin{pgfpicture}{0mm}{0mm}{1.5ex}{1.5ex}
		{\pgfsetcornersarced{\pgfpoint{.3ex}{.3ex}} 
			\pgfpathmoveto{\pgfpoint{0cm}{1.5ex}} 
			\pgfpathlineto{\pgfpoint{1.5ex}{1.5ex}}
			\pgfpathlineto{\pgfpoint{1.5ex}{0cm}}}
		{\pgfsetcornersarced{\pgfpoint{.3ex}{.3ex}}
			\pgfpathmoveto{\pgfpoint{1.5ex}{0cm}}
			\pgfpathlineto{\pgfpointorigin}
			\pgfpathlineto{\pgfpoint{0cm}{1.5ex}}}
		\color{kit-green100}
		\pgfusepath{fill}
		\color{black}
     {\pgfputat{\pgfpoint{0.75ex}{0.75ex}}{\pgfbox[center,center]{{\footnotesize\insertenumlabel}}}}
	\end{pgfpicture}%
}
%%%%%%%%%%%%%%%%%%%%%%%%    
% .... und dieselbe Farbe für alle andere Aufzählungen
%
\setbeamercolor{item}{fg=kit-green100}


%%%%%%%%%%%%%%%%%%%%%%%%    
% Footnote, table of contents and bibliography

\renewcommand{\footnotesize}{\scriptsize}
\setlength\footnotesep{5pt}

% footnote mark possessing the same color as the foreground	
\setbeamercolor{footnote mark}{fg=.}


% colors in literature and contents
\setbeamercolor{bibliography item}{parent=palette primary, fg=black}
\setbeamercolor*{bibliography entry title}{parent=palette primary, fg=black}
\setbeamercolor*{bibliography entry author}{parent=palette primary, fg=black}
\setbeamercolor*{bibliography counter}{parent=palette primary, fg=black}

\setbeamercolor{section in toc}{fg=black}
\setbeamercolor{section in bib}{fg=black}

\defbeamertemplate{section in toc}{square unnumbered}{%
	\begin{pgfpicture}{0mm}{0mm}{1.5ex}{1.5ex}
		{\pgfsetcornersarced{\pgfpoint{.3ex}{.3ex}} 
			\pgfpathmoveto{\pgfpoint{0cm}{1.5ex}} 
			\pgfpathlineto{\pgfpoint{1.5ex}{1.5ex}}
			\pgfpathlineto{\pgfpoint{1.5ex}{0cm}}}
		{\pgfsetcornersarced{\pgfpoint{.3ex}{.3ex}}
			\pgfpathmoveto{\pgfpoint{1.5ex}{0cm}}
			\pgfpathlineto{\pgfpointorigin}
			\pgfpathlineto{\pgfpoint{0cm}{1.5ex}}}
		\color{kit-green100}
		\pgfusepath{fill}
	\end{pgfpicture}%
	\kern1.5ex\inserttocsection\par}

\setbeamertemplate{section in toc}[square unnumbered]
\setbeamertemplate{subsection in toc}[square unnumbered]



% multiple pages not being numbered automatically
\setbeamertemplate{frametitle continuation}[from second][\insertcontinuationcountroman]





%%%%%%%%%%%%%%%%%%%%%%
%frametitle
\setbeamertemplate{frametitle}
{
	\vspace{2mm} %\hspace*{-4mm}
	\vbox{\hsize=17cm\bfseries\usebeamerfont{frametitle}\textcolor{black}{\LARGE\insertframetitle}}
	\begin{textblock*}{15mm}(146mm,4mm)
		\iflanguage{english}{%
			\includegraphics[width=18mm]{\templates/logos/kitlogo_en_rgb} 
		}{%
			\includegraphics[width=18mm]{\templates/logos/kitlogo_de_rgb} 
		}%
		
	\end{textblock*}
	\vspace{.5cm}
}

\setbeamertemplate{headline}
{
}


\usepackage[export]{adjustbox}



%%%%%%%%%%%%%%%%%%%%%%%
%footer
\setbeamercolor{footlinecolor}{fg=kit-green100, bg=kit-green30}

\setbeamertemplate{footline}
{

	\ifnum \theframenumber=1
		% title frame, do nothing
	
	\else

		%%%%%%%%%%%%%%
		% footer consisting of a kit-green line separating slide and footer
		%%%%%%%%%%%%%%
		\begin{center}
		{
		\color{lightgray}
		\rule{.975\textwidth}{1.pt}
		}
		\end{center}
	%
		\vspace{-0.1cm}
		\hspace{.2cm} 
	%
		\begin{tabularx}{\columnwidth}{p{.005\linewidth}p{.575\linewidth}p{.3\linewidth}p{.15\linewidth}}
			\textcolor{black}{\bf \insertframenumber}
			&
			\textcolor{black}{\bf \insertshortauthor ~\textbar}
			\textcolor{black}{\bf \insertshortdate}
			&
			\hfill
            \textcolor{black}{\bf
                \begin{tabular}{@{}r@{}}Institute of Radio Frequency Engineering \\ and Electronics\end{tabular}
            }
			&
            \hspace*{-3mm}
			\includegraphics[scale=0.24, valign=c]{\templates/logos/IHE_logo.pdf}	
		\end{tabularx}
		\hspace{.3cm} 
		\vspace{.2cm}
	\fi
}





%%%%%%%%%%%%%%%%%%%%%%
%title page
\setbeamertemplate{title page}
{
	\setbeamertemplate{footline}{} 
	
	\thispagestyle{empty}

	%elements on title page
	
	%KIT logo
	\begin{textblock*}{24mm}(6mm,5mm)
		\iflanguage{english}{%
			\includegraphics[width=23mm]{\templates/logos/kitlogo_en_rgb} 
		}{%
			\includegraphics[width=23mm]{\templates/logos/kitlogo_de_rgb} 
		}%
	\end{textblock*}
	
	%CEL logo
	\begin{textblock*}{20mm}(150mm,8mm)
	\includegraphics[scale=0.50]{\templates/logos/IHE_logo.pdf} 
	\end{textblock*}
	
	%title
	\begin{textblock*}{170mm}(6mm,16mm)
		\begin{beamercolorbox}[wd=168mm,ht=20mm,dp=3mm,left]{white}%
			\Large\textbf{\inserttitle}
		\end{beamercolorbox}
	\end{textblock*}
	
	%subtitle
	\begin{textblock*}{170mm}(6mm,32.5mm)
		\scriptsize \insertsubtitle
	\end{textblock*}
	
	%author
	\begin{textblock*}{120mm}(6mm,35mm)
		\scriptsize\insertauthor~\textbar~\insertshortdate
	\end{textblock*}


	% title image
	\begin{textblock*}{\paperwidth}(1mm,40mm)
		\begin{center}
        \vspace{5mm}
		\includegraphics[width=.95\linewidth]{\templates/logos/master_slide_background} 
		\end{center}
	\end{textblock*}

	
	%legal KIT text
	\begin{textblock*}{80mm}[0,1](6mm,93.5mm)
		\fontsize{4pt}{6pt}\selectfont
		\iflanguage{english}{
			KIT -- The Research University in the Helmholtz Association}
		{KIT -- Die Forschungsuniversit\"at in der Helmholtz-Gemeinschaft}
	\end{textblock*}
	
	\begin{textblock*}{16mm}(150mm,92mm)
		\fontsize{8pt}{8pt}\selectfont
		\bfseries
		\textcolor{gray}{\href{http://www.kit.edu}{www.kit.edu} }
	\end{textblock*}

	
}

% set block title colors for theorems
\setbeamercolor{block title}{use=structure,fg=white,bg=kit-green100}
\setbeamercolor{block body}{use=structure,fg=black,bg=kit-green15}
