\documentclass[aspectratio=169,11pt]{beamer}

% ===== Font compatibility / Compatibilidad de fuentes =====
\usepackage{iftex}
\ifPDFTeX
  \usepackage[utf8]{inputenc}
  \usepackage[T1]{fontenc}
  \usepackage{lmodern}
  \renewcommand{\familydefault}{\sfdefault}
\else
  \usepackage{fontspec}
  \setsansfont{Montserrat}
  \setmainfont{Montserrat}
\fi

% ==== Definition of color palette / Definición de paleta de colores  ====
% Note: We suggest you not to change these colors to maintain the format
% Nota: Le sugerimos que no cambie estos colores para mantener el formato.
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{hyperref}
\definecolor{Primary}{HTML}{B86125} % Primary terracotta / Terracota principal
\definecolor{PrimaryDark}{HTML}{8E3B10} % Dark Terracotta / Terracota oscuro
\definecolor{PrimaryLight}{HTML}{D98B4E} % Light Terracotta / Terracota claro
\definecolor{BannerBlueDark}{HTML}{002060}

\definecolor{Background}{HTML}{DBE2E9} % Primary Background / Fondo principal
\definecolor{BackgroundSoft}{HTML}{EEF2F6} % Secondary Background / Fondo secundario
\definecolor{Text}{HTML}{2E3A45} % Text primary / Texto principal
\definecolor{Card}{HTML}{F8FAFC} % Card / Tarjeta

\definecolor{TextDark}{HTML}{2E3A45} % Text light / Texto principal
\definecolor{TextLight}{HTML}{5A6773} % Text dark / Texto principal

\definecolor{Border}{HTML}{B6C2CD}

% ==== BEAMER COLORS ====
\setbeamercolor{normal text}{fg=TextDark,bg=Background}
\setbeamercolor{frametitle}{fg=PrimaryDark,bg=Background}
\setbeamercolor{title}{fg=PrimaryDark}
\setbeamercolor{subtitle}{fg=TextLight}

\setbeamercolor{block title}{fg=white,bg=Primary}
\setbeamercolor{block body}{bg=Card,fg=TextDark}

\setbeamercolor{alerted text}{fg=PrimaryDark}

% URL stylings
% Enlaces en el mismo tono del título
\usepackage{hyperref}
\hypersetup{colorlinks=true,linkcolor=Primary,urlcolor=Primary}

\usepackage{tikz}
\usepackage{graphicx}
\usetikzlibrary{calc} 
\setbeamertemplate{navigation symbols}{} 

\newcommand{\LeftPanelWidth}{0.63\paperwidth} 
\newcommand{\PanelMargin}{1.2cm}      

% NOTE: IF TEXT EITHER THE TITLE OR SUBTITLE TEXT OVERLAPS
% WITH THE BACKGROUND IMAGES ON THE RIGHT, YOU MAY CHANGE THE
% PERCENTAGE VALUES (FROM ZERO TO ONE) TO ADJUST HOW MUCH WIDTH
% THE TEXT IS ALLOW TO USE (LESS VALUE MAKES THE TEXT USE LESS WIDTH TO THE RIGHT)
\newlength{\LeftW}
\setlength{\LeftW}{0.55\paperwidth}

% THIS IS THE SAME, BUT FOR CONTROLLING THE SECTION SLIDES
\newlength{\LeftWSection}
\setlength{\LeftWSection}{0.45\paperwidth}

\newcommand{\OPTIMATitleSlide}[2]{

\begin{frame}[plain] % Title Slide, no edit
\begin{tikzpicture}[remember picture,overlay]
  \fill[white] (current page.south west) rectangle (current page.north east);
  \draw[Background!65, line width=0.6pt] (current page.south west) rectangle (current page.north east);

  \fill[Background] (current page.north west)
            rectangle ([xshift=\LeftPanelWidth]current page.south west);

  \begin{scope}
    \clip ([xshift=\LeftPanelWidth]current page.north west)
          rectangle (current page.south east);
    \node[anchor=north east,inner sep=0pt] at (current page.north east)
      {\includegraphics[height=\paperheight]{images/campus.png}};
    \fill[white,opacity=0.35] ([xshift=\LeftPanelWidth]current page.north west)
                              rectangle (current page.south east);
  \end{scope}

  \node[anchor=north west, xshift=0.8cm, yshift=-0.7cm] at (current page.north west)
    {\includegraphics[height=1.25cm]{images/ichio.png}};

  \node[
    anchor=west,
    align=left,
    text=Text,
    text width=\dimexpr\LeftW
  ] at ([xshift=-7cm,yshift=-0.7cm]current page.center) {%
    {\bfseries\fontsize{28}{30}\selectfont\textcolor{Primary}{#1}}\par\vspace{0.7em}
    {\Large\bfseries\textcolor{Primary}{#2}}\par
  };

  \node[anchor=south west, xshift=0.8cm, yshift=0.5cm] at (current page.south west)
    {\includegraphics[height=0.6cm]{images/hexaly.png}};
  \node[anchor=south west, xshift=2.8cm, yshift=0.5cm] at (current page.south west)
    {\includegraphics[height=0.6cm]{images/ifors.png}};
  \node[anchor=south west, xshift=4.8cm, yshift=0.5cm] at (current page.south west)
    {\includegraphics[height=0.6cm]{images/ampl.png}};
  \node[anchor=south west, xshift=6.8cm, yshift=0.5cm] at (current page.south west)
    {\includegraphics[height=0.6cm]{images/ciivct.png}};

  \node[anchor=south east, xshift=-1cm, yshift=0.5cm] at (current page.south east)
    {\includegraphics[height=0.75cm]{images/ucnwhite.png}};
\end{tikzpicture}
\end{frame}
}

\newcommand{\OPTIMATitleSlideTwo}[2]{

\begin{frame}[plain] % Title Slide, no edit
\begin{tikzpicture}[remember picture, overlay]
        \node[anchor=north west, inner sep=0pt] at (current page.north west)
            {\includegraphics[width=\paperwidth]{images/campus3.png}}; 
        \fill[white, opacity=0.30]
            (current page.north west) rectangle (current page.south east);
            
        \node[anchor=north west, xshift=0.8cm, yshift=-0.7cm] at (current page.north west)
            {\includegraphics[height=1.25cm]{images/ichio1.png}};
        \node[anchor=north west, xshift=2.8cm, yshift=-0.7cm] at (current page.north west)
            {\includegraphics[height=1.25cm]{images/ucn1.png}};

            
        \node[anchor=north west, xshift=-10cm, yshift=-0.7cm] at (current page.north east)
            {\begin{tikzpicture}
            \fill[Background, opacity=0.70] (-0.01,0) rectangle (11,1); 
            \fill[Background, opacity=0.70] (0,0) -- (-1.5,1) -- (0,1) -- cycle;
            \end{tikzpicture}
            };
        \node[anchor=north west, xshift=-8.5cm, yshift=-0.9cm] at (current page.north east)
            {\includegraphics[height=0.6cm]{images/hexaly.png}};
        \node[anchor=north west, xshift=-6.4cm, yshift=-0.9cm] at (current page.north east)
            {\includegraphics[height=0.6cm]{images/ifors.png}};
        \node[anchor=north west, xshift=-4.3cm, yshift=-0.9cm] at (current page.north east)
            {\includegraphics[height=0.6cm]{images/ampl.png}};
        \node[anchor=north west, xshift=-2.1cm, yshift=-0.9cm] at (current page.north east)
            {\includegraphics[height=0.6cm]{images/ciivct.png}};


        \fill[Background]($(current page.south west)+(0,3.8cm)$)
            rectangle (current page.south east);


        \node[
            anchor=west,
            align=left,
            text=Text,
            text width=\dimexpr\LeftW
          ] at ([xshift=-7cm,yshift=-2.3cm]current page.center) {%
            {\bfseries\fontsize{28}{30}\selectfont\textcolor{Primary}{#1}}\par\vspace{0.7em}
            {\Large\bfseries\textcolor{Primary}{#2}}\par
          };


    \end{tikzpicture}
\end{frame}
}

\newcommand{\OPTIMASectionSlide}[2]{

\begin{frame}[plain] % Section Slide, no edit
\begin{tikzpicture}[remember picture,overlay]
  \fill[white] (current page.south west) rectangle (current page.north east);
  \draw[Background!7, line width=0.6pt] (current page.south west) rectangle (current page.north east);

  \fill[Background] (current page.north west)
            rectangle ([xshift=\LeftPanelWidth]current page.south west);

  \begin{scope}
    \clip ([xshift=0.4]current page.north west)
          rectangle (current page.south east);
    \node[anchor=north east,inner sep=0pt] at (current page.north east)
      {\includegraphics[height=\paperheight]{images/campus2.png}};
    \fill[white,opacity=0.2] ([xshift=0.4]current page.north west)
                              rectangle (current page.south east);
  \end{scope}

  \node[anchor=north west, xshift=0.8cm, yshift=-0.7cm] at (current page.north west)
    {\includegraphics[height=1.25cm]{images/ichio.png}};

  \node[
    anchor=west,
    align=left,
    text=Text,
    text width=\dimexpr\LeftWSection
  ] at ([xshift=-7cm,yshift=-0.7cm]current page.center) {%
    {\bfseries\fontsize{28}{30}\selectfont\textcolor{Primary}{#1}}\par\vspace{0.7em}
    {\Large\bfseries\textcolor{Primary}{#2}}\par
  };

  \node[anchor=south west, xshift=0.9cm, yshift=0.5cm] at (current page.south west)
    {\includegraphics[height=0.6cm]{images/hexaly.png}};
  \node[anchor=south west, xshift=2.9cm, yshift=0.5cm] at (current page.south west)
    {\includegraphics[height=0.6cm]{images/ampl.png}};

  \node[anchor=south east, xshift=-1cm, yshift=0.5cm] at (current page.south east)
    {\includegraphics[height=0.75cm]{images/ucnwhite.png}};
\end{tikzpicture}
\end{frame}
}

% ==== DOCUMENT ====
\begin{document}

% Cover, this slide is left open while people are entering and settling in.
% This first cover slide should not contain the work's title and shouldn't be changed.
\begin{frame}[plain]
\begin{tikzpicture}[remember picture,overlay]
  \fill[Background] (current page.south west) rectangle (current page.north east);
  \draw[Background!65, line width=0.6pt] (current page.south west) rectangle (current page.north east);

  \path let \p1=(current page.north east), \p2=(current page.north west) in
        \pgfextra{\edef\LeftW{0.6\the\paperwidth}}; % 60%
  \fill[Background] (current page.north west) rectangle ([xshift=\LeftW]current page.south west);

  \begin{scope}
    \clip ([xshift=\LeftW]current page.north west)
          rectangle (current page.south east);
    \node[anchor=north east,inner sep=0pt] at (current page.north east)
      {\includegraphics[height=\paperheight]{images/campus.png}};
  \end{scope}

  \node[anchor=north west, xshift=0.8cm, yshift=-0.9cm] at (current page.north west)
    {\includegraphics[height=1cm]{images/ichio.png}};
  \node[anchor=north west, xshift=4cm, yshift=-0.9cm] at (current page.north west)
    {\includegraphics[height=1cm]{images/ucn.png}};

    \node[
      anchor=south west,
      align=left,
      text width=\dimexpr\LeftW
    ] at ([xshift=0.8cm,yshift=2.3cm]current page.south west) {%
      {\bfseries\fontsize{22}{24}\selectfont\textcolor{Primary}{Welcome}}\par\vspace{0.5em}
      {\bfseries\fontsize{8}{10}\selectfont\textcolor{Primary}{XV CONGRESO CHILENO DE INVESTIGACIÓN OPERATIVA}}\par\vspace{0.25em}
      {\fontsize{6}{8}\selectfont\textcolor{Primary}{1--3 December 2025, Coquimbo, Chile}}
    };
    
  \node[anchor=south west, xshift=0.8cm, yshift=0.6cm] at (current page.south west)
    {\includegraphics[height=0.6cm]{images/hexaly.png}};
  \node[anchor=south west, xshift=2.8cm, yshift=0.6cm] at (current page.south west)
    {\includegraphics[height=0.6cm]{images/ifors.png}};
  \node[anchor=south west, xshift=4.8cm, yshift=0.6cm] at (current page.south west)
    {\includegraphics[height=0.6cm]{images/ampl.png}};
  \node[anchor=south west, xshift=6.8cm, yshift=0.6cm] at (current page.south west)
    {\includegraphics[height=0.6cm]{images/ciivct.png}};
\end{tikzpicture}
\end{frame}

% Note: if for some reason you want to remove either the title or subtitles, just leave it blank
% Example: \OPTIMATitleSlide{Slide Title}{} <- No subtitle
% Example 2: \OPTIMATitleSlide{}{Slide subtitle} <- No title
% This applies for all commands

\OPTIMATitleSlide
  {Title}% Edit this text
  {Subtitle}% Edit this text

\OPTIMATitleSlideTwo
  {TITLE}% Edit this text
  {Subtitle}% Edit this text

\OPTIMASectionSlide
  {Section Title}% Edit this text
  {Section subtitle}% Edit this text

\begin{frame}{Title message} % example slide
\begin{itemize}
    \item Body text
\end{itemize}
\end{frame}

% MATH MODE
\begin{frame}{Mathematical model} % example slide using blocks
\begin{block}{Objective Function}
\[
\min_{x} \; \sum_{i=1}^n c_i x_i
\]
\end{block}
\end{frame}


\end{document}
