[Tex/LaTex] Minipage spreading to multiple page

minipagepage-breakingvertical alignment

   \documentclass[12pt]{article}

    \usepackage{graphicx}
    \usepackage[parfill]{parskip}
    \usepackage[none]{hyphenat}
    \sloppy
    \usepackage[usenames,dvipsnames]{xcolor}
    \usepackage{framed}
    \usepackage{tikz}
    \usepackage{array,ragged2e}
    \usepackage{enumitem}
    \usepackage{lipsum}

    % ------------------------------------------------------------------------------------
    % Fonts
    % ------------------------------------------------------------------------------------
    \usepackage{xunicode}
    \usepackage{fontspec}
    \usepackage{xltxtra}
    \usepackage{txfonts}
    % ------------------------------------------------------------------------------------

    \definecolor{shadecolor}{RGB}{217,217,217}  % Color used for highlighting
    \definecolor{light-blue}{RGB}{0,175,236}    % Color for the footer

    % ------------------------------------------------------------------------------------
    % Header and footer management.
    % ------------------------------------------------------------------------------------
    \usepackage{fancyhdr}
    \pagestyle{fancy}

    % clear any old style settings
    \fancyhf{}

    \fancyheadoffset{0in}
    \headheight = 53pt

    \renewcommand{\headrulewidth}{0pt}

    \setmainfont{Calibri}

    % ------------------------------------------------------------------------------------
    % Defining the section style
    \newcommand{\mysectionstyle}[1]{\colorbox{shadecolor}{\begin{tabular}{>{}p{\rectanglelength}}{\fontsize{13}{6}\selectfont\textbf{#1}}\end{tabular}}\vspace{6pt}}
    % ------------------------------------------------------------------------------------

    \addtolength{\footskip}{0.6cm}
    \renewcommand{\footrulewidth}{1pt}
    \renewcommand{\footrule}{{\color{light-blue}%
        \vskip-\footruleskip\vskip-\footrulewidth
        \hrule width\headwidth height\footrulewidth\vskip\footruleskip}}

    % ------------------------------------------------------------------------------------

    \usepackage[left=0.75in,top=1.5in,right=0.75in,bottom=1in]{geometry} % Document margins
    \usepackage{titlesec}

    \newlength{\rectanglelength}
    \setlength{\rectanglelength}{\textwidth}
    \addtolength{\rectanglelength}{-6pt}

    \titlespacing{\paragraph}{%
      0pt}{%              left margin
      0pt}{% space before (vertical)
      0pt}%               space after (horizontal)

    \begin{document}
    \lipsum[1]

            \begin{minipage}{\textwidth}\setlength{\parskip}{4pt}
    %Gray header
    \mysectionstyle{Experiences} % Header Section

%Header Content
    \begin{tabular}{@{}>{\RaggedRight}p{11cm}>{\RaggedLeft}p{6.35cm}@{}}\fontsize{13}{6}\selectfont{LaTeX}&\textbf{2011 to 2012}\end{tabular}\\\begin{tabular}{@{}>{\RaggedRight}p{11cm}>{\RaggedLeft}p{6.35cm}@{}}\textbf{Lead Programmer}&\textbf{}\end{tabular}

%Content
    \vspace{3pt}\begin{itemize}[parsep=0pt, topsep=0pt, itemsep=0pt, leftmargin=2ex]\item \lipsum[1]\item \lipsum[1]\item \lipsum[1]\item \lipsum[1]\item \lipsum[1]\item \lipsum[1]\item \lipsum[1]\item \lipsum[1]\item \lipsum[1]\end{itemize}

%Footer content
    \vspace{7pt}\textbf{End Title} \\\lipsum[1]

    \vspace{10pt}

    \end{minipage}

    \end{document}

I know that i have lots of packages, this is just a part of a bigger file. What i want to avoid is the overlapping of the text in the footer. I want the overlapping content on the next page. I know that samepage could do the job but it doesn't work with the gray header and it only works on parts of the content. For example, the samepage breaks page with all the itemize and keeps the tabular and the header on the previous page. Also, the footer of the content is most of the time alone on the next page and not in the same page of the itemize.

Best Answer

As egreg said, using mdframed solved a part of my problem.

Here is the code i use to do the trick. The mdframed by default puts lines and the text inside is moved inside. So if I just remove the lines, the text is not aligned properly to the rest of the text.

Another problem is that mdframed always put the text on the next page, so it doesn't do any page breaks.

My original problem is that I want unbreakable blocs that can split into the next page if the content is longer than a page.

\documentclass[12pt]{article}

\usepackage{graphicx}
\usepackage[parfill]{parskip}
\usepackage[none]{hyphenat}
\sloppy
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{framed}
\usepackage{tikz}
\usepackage{array,ragged2e}
\usepackage{enumitem}
\usepackage{lipsum}
\usepackage{mdframed}

% ------------------------------------------------------------------------------------
% Fonts
% ------------------------------------------------------------------------------------
\usepackage{xunicode}
\usepackage{fontspec}
\usepackage{xltxtra}
\usepackage{txfonts}
% ------------------------------------------------------------------------------------

\definecolor{shadecolor}{RGB}{217,217,217}  % Color used for highlighting
\definecolor{light-blue}{RGB}{0,175,236}    % Color for the footer

% ------------------------------------------------------------------------------------
% Header and footer management.
% ------------------------------------------------------------------------------------
\usepackage{fancyhdr}
\pagestyle{fancy}

% clear any old style settings
\fancyhf{}

\fancyheadoffset{0in}
\headheight = 53pt

\renewcommand{\headrulewidth}{0pt}

\setmainfont{Calibri}

% ------------------------------------------------------------------------------------
% Defining the section style
\newcommand{\mysectionstyle}[1]{\colorbox{shadecolor}{\begin{tabular}{>{}p{\rectanglelength}}{\fontsize{13}{6}\selectfont\textbf{#1}}\end{tabular}}\vspace{6pt}}
% ------------------------------------------------------------------------------------

\addtolength{\footskip}{0.6cm}
\renewcommand{\footrulewidth}{1pt}
\renewcommand{\footrule}{{\color{light-blue}%
    \vskip-\footruleskip\vskip-\footrulewidth
    \hrule width\headwidth height\footrulewidth\vskip\footruleskip}}

% ------------------------------------------------------------------------------------

\usepackage[left=0.75in,top=1.5in,right=0.75in,bottom=1in]{geometry} % Document margins
\usepackage{titlesec}

\newlength{\rectanglelength}
\setlength{\rectanglelength}{\textwidth}
\addtolength{\rectanglelength}{-6pt}

\global\mdfdefinestyle{myboxstyle}{%
topline=false,rightline=false,bottomline=false,leftline=false,%
leftmargin=-1em,rightmargin=-1em,%
}

\titlespacing{\paragraph}{%
  0pt}{%              left margin
  0pt}{% space before (vertical)
  0pt}%               space after (horizontal)

\begin{document}
\lipsum[1]

        \begin{mdframed}[style=myboxstyle]\setlength{\parskip}{4pt}

\mysectionstyle{Experiences}

\begin{tabular}{@{}>{\RaggedRight}p{11cm}>{\RaggedLeft}p{6.35cm}@{}}\fontsize{13}{6}\selectfont{LaTeX}&\textbf{2011 to 2012}\end{tabular}\\\begin{tabular}{@{}>{\RaggedRight}p{11cm}>{\RaggedLeft}p{6.35cm}@{}}\textbf{Lead Programmer}&\textbf{}\end{tabular}

\vspace{3pt}\begin{itemize}[parsep=0pt, topsep=0pt, itemsep=0pt, leftmargin=2ex]\item \lipsum[1]\item \lipsum[1]\item \lipsum[1]\item \lipsum[1]\item \lipsum[1]\item \lipsum[1]\item \lipsum[1]\item \lipsum[1]\item \lipsum[1]\end{itemize}

\vspace{7pt}\textbf{End Title} \\\lipsum[1]

\vspace{10pt}

\end{mdframed}

\end{document}