\providecommand\pdfauthor{}
\renewcommand{\pdfauthor}[1]{\pdfstringdef\@pdfauthor{#1}}
\newcommand{\pdftitle}[1]{\pdfstringdef\@pdftitle{#1}}

% Section/Subsection utilise page 3
\pgfdeclareimage[height=\paperheight,width=\paperwidth]{background_page_3}{n_fond_page_3}

\setbeamercolor*{section title}{fg=white}
\setbeamercolor*{subsection title}{fg=Vert}

\newcommand{\sectionframe}[1]{%
  \begin{frame}[background=page_3,t]
    \vbox{}%
    \vskip-0.41em%
    \vskip4.2em%
    \begin{beamercolorbox}[sep=8pt,center,leftskip=3cm]{section title}%
      \usebeamerfont{title}%
      \noindent\insertsection\par%
    \end{beamercolorbox}%
    \vskip1.5em%
    \begin{beamercolorbox}[sep=8pt,center,leftskip=3cm]{subsection title}%
      \leavevmode\leftskip=1.5em\raise0.2ex\hbox{}\kern1ex{}\par%
      \tableofcontents[sectionstyle=hide/hide,subsectionstyle=show/#1/hide]%
    \end{beamercolorbox}
  \end{frame}
}

\AtBeginSection{%
  \sectionframe{show}
}

\AtBeginSubsection{%
  \sectionframe{shaded}
}
