\def\modele@andromede{andromede}
\def\cv@h@andromede{2}

% =============== FOND ===============

\newcommand*\fond@andromede{%
	% dégradé bas
	\fill[draw=white,right color=\cmdPAS@bg@bgcolor!30,left color=white] (22,-28) -- (0,-28) -- (0,-27.5) -- (18,-27.5) .. controls (20,-27.5) and (21,-27) .. (22,-25.5) -- cycle;
	% traits verticaux à gauche
	\draw[\cmdPAS@bg@bordercolor] (1,0) -- (1,-\paperheight);
	\draw[gray] (1.25,0) -- (1.25,-\paperheight);
	% Dégradé haut 1
	\fill[left color=white,right color=\cmdPAS@bg@bgcolor!30] (.5\paperwidth,0) rectangle +(13,-\cv@h@andromede);
	% Liseret épais horizontal 2
	\fill[left color=\cmdPAS@bg@bgcolor,right color=\cmdPAS@bg@bgcolor!40,] (0,-\cv@h@andromede) rectangle +(22,-.25);
	% dégradé 3
	\fill[left color=\cmdPAS@bg@bgcolor,right color=\cmdPAS@bg@bgcolor!10] (0,-\cv@h@andromede-.25) -- (23,-\cv@h@andromede-.25) -- (23,-\cv@h@andromede-1.75) -- (.75\paperwidth,-\cv@h@andromede-1.75) -- (.72\paperwidth,-\cv@h@andromede-2.25) -- (0,-\cv@h@andromede-2.25) -- cycle;
	% parallélogramme
	\fill[\cmdPAS@bg@bgcolor] (.75\paperwidth,-\cv@h@andromede-1.75) -- (.72\paperwidth,-\cv@h@andromede-2.25) -- (.82\paperwidth,-\cv@h@andromede-2.25) -- (.85\paperwidth,-\cv@h@andromede-1.75);
	% trapèze haut droite
	\fill[\cmdPAS@bg@bordercolor] (23,-\cv@h@andromede-1.75) -- (.85\paperwidth,-\cv@h@andromede-1.75) -- (.82\paperwidth,-\cv@h@andromede-2.25) -- (0,-\cv@h@andromede-2.25) -- (0,-\cv@h@andromede-2.5) -- (23,-\cv@h@andromede-2.5) -- cycle;
	% dégradé 4
	\fill[draw=white,left color=\cmdPAS@bg@bgcolor!30,right color=white] (0,-\cv@h@andromede-2.5) -- (\paperwidth,-\cv@h@andromede-2.5) -- (\paperwidth,-\cv@h@andromede-3) -- (4,-\cv@h@andromede-3) .. controls (2,-\cv@h@andromede-3) and (1,-\cv@h@andromede-3.5) .. (0,-\cv@h@andromede-5) -- cycle;
	% Photo
	\ifx\cmdPAS@bg@pic\@empty%
	\else
		\ifx\cmdPAS@bg@borderpic\@empty
			\node[above right] (photo) at (1.4,-\cv@h@andromede-2.25) {\includegraphics[scale=\cmdPAS@bg@scalepic]{\cmdPAS@bg@pic}};
		\else
			\node[above right,draw=\cmdPAS@bg@borderpic,very thick,inner sep=1pt] (photo) at (1.4,-\cv@h@andromede-2.25) {\includegraphics[scale=\cmdPAS@bg@scalepic]{\cmdPAS@bg@pic}};
		\fi
	\fi
	\node[color=\cmdPAS@bg@postecolor,above left] at (21,-\cv@h@andromede) {\scshape\cmdPAS@bg@postesize\bfseries\cmdPAS@bg@poste};
}

%=============== INFO GAUCHE ===============
\newcommand*\infoLeft@andromede[1]{%
	\AddToShipoutPicture{%
		\begin{tikzpicture}
			\clip (0,0) rectangle+(\paperwidth,-\paperheight);
			\ifx\cmdPAS@bg@pic\@empty%
				\coordinate (infoLeft) at (1.5,-\cv@h@andromede+.5);
			\else
				\coordinate (infoLeft) at ($(photo.north east)+(0.25,0)$);
			\fi
			\node[below right] at (infoLeft){\begin{minipage}{15cm}#1\end{minipage}};
		\end{tikzpicture}
	}
}

%=============== INFO DROITE ===============
\newcommand*\infoRight@andromede[1]{%
	\AddToShipoutPicture
	{%
		\FPeval\resultat{clip(round(842-28.346456693*(\cv@h@andromede+4.55),2))}
		\put(\LenToUnit{0pt},\LenToUnit{\resultat pt})
		{
			\begin{minipage}{\paperwidth} 																\begin{flushright}#1\end{flushright} 
			\end{minipage}
		}
	}
}

%=============== TITRE ===============
\newcommand*\title@andromede[1]{%
	\noindent
	\begin{tikzpicture}
		\fill[\cmdPAS@title@bordercolor] (0,0) -- (.25,.25) -- (.75,.25) -- (.75,0) -- cycle;
		\node[right,text=\cmdPAS@title@color] at (1,0.1) {#1};
	\end{tikzpicture}
}

%=============== MARGES ===============
\newcommand*\margins@andromede{%
\FPeval\result{clip(\cv@h@andromede+3.5)}
\newgeometry{tmargin=\result cm,bmargin=2cm,lmargin=1.7cm,rmargin=1.5cm}
}

%=============== CLEARPAGE ===============
\newcommand*\clearpage@andromede{%
	% dégradé bas
	\fill[draw=white,right color=\cmdPAS@bg@bgcolor!30,left color=white] (22,-28) -- (0,-28) -- (0,-27.5) -- (18,-27.5) .. controls (20,-27.5) and (21,-27) .. (22,-25.5) -- cycle;
	% traits verticaux à gauche
	\draw[\cmdPAS@bg@bordercolor] (1,0) -- (1,-\paperheight);
	\draw[gray] (1.25,0) -- (1.25,-\paperheight);
}
\newcommand*\clearmargins@andromede{%
	\newgeometry{tmargin=1.5cm,bmargin=2cm,lmargin=1.7cm,rmargin=1.5cm}
}
