\ProvidesPackage{beamerouterthemeFABnice}[2017/09/25]

\mode<presentation>

\ifbeamer@FABcolour%
	\setbeamercolor{section in head/foot}{use=kopf,bg=kopf.fg!60!bg}
	\setbeamercolor{block body}{parent=normal text,use=block title,bg=block title.bg!5!bg}%
	\setbeamercolor{block body alerted}{parent=normal text,use=block title alerted,bg=block title alerted.bg!5!bg}%
	\setbeamercolor{block body example}{parent=normal text,use=block title example,bg=block title example.bg!5!bg}%
\else%
	\beamer@boxedfalse
	\setbeamercolor{section in head/foot}{use=structure,bg=structure.fg!35!bg}
	\setbeamercolor{title in head/foot}{parent=palette quaternary,use=structure,bg=structure.fg!40}
	\setbeamercolor{author in head/foot}{parent=palette primary,use=structure,bg=structure.fg!20}
	\setbeamercolor{date in head/foot}{parent=palette secondary,use=structure,bg=structure.fg!30}
\fi

\setbeamercolor{section in head/foot}{parent=palette quaternary}%
\setbeamercolor{subsection in head/foot}{parent=palette tertiary}%
\setbeamercolor{frametitle}{parent=palette secondary}%
\setbeamercolor{framesubtitle}{parent=palette primary}%

\ifbeamer@boxed
	\useinnertheme[shadow=true]{rounded}
	\setbeamertemplate{items}[circle]
	\setbeamertemplate{sections/subsections in toc}[circle]
\else
	\useinnertheme{rounded}
	\setbeamertemplate{items}[default]
	\setbeamertemplate{itemize items}[circle]
	\setbeamertemplate{sections/subsections in toc}[sections numbered]
\fi


\defbeamertemplate*{headline}{FABnice theme}{%
  \begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
  \end{beamercolorbox}
  \begin{beamercolorbox}{section in head/foot}
  \ifbeamer@Instlogo%
    \insertnavigation{.92\paperwidth}\hfill%
    \raisebox{-.65cm}[0pt][0pt]{\includegraphics[height=0.8cm]{\instlogo}}%
    \hspace{.2cm}
  \else%
    \insertnavigation{\paperwidth}
  \fi
  \end{beamercolorbox}
  \ifbeamer@sb@subsection%
    \vskip1mm%
    \begin{beamercolorbox}[ht=2.125ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
      \usebeamerfont{subsection in head/foot}\insertsubsectionhead
    \end{beamercolorbox}%
  \else%
    \vskip2mm%
  \fi}
\defbeamertemplate*{frametitle}{FABnice theme}{%
  \nointerlineskip%
  \begin{beamercolorbox}[wd=\paperwidth,leftskip=.3cm,rightskip=.3cm plus1fil,vmode]{frametitle}
    \usebeamerfont*{frametitle}\insertframetitle%
      \ifx\insertframesubtitle\@empty%
        \strut\par%
      \else
        \par{\usebeamerfont*{framesubtitle}{\usebeamercolor[fg]{framesubtitle}\insertframesubtitle}\strut\par}%
      \fi%%
    \vspace*{-.3cm}
  \end{beamercolorbox}}

\addtoheadtemplate{\pgfuseshading{beamer@headfade}\vskip-1.25cm}{}
\setbeamerfont*{frametitle}{family=\sffamily, size=\normalsize, series=\bfseries}

\AtBeginDocument{%
	{\usebeamercolor{section in head/foot}}
	\pgfdeclareverticalshading{beamer@headfade}{\paperwidth}
	{color(0cm)=(bg);color(1.25cm)=(section in head/foot.bg)}
	\setbeamercolor{section in head/foot}{bg=}}


\mode<all>
