\documentclass{article}
\usepackage{fancyhdr,wrapfig,xcolor,graphicx,xparse,lmodern,cooking-units}
\usepackage[%
	papersize={5.5in,8.5in},
	margin=0.6in,
	top=0.75in,
	bottom=0.75in
	]{geometry}

\usepackage[%
	unicode=true,
	bookmarks=true,
	bookmarksnumbered=false,
	bookmarksopen=false,
	breaklinks=false,
	pdfborder={0 0 1},
	backref=section,
	colorlinks=false
	]{hyperref}

\usepackage{fontspec}  \setmainfont{ComicRelief}
   
%	have to define a cup cause the cooking-units writer is german and doesn't understand the flawed american way to measure ingredients.
\declarecookingunit{cup}
\cudefinename {English}
	{
		{cup}   {cup}[cups]
		{oz}    {ounce}[ounces] %  lol, the plural isn't right
	}

\cuaddtokeychain
{
   {ml} {240}    % this unit already exists
   {cup} {1}   % 1 (US Legal) cup is 240ml. We're not converting to oz cause that would require implementing fluid ounces, which is outside the scope of this project. Maybe I'll do good on making a PR for the package.
}
\cuaddtokeychain
{
   {ml}  {30}
   {oz}  {1}
}
\cuaddtounitgroup{volume}{cup}
\cusetup{use-phrases=true}
\cusetoptionfor{g,ml}{round-precision=0}	%	rounds grams to whole numbers, I don't care *that* much

%	Removing the numbers from the sections & sub-sections
\setcounter{secnumdepth}{0}

\newcounter{stepnum}

\makeatletter

\def\plus{\texttt{+}\hspace{.3em}}
\def\minus{\texttt{-}\hspace{.3em}}

%% From Donald Arseneau. Add after the wrapping text. Whew!
\def\wrapfill{% Just glad it works.
   \par
   \ifx\parshape\WF@fudgeparshape
   \nobreak
   \ifnum\c@WF@wrappedlines>\@ne
      \advance\c@WF@wrappedlines\m@ne
      \vskip\c@WF@wrappedlines\baselineskip
      \global\c@WF@wrappedlines\z@
   \fi
   \allowbreak
   \WF@finale
   \fi
}


%% Used for the headnote and in \showit
%% If the text is small it is placed on one line;
%% otherwise it is put into a raggedright paragraph.
\long\def\testoneline#1{%
  \sbox\@tempboxa{#1}%
  \ifdim \wd\@tempboxa <0.75\linewidth
		\begingroup
			\itshape
			#1\par
		\endgroup
  \else
	\parbox{0.75\linewidth}{\raggedright\itshape#1}%
	\par
  \fi
}

\title{Recipes}
\author{The Entity}
\date{\tiny{last updated \today}}

%% Borrowed from book.cls
\newif\if@mainmatter \@mainmattertrue

\newcommand\frontmatter{%
	\cleardoublepage
	\@mainmatterfalse
	\pagenumbering{roman}
	\tableofcontents
   }

\newcommand\mainmatter{%
	\cleardoublepage
	\@mainmattertrue
	\pagenumbering{arabic}}
\makeatother

%% Vary the colors at will

\definecolor{vegcolor}{rgb}{0,0.5,0.2}
\colorlet{gfcolor}{brown}
\definecolor{frzcolor}{rgb}{0,0.8,0.8}
\definecolor{dessertcolor}{rgb}{0.5,0.2,0.1}
\definecolor{mealprepcolor}{rgb}{0.5,0.5,0.6}

%% Thanks to alephzero for the excellent start:
%% #1 [optional headnote]; #2 Title of recipe; #3 [optional initial instructions]
\NewDocumentCommand{\recipe}{o m o}{%
	\setcounter{stepnum}{0}%
	\newpage
	\thispagestyle{fancy}
	\lhead{}%
	\chead{}%
	\rhead{}%
	\lfoot{}%
	\rfoot{}%
	\subsection{#2}%
	\IfNoValueF{#1}{\begin{center}\testoneline{#1}\end{center}}
	\IfNoValueF{#3}{\noindent\emph{#3}\par\medskip}
}

\newcommand{\serves}[2][Serves]{%
	\chead{#1 #2}}
\newcommand{\dishtype}[1]{%
	\rhead{#1}%
}
\newcommand{\dishother}[1]{%
	\lhead{#1}%
}
\newcommand{\vegetarian}{%
	{\large\color{vegcolor}\textbf{V}}%
}
\newcommand{\glutenfree}{%
	{\large\color{gfcolor}\textbf{GF}}%
}
\newcommand{\freeze}{%
	{\large\color{frzcolor}\textbf{F}}%
}
\newcommand{\dessert}{%
	{\large\color{dessertcolor}\textbf{D}}%
}
\newcommand{\mealprep}{%
	{\large\color{mealprepcolor}\textbf{MP}}%
}

%% Optional arguments for alternate names for these:
\newcommand{\preptime}[2][Prep time]{%
	\lfoot{#1: #2}%
}
\newcommand{\cooktime}[2][Cook time]{%
	\rfoot{#1: #2}%
}
%% Optional argument is the width of the graphic, default = 1in
\newcommand{\showpic}[3][1in]{%
	\begin{center}
		\bigskip
			\includegraphics[width=#1]{#2}%
			\par
			\medskip
			\testoneline{#3}%
			\par
	\end{center}%
}

\NewDocumentEnvironment{step}{}{%
	\parindent0pt
	\leftskip0pt
	\begin{minipage}{\textwidth}
		\begin{wrapfigure}{r}{0pt}
			\kern-0.5em
			\vrule width 1pt\enskip
			\begin{minipage}{0.5\textwidth}
				\leftskip=1.5em
				\parindent=-1.5em
				\parskip=0.25em
				\obeylines
}{%
		\wrapfill
	\end{minipage}
	\medskip
}

\NewDocumentCommand{\method}{}{%
			\end{minipage}
		\end{wrapfigure}
		\rightskip0pt plus 2em
		\parskip0.25em
		\everypar={\llap{\stepcounter{stepnum}\hbox to 1.5em{\thestepnum.\hfill}}}
}


\pagestyle{plain}
\setlength{\intextsep}{0pt}

% Different layout for Drinks that adds an hline at the end of a recipe, no serving amounts, no prep/cook time, no letters in the corner
%% #1 [optional headnote]; #2 Title of recipe; #3 [Initial instructions]
\NewDocumentCommand{\drink}{o m o}{%
	\setcounter{stepnum}{0}%
	\thispagestyle{fancy}
	\lhead{}%
	\chead{}%
	\rhead{}%
	\lfoot{}%
	\rfoot{}%
   \renewcommand{\headrulewidth}{0pt}
	\subsection{#2}%
	\IfNoValueF{#1}{\begin{center}\testoneline{#1}\end{center}}
	\IfNoValueF{#3}{\noindent\emph{#3}\par\medskip}
}

\NewDocumentCommand{\drinkspace}{}{%
  \par
  \bigskip
  \filbreak
  \hrulefill
  \smallskip
}

\NewDocumentEnvironment{drstep}{}{%
	\parindent0pt
	\leftskip0pt
	\begin{minipage}{\textwidth}
		\begin{wrapfigure}{r}{0pt}
			\kern-0.5em
			\vrule width 1pt\enskip
			\begin{minipage}{0.5\textwidth}
				\leftskip=1.5em
				\parindent=-1.5em
				\parskip=0.25em
				\obeylines
}{%
		\wrapfill
	\end{minipage}
	\medskip
}

\NewDocumentCommand{\drmethod}{}{%
			\end{minipage}
		\end{wrapfigure}
		\rightskip0pt plus 2em
		\parskip0.25em
		\everypar={\llap{\stepcounter{stepnum}\hbox to 1.5em{\thestepnum.\hfill}}}
}

\begin{document}
\pagenumbering{gobble}
\maketitle

\frontmatter

\mainmatter

\input{BlackenedMuddySiredon.tex}
\input{ChefTonberrys.tex}
\input{RockRootStew.tex}
\input{SauteedMandragona.tex}
\pagebreak
\section{Tarutaru Trifle}
\textit{This dessert is a whimsical, layered trifle presented in a small crystal glass, symbolizing the noble elegance of San d'Oria, with playful elements representing the cute and mischievous nature of the Tarutaru.}\smallskip

Assembly:\\
Prepare small crystal glasses or dessert bowls for serving.\\
Layer 1: Add a generous spoonful of almond sable crumble as the base.\\
Layer 2: Pour a layer of Chocobo egg custard over the crumble.\\
Layer 3: Add small cubes of the honey-soaked Elvaan cake.\\
Layer 4: Spoon a layer of the berry compote on top to mimic the red Tarutaru hat.\\
Layer 5: Pipe or spoon the whipped cream over the berry compote, shaping it into soft peaks to resemble the Tarutaru's face.\\
Layer 6: Gently place the meringue ears on top of the whipped cream.\medskip

Garnish:\\
Sprinkle shaved white chocolate over the whipped cream for a snowy, regal touch.
Scatter miniature sugar stars across the top for a magical, starry finish.
If desired, place a tiny edible flag with the San d'Orian crest in the whipped cream.\medskip

Presentation:\\
Serve each trifle in its crystal goblet with the meringue ears peeking out and the whipped cream shaped into soft peaks. The edible flag and sugar stars add a playful, magical touch, perfect for a dessert inspired by the world of Final Fantasy! ChatGPT can suck my nuts, you either use metric or imperial. I (David) personally guarantee this recipe would suck.

\input{1-Crumble.tex}
\input{2-Custard.tex}
\input{3-Cake.tex}
\input{4-Compote.tex}
\input{5-Cream.tex}
\input{6-Meringue.tex}
\end{document}
