\ProvidesPackage{beamerthemeLYC} % this style was created by Li Yue Chen and is an adaption of Rob J Hyndman's style

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\selectcolormodel{cmyk}
\mode<presentation>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% custom colors
\definecolor{backgroundColor}{HTML}{FFFFFF}
\definecolor{textColor}{HTML}{000000}

\definecolor{blockTitleColor}{HTML}{009a90}
\definecolor{blockTitleTextColor}{HTML}{FFFFFF}
\definecolor{blockBodyColor}{HTML}{FFFFFF}
\definecolor{blockBodyTextColor}{HTML}{000000}

\colorlet{subblockTitleColor}{blockTitleColor!30!gray}
\definecolor{subblockTitleTextColor}{HTML}{FFFFFF}
\definecolor{subblockBodyColor}{HTML}{FFFFFF}
\definecolor{subblockBodyTextColor}{HTML}{000000}

\definecolor{headlineColor}{HTML}{047070}
\definecolor{headlineTextColor}{HTML}{FFFFFF}
\definecolor{authorTextColor}{HTML}{FFFFFF}
\definecolor{instituteTextColor}{HTML}{FFFFFF}
\definecolor{logoColor}{HTML}{FFFFFF}
\definecolor{separationLineColor}{HTML}{FFFFFF}

% headline colors and fonts
\setbeamercolor{headline}{bg=headlineColor}
\setbeamercolor{title in headline}{fg=headlineTextColor}
\setbeamercolor{author in headline}{fg=authorTextColor}
\setbeamercolor{institute in headline}{fg=instituteTextColor}
\setbeamercolor{separation line}{bg=separationLineColor}

\setbeamerfont{frametitle}{size=\Huge,series=\bfseries}

% footline colors and fonts
\setbeamercolor{footline}{fg=white,bg=headlineColor}
\setbeamerfont{footline}{size=\normalsize}

% body colors and fonts
\setbeamercolor*{normal text}{fg=textColor,bg=backgroundColor}

% block environment
\setbeamercolor*{block body}{fg=blockBodyTextColor,bg=blockBodyColor}
\setbeamercolor*{block title}{fg=blockTitleTextColor,bg=blockTitleColor}
\setbeamerfont{block title}{size=\LARGE,series=\bfseries}

\setbeamercolor*{subblock body}{fg=subblockBodyTextColor,bg=subblockBodyColor}
\setbeamercolor*{subblock title}{fg=subblockTitleTextColor,bg=subblockTitleColor}
\setbeamerfont{subblock title}{size=\large,series=\bfseries}

% example environment
\setbeamercolor*{example body}{fg=blockBodyTextColor,bg=blockBodyColor}
\setbeamercolor*{example title}{fg=blockTitleTextColor,bg=blockTitleColor}
\setbeamerfont{example title}{size=\huge,series=\bfseries}

\setbeamercolor{alerted text}{fg=blockTitleTextColor}

\setbeamertemplate{itemize items}[triangle]
\setbeamertemplate{navigation symbols}{}  % no navigation on a poster

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{headline}{  
  \leavevmode

  \begin{beamercolorbox}[wd=\paperwidth]{headline}
				\centering
        \vskip2ex
        \usebeamercolor{title in headline}{
            \color{fg}\usebeamerfont*{frametitle}\inserttitle\\[.6ex]
        }
        \usebeamercolor{author in headline}{\color{fg}\LARGE{\insertauthor}\\[.2ex]}
        \usebeamercolor{author in headline}{\color{fg}\LARGE{\insertinstitute}\\[1ex]}
  \end{beamercolorbox}
  
  \begin{beamercolorbox}[wd=\paperwidth]{lower separation line head}
    \rule{0pt}{2pt}
  \end{beamercolorbox}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{footline}{
  \begin{beamercolorbox}[wd=\paperwidth]{upper separation line foot}
    \rule{0pt}{2pt}
  \end{beamercolorbox}
  
  \begin{beamercolorbox}[ht=9ex,leftskip=1cm,rightskip=1cm]{footline}%
    \hfill \raisebox{-0.4cm}{\insertfooter}
    \vskip1ex
  \end{beamercolorbox}

  \begin{beamercolorbox}[wd=\paperwidth]{lower separation line foot}
    \rule{0pt}{0pt}
  \end{beamercolorbox}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{block begin}{
  \vskip.75ex
  \begin{beamercolorbox}[leftskip=1cm,colsep*=.75ex]{block title}%
    \usebeamerfont*{block title}\insertblocktitle
  \end{beamercolorbox}%
  {\ifbeamercolorempty[bg]{block body}{}{\nointerlineskip\vskip-0.5pt}}%
  \usebeamerfont{block body}%
  \begin{beamercolorbox}[colsep*=.75ex,sep=.75ex,vmode]{block body}%
    \ifbeamercolorempty[bg]{block body}{\vskip-.25ex}{\vskip-.75ex}\vbox{}%
  }
  \setbeamertemplate{block end}{
  \end{beamercolorbox}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\mode<all>

\def\footer#1{\def\insertfooter{#1}}

% --- my custom blocks
\newcounter{block}
\newcounter{subblock}[block]

\RequirePackage[many]{tcolorbox}

\newtcolorbox{posterblock}[2][]{
    title={
        \refstepcounter{block}
        \tcbox[box align=base,nobeforeafter]{\theblock}
        #2
    },
    fonttitle=\usebeamerfont*{block title},
    colframe=blockTitleColor,
    colback=blockBodyColor,
    coltext=blockBodyTextColor,
    bottom=8pt,
    top=8pt,
    left=8pt,
    right=8pt,
    toptitle=4pt,
    bottomtitle=4pt,
    valign=center,
    #1
}

\newtcolorbox{postersubblock}[1][]{
    title={
        \refstepcounter{subblock}
        \tcbox[box align=base,nobeforeafter]{\Alph{subblock}}
        #1
    },
    fonttitle=\usebeamerfont*{subblock title},
    colframe=subblockTitleColor,
    colback=subblockBodyColor,
    coltext=subblockBodyTextColor,
    bottom=8pt,
    top=8pt,
    left=8pt,
    right=8pt,
    toptitle=4pt,
    bottomtitle=4pt,
}
