%% ****************************************************************
%%    Copyright 2024 by latexstudio-xmyphys <latexstudio.net>     *
%%                                                                *
%%    The Current Maintainers of this work is latexstudio-xmyphys *
%%                                                                *
%%    This work consists of the files Sciexplor.cls               *
%% ****************************************************************
% \def\Sciexplor@date{2024/07/21}
% \def\Sciexplor@version{V1}
% 
% \ProvidesExplClass {Sciexplor} {\Sciexplor@date} {\Sciexplor@version}
%   {Template for GLOBA by latexstudio-xmyphys}
% \ProvidesClass{Sciexplor}[Template for GLOBA 20240721 V1 by latexstudio-xmyphys]
\ProvidesClass{Sciexplor}[Template for GLOBA 20240721 V1 by latexstudio_xmyphys]

\LoadClass[twoside]{article}

\RequirePackage{etoolbox}

\RequirePackage{fontspec}
\setsansfont[Extension = .ttf, BoldFont = Noto Sans Hebrew SemiBold, AutoFakeSlant]
  {NotoSansHebrew_SemiCondensed-ExtraLight}
% \setmainfont[Extension = .ttf]{Judson-Regular}
\setmainfont[Extension = .ttf, BoldFont = Noto Sans Hebrew SemiBold, AutoFakeSlant]
  {NotoSansHebrew_SemiCondensed-ExtraLight}

% \RequirePackage{mathptmx}
% \RequirePackage[OT1]{fontenc}
\RequirePackage{fontsize}
\changefontsize[10pt]{9pt}

\RequirePackage[labelsep=period, justification=raggedright, singlelinecheck=false, labelfont={sf, bf}, font = small]{caption}

\RequirePackage{amsmath,hyperref,cleveref,anyfontsize}
\hypersetup{hidelinks, colorlinks,  citecolor   = urlcolor,
            linkcolor = urlcolor,   pdfpagemode = UseOutlines}
\crefname{figure}{\textcolor{urlcolor}{Figure}}{\textcolor{urlcolor}{Figure}}
\crefname{table}{\textcolor{urlcolor}{Table}}{\textcolor{urlcolor}{Table}}
\crefname{equation}{equation}{equation}
\numberwithin{equation}{section}

\RequirePackage{xcolor,array,booktabs,enumitem}
\setlist[itemize,1]{leftmargin=2.5em,labelsep=2em,itemsep=0em}
\setlist[enumerate,1]{leftmargin=1.75em,labelsep=1em,itemsep=0em,label=\arabic*)}
\setlist[enumerate,2]{leftmargin=-.25em,labelsep=.5em,itemsep=0em,label=(\alph*)}

\RequirePackage{tikz,fancyhdr,geometry,tabularx,lastpage}
\RequirePackage{calc}

\def\Gmt@restore{}
\apptocmd\Gm@savelength{%
  \g@addto@macro\Gmt@restore{\global\expandafter\noexpand\expandafter\csname
  #1\endcsname\expandafter=\expandafter\the\csname #1\endcsname\relax}}{}{}
\patchcmd{\@outputpage}{\global \@colht \textheight}{\Gmt@restore@pkg \global \@colht \textheight}{}{} 
\newgeometry{top=.93in,bottom=1.07in,left=.9in,right=.9in,headsep=12pt,headheight=16.8pt}
\savegeometry{standard}

\edef\Gmt@restore@pkg{\Gmt@restore
\global\expandafter\let\expandafter\noexpand\expandafter\Gmt@restore@pkg\noexpand\empty}%
\newgeometry{top=1.78in,bottom=.42in,left=.9in,right=.9in,headsep=.87in,headheight=1in,headsep = .54in, footskip = 6pt}
\savegeometry{title}

\loadgeometry{standard}

\newlength{\headruleleft}
\setlength{\headruleleft}{(\paperwidth-\textwidth)/2}
\newlength{\headruletop}
\setlength{\headruletop}{(\paperheight-\textheight)/2-\headheight}
\setlength{\parindent}{0em}
\setlength{\headheight}{30pt}

\RequirePackage{titlesec}
% \titleformat{\section}{\large\bfseries}{\arabic{section}.}{.75ex}{}
% \titleformat{\subsection}{\bfseries}{\thesubsection}{.75ex}{}

\RequirePackage{lettrine}
\let\LettrineTextFont\relax

% \RequirePackage[framemethod=TikZ]{mdframed}

\RequirePackage{keyval}
\define@key{articleset}{firstrhead}{\gdef\@firstrhead{#1}}
\define@key{articleset}{articletype}{\gdef\@articletype{#1}}
\define@key{articleset}{title}{\title{#1}}
\define@key{articleset}{author}{\author{#1}}
\define@key{articleset}{affliction}{\gdef\@affliction{#1}}
\define@key{articleset}{correspond}{\gdef\@correspond{#1}}
\define@key{articleset}{citation}{\gdef\@citation{#1}}
\define@key{articleset}{received}{\gdef\@received{#1}}
\define@key{articleset}{revised}{\gdef\@revised{#1}}
\define@key{articleset}{accepted}{\gdef\@accepted{#1}}
\define@key{articleset}{published}{\gdef\@published{#1}}
\define@key{articleset}{lhead}{\gdef\@lhead{#1}}
\define@key{articleset}{rhead}{\gdef\@rhead{#1}}
\define@key{articleset}{copyright}{\gdef\@copyright{#1}}
\define@key{articleset}{website}{\gdef\@website{#1}}

\def\articleset#1{\setkeys{articleset}{#1}}

\RequirePackage{setspace}

\ExplSyntaxOn
\catcode`\ =10
\clist_new:N \l_@@_author_clist
\renewcommand*\maketitle
  {
    \loadgeometry{title}
    \fancypagestyle{firststyle}{
    \fancyhf{}
    % \ifcsname @firstrhead\endcsname
    %   \rhead
    %     { %\fontspec{Alibaba-PuHuiTi-Regular.ttf}\selectfont
    %       \@rhead\@firstrhead }
    % \else
    %   \rhead{}
    % \fi
    \rhead{\includegraphics[height = 2.5em]{page1-2-trimmed}}
    \lhead{\includegraphics[height = 2.5em]{logo}}
    \ifcsname @copyright\endcsname
      \lfoot{ \raisebox{.5em}{\small\bfseries\color{headrulecolor}\@copyright} }
    \fi
    \ifcsname @website\endcsname
      \rfoot{ \includegraphics[height = 1.5em]{\@website}\quad}
    \fi
    }
    \begin{figure}[b]
      \linespread{1.2}
      \noindent\parbox{\dimexpr\linewidth-2\fboxsep-2\fboxrule\relax}
        {\footnotesize  \sffamily
          \lettrine[ lines = 2, nindent = 0em ]
          {\includegraphics[ height = 1.75ex, width = 4.5ex ]{page1-1}~}
          {\copyright} \textbf{The Author(s) 2025.}
          This is an Open Access article licensed under a Creative Commons Attribution 4.0 International License
          (\url{https://creativecommons.org/licenses/by/4.0/}), which permits
          unrestricted use, sharing, adaptation, distribution and reproduction
          in any medium or format, for any purpose, even commercially, as long
          as you give appropriate credit to the original author(s) and the
          source, provide a link to the Creative Commons license, and indicate
          if changes were made.}%
    \end{figure}
    \tikz[remember~picture,overlay]
      {
        \ifcsname @articletype\endcsname
          \node [ below~right, black, inner~xsep = 0pt ] at
            ([shift = {(\headruleleft,-1.32in)}]current~page.north~west)
            {%
              \sffamily \fontsize{10.5}{10} \selectfont \bfseries
              \textcolor{red}{Open Access}~\@articletype
            };
        \fi
        \node [ below~left, inner~sep = 0pt ] at
          ([shift = {(-\headruleleft,-1.32in)}]current~page.north~east)
          {
            \href{https://crossmark.crossref.org/dialog?doi=10.70401/ec.2025.0002\&domain=pdf}
            {\includegraphics[height = 2.5em]{page1-3}}
          };
    }
    \parbox[l]{\linewidth}
    {
      % \linespread{1.35} \bfseries \sffamily
      % \fontspec{Alibaba-PuHuiTi-Regular.ttf}\selectfont
      \bfseries \sffamily
      \fontsize{20}{10}\selectfont\@title
    }
    % \vskip4.5ex
    \vskip .5\baselineskip
    % \setstretch{1.2}
      \ifcsname @author\endcsname
      {\sffamily \fontsize{9}{10}\selectfont
        \clist_set:Ne \l_@@_author_clist { \@author }%
        \int_step_inline:nn{\clist_count:N\l_@@_author_clist}%
          {%
            \int_if_even:nTF {##1}
              {%
                \textsuperscript{\clist_item:Nn \l_@@_author_clist {##1}}%
                \int_compare:nNnF {##1}={\clist_count:N\l_@@_author_clist}{,~}%
              }
              {\clist_item:Nn \l_@@_author_clist {##1}}%
          }
      }
    \fi
    \vskip .5\baselineskip
    \fancyhead[OL]{}
    \fancyhead[ER]{}
    % \ifcsname @rhead\endcsname
    %   \fancyhead[OR]
    %     {\rule[-2ex]{0pt}{2ex}\small%\fontspec{Alibaba-PuHuiTi-Regular.ttf}\selectfont
    %     \sffamily \fontsize{7.5}{10}\selectfont\@rhead}
    % \else
    %     \fancyhead[OR]{}
    % \fi
    \fancyhead[R]{\sffamily \fontsize{7.5}{10}\selectfont Page \thepage\ of \pageref*{LastPage}}
    \ifcsname @lhead\endcsname
      \fancyhead[L]
        {
          \rule[-6pt]{0pt}{0pt}
          %\fontspec{Alibaba-PuHuiTi-Regular.ttf}\selectfont
          \sffamily \fontsize{7.5}{10}\selectfont\@lhead
        }
    \else
        \fancy[EL]{}
    \fi
    \cfoot{}
    \pagestyle{fancy}
    \sffamily
    \ifcsname @affliction\endcsname
        % \vskip1.5ex
        \fontsize{8}{8}\selectfont\@affliction
    \fi
    % \setstretch{1}
    \vskip .3\baselineskip
    \ifcsname @correspond\endcsname
      \textbf{*Correspond to:}~\@correspond
    \fi
    % \vskip1.5ex
    \vskip .3\baselineskip
    \ifcsname @received\endcsname
        \textbf{Received:}~\@received
    \fi\
    \ifcsname @revised\endcsname
        \textbf{Revised:}~\@revised
    \fi\
    \ifcsname @accepted\endcsname
        \textbf{Accepted:}~\@accepted
    \fi\
    \ifcsname @published\endcsname
        \textbf{Published:}~\@published
    \fi
    % \vskip1ex
    \vskip .3\baselineskip
    \ifcsname @citation\endcsname
        % \vskip1.5ex
        \textbf{Cite this article:}~\@citation
    \fi
    \thispagestyle{firststyle} \normalfont
    \def\headrulewidth{1.5pt}
    \definecolor{headrulecolor}{HTML}{285EA7}
    \let\tmp@headrule\headrule
    \def\headrule{\color{headrulecolor}\tmp@headrule}
}
\ExplSyntaxOff

\RequirePackage{xcolor}
% \definecolor{abstractback}{HTML}{CAE7F0}

\renewenvironment{abstract}{
  \vskip \baselineskip
  \setlength \parskip {0pt}%
  % \begin{mdframed}
  %   [innerleftmargin=1ex,innerrightmargin=1ex,linewidth=0pt,backgroundcolor=abstractback,roundcorner=1em]
  %   \fontsize{10.5}{10}\textbf{Abstract}\par\fontsize{8}{10}\selectfont
  \sffamily \fontsize{10.5}{10}\textbf{Abstract}\par\sffamily \fontsize{8}{10}\selectfont
}{%
  \vskip .3\baselineskip
  % \end{mdframed}
}
\newcommand \keywords[1]{\vskip.3\baselineskip \textbf{Keywords:} #1}

\let\OLDthebibliography\thebibliography
\renewcommand\thebibliography[1]{
  \OLDthebibliography{#1}
  \setlength{\parskip}{0pt}
  \setlength{\itemsep}{0ex}
}
\let\tmp@bibliography\bibliography
\def\bibliography#1{\begingroup
\renewcommand\section[2]{\vspace{-1em}}
\tmp@bibliography{#1}
\endgroup}

\RequirePackage{cite}
\def\@cite#1#2{\textsuperscript{[{#1\if@tempswa , #2\fi}]}}

\RequirePackage{soul}
\setulcolor{blue}
% \def\url#1{\begingroup\color{blue}\ul{#1}\endgroup}
\definecolor{urlcolor}{HTML}{2F6EBA}
\def\url#1{\begingroup\color{urlcolor}#1\endgroup}

\RequirePackage{graphicx}
\graphicspath{{./figure/}{./figures/}{./image/}{./images/}{./graphics/}{./graphic/}{./pictures/}{./picture/}}

%\titleformat{\section}{\large\bfseries}{Appendix~\Alph{section}.}{.75ex}{}
% \def\@seccntformat#1{\@ifundefined{#1@cntformat}%
%    {\csname the#1\endcsname\quad}%   default
%    {\csname #1@cntformat\endcsname}% enable individual control
% }
\def\@seccntformat#1{\@ifundefined{#1@cntformat}%
   {\csname the#1\endcsname\hspace{1ex}}%   default
   {\csname #1@cntformat\endcsname}% enable individual control
}
\renewcommand\appendix{\par%
  \setcounter{section}{0}%
  \setcounter{subsection}{0}%
  \gdef\thesection{\@Alph\c@section}%
  \titleformat{\section}{\large\bfseries}{Appendix~\Alph{section}.}{.75ex}{}
}

\renewcommand{\@biblabel}[1]{\textsf{ #1.}}

% \renewcommand\section{\@startsection {section}{1}{\z@}%
% {-3.5ex \@plus -1ex \@minus -.2ex}%
% {1.8ex \@plus.2ex}%
% {\vspace{-1ex}\normalfont\normalsize\bfseries}}
% \renewcommand\section{
%   \@startsection {section}{1}{\z@}%
%     {\baselineskip}%
%     {.01\p@}%
%     {\sffamily \fontsize{10.5}{10}\selectfont\bfseries}
% }
\titleformat{\section}{\bfseries\fontsize{10.5}{10}\selectfont}{\thesection}{1ex}{}
\titlespacing{\section}{0pt}{\baselineskip}{0pt}
\long \def \thesection {\@arabic \c@section.}
\long \def \thesubsection {\thesection \@arabic \c@subsection }
\renewcommand\subsection{\@startsection {subsection}{2}{\z@}%
{.01\p@}%
{.01\p@}%
{\sffamily \fontsize{9}{10}\selectfont\bfseries}}

\renewcommand\subsubsection{\@startsection {subsubsection}{3}{\z@}%
{.01\p@}%
{.01\p@}%
{\sffamily \fontsize{9}{10}\selectfont\bfseries}}
\setlength \parskip {.5\baselineskip}

\newcommand \captionalt[1] {\caption*{#1}\vspace*{-2\baselineskip}}
%%
%% End of file `globisci.cls'.