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

%   List of packages
\RequirePackage{beamerbasethemes}[2004/10/07]
\RequirePackage[french]{babel}									% Gestion du français
\RequirePackage[T1]{fontenc}
\RequirePackage{calc}											% Syntaxe naturelle pour les calculs
\RequirePackage{ifthen}
\RequirePackage[no-math]{fontspec}
\RequirePackage{nicefrac}										% Gestion des fractions
\RequirePackage{ragged2e}
% \RequirePackage{graphics}
\RequirePackage{graphicx}										% Gestion des images
\RequirePackage{xcolor}											% Gestion des couleurs
\RequirePackage{tikz}
\RequirePackage{textcomp}                                       % Pour éviter les problèmes avec gensymb`'
\RequirePackage{gensymb}										% symbole \degree

\useoutertheme{ffg}

%	define the FfG's orange
\definecolor{old_ffg_orange}{RGB}{239, 125, 55}
\definecolor{ffg_darkblue}{RGB}{21,29,76}
\definecolor{ffg_lightblue}{RGB}{0, 120, 190}
\definecolor{ffg_red}{RGB}{241, 83, 60}

% FfG Color
\setbeamercolor{title}{fg=ffg_lightblue}
\setbeamercolor{subtitle}{fg=ffg_red}
\setbeamercolor{author}{fg=ffg_darkblue}
\setbeamercolor{date}{fg=ffg_lightblue}
\setbeamercolor{institute}{fg=ffg_lightblue}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TITLE SLIDE TEMPLATE
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{title page}{
    \vfill
    \centering

    \hspace*{2.5cm}\usebeamerfont{title}\usebeamercolor[fg]{title}\inserttitle\par%
    \ifx\insertsubtitle\@empty%
    \else%
        \vskip0.25em%
        \hspace*{2.5cm}{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
    \fi%

    \vskip1.5cm%
    \hspace*{2.1cm}\usebeamerfont{author}\usebeamercolor[fg]{author}\insertauthor%

    \vskip0.2cm%
    \hspace*{2.5cm}\usebeamerfont{date}\usebeamercolor[fg]{date}\insertdate%

    \vskip0.2cm%
    \hspace*{2.5cm}\usebeamerfont{institute}\usebeamercolor[fg]{institute}\insertinstitute%

    \vfill
}


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% COMMON SLIDE TEMPLATE
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{frametitle}{
    \nointerlineskip
    \vspace{0.1cm}
    \hspace{0.4cm}
    \insertframetitle\par%           % insertion du titre
    \hspace{0.45cm}
    \usebeamerfont{framesubtitle}\insertframesubtitle
    \vspace{-0.75cm}
}


\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{blocks}[rounded][shadow=true]

\mode<presentation>

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

% Other page
\setbeamercolor{frametitle}{fg=white}
\setbeamercolor{structure}{fg=black}
\setbeamercolor{normal text}{fg=black}

% Title
\setbeamercolor{block title alerted}{fg=white, bg=ffg_red}

% 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}
