%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%							CopyLeft Gregory Trullemans							%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Some parts of this theme are based on the 'diepentheme' %
% by Guido Diepen <diepen@cs.uu.nl>                       %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ProvidesPackage{beamerthemeffg}

\RequirePackage{beamerbasethemes}[2004/10/07]
\RequirePackage{calc}
\RequirePackage{ifthen}
\RequirePackage[T1]{fontenc}
% \RequirePackage[utf8]{inputenc}
\RequirePackage[no-math]{fontspec}
\RequirePackage{ragged2e}
\RequirePackage{graphics}
\RequirePackage[frenchb]{babel}
\RequirePackage{nicefrac}
\RequirePackage{xcolor}
\RequirePackage{tikz}

\definecolor{ffgorange}{RGB}{239, 125, 55}

\useoutertheme{ffg}

    %% This template uses typical OS X and Adobe fonts
    %\defaultfontfeatures{Mapping=tex-text}  % This seems to be important for mapping glyphs properly

    %\setmainfont{Chalkduster}            	% Beamer ignores "main font" in favor of sans font
    %\setsansfont{Chalkduster}            	% This is the font that beamer will use by default
    %\setmainfont{Gill Sans Light}     		% Prettier, but harder to read
    %\setnormalfont{Chalkduster}

    %\setbeamerfont{title}{family=\fontspec{Chalkduster}}

%\addtobeamertemplate{block begin}{}{\justifying}% new code
%\apptocmd{\frame}{\justifying}{}{}%new code

% remove navigation symbols
%\setbeamertemplate{frametitle}{\vskip-6pt}
\setbeamertemplate{frametitle}{
	\vskip3pt
	\hspace{2.8cm}
	\insertframetitle\\
	\hspace{3.1cm}
	\usebeamerfont{framesubtitle}\insertframesubtitle
	\par
	\vskip15pt
}
%\setbeamertemplate{framesubtitle}{\insertframesubtitle\par\vskip-15pt}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{blocks}[rounded][shadow=true]

\setbeamertemplate{title}{
	\vskip3pt
	\maketitle
}

\mode<presentation>

% Set text colors for different objects
% Set color for titles
\usecolortheme[named=black]{structure}
% Set color for the text
%\setbeamercolor{normal text}{fg=black}

% First Page Color 
\setbeamercolor{title}{fg=white}
\setbeamercolor{author}{fg=white}
\setbeamercolor{date}{fg=white}
\setbeamercolor{institute}{fg=white}

% Other page
\setbeamercolor{frametitle}{fg=ffgorange}
\setbeamercolor{structure}{fg=black}
\setbeamercolor{normal text}{fg=black}
%\setbeamercolor{alerted text}{fg=black}
%\setbeamercolor{example text}{fg=black}

%title
\setbeamercolor{block title alerted}{fg=white, bg=orange}
%body
\setbeamercolor{block body alerted}{fg=red,bg=white}
% parent of all alerts default is red
\setbeamercolor{alerted text}{fg=green}

% Set color for bullet
\setbeamercolor{enumerate item}{fg=black}
\setbeamercolor{enumerate subitem}{fg=black}
\setbeamercolor{enumerate subsubitem}{fg=black}
\setbeamercolor{itemize item}{fg=black}
\setbeamercolor{itemize subitem}{fg=black}
\setbeamercolor{itemize subsubitem}{fg=black}
\setbeamersize{text margin left=4ex}

% Set fonts
\setbeamerfont{frametitle}{size=\huge, series=\bfseries}
\setbeamerfont{framesubtitle}{size=\footnotesize, series=\normalfont}
\setbeamerfont{title}{size=\Huge, series=\bfseries}
\setbeamerfont{subtitle}{size=\large, series=\normalfont}
\setbeamerfont{author}{size=\Large, series=\bfseries}
\setbeamerfont{date}{size=\tiny}
\setbeamerfont{institute}{size=\footnotesize}
\setbeamerfont{block title}{series=\bfseries}