%% -*- coding: utf-8 -*-
%% Timestamp: "2025-11-10 01:30:00 (ywatanabe)"
%% File: ./00_shared/latex_styles/dark_mode.tex
%% Description: Dark mode styling for scientific manuscripts

%% Dark mode configuration
%% Background: Monaco/VS Code editor (#1E1E1E)
%% Text: VS Code default foreground (#D4D4D4)
%% Figures: unchanged (preserve original colors)

% Set page and text colors - matches Monaco/VS Code dark theme
\definecolor{MonacoBg}{HTML}{1E1E1E}
\definecolor{MonacoFg}{HTML}{D4D4D4}
\pagecolor{MonacoBg}
\color{MonacoFg}

% Link text colors for dark mode (colorlinks=true)
\definecolor{DarkGreen}{HTML}{90C695}     % Internal links (Figure/Table): muted sage
\definecolor{DarkCyan}{HTML}{87CEEB}      % Citations/references: sky blue
\definecolor{DarkOrange}{HTML}{DEB887}    % External URLs: burlywood

% Hyperlink colors set via hypersetup (injected after \begin{document})

% Override hlref colorbox for dark mode (no yellow box on dark background)
\renewcommand{\hlref}[1]{%
  \ifnum\getrefnumber{#1}=0
    {\color{DarkGreen}\ref*{#1}}%
  \else
    \ref{#1}%
  \fi
}

% Section titles: same color as body text, just bold
\titleformat{\section}
  {\normalfont\Large\bfseries\color{MonacoFg}}{\thesection}{1em}{}
\titleformat{\subsection}
  {\normalfont\large\bfseries\color{MonacoFg}}{\thesubsection}{1em}{}
\titleformat{\subsubsection}
  {\normalfont\normalsize\bfseries\color{MonacoFg}}{\thesubsubsection}{1em}{}

% Caption labels: same as body text, left-aligned
\captionsetup{
  labelfont={bf,color=MonacoFg},
  textfont={color=MonacoFg},
  justification=raggedright,
  singlelinecheck=false
}

% Adjust table colors for dark mode
\definecolor{lightgray}{gray}{0.2}  % Darker "light" gray for table rows

% Override color commands to work well in dark mode
\renewcommand{\REDENDS}{\color{white}}    % Reset to white instead of black
\renewcommand{\GREENENDS}{\color{white}}  % Reset to white instead of black

% Adjust highlight boxes for dark mode
\newtcbox{\darkgreenhighlight}[1][]{on line,colframe=green!70!white,colback=green!20!black,boxrule=0pt,arc=0pt,boxsep=0pt,left=1pt,right=1pt,top=2pt,bottom=2pt,tcbox raise base}
\newtcbox{\darkredhighlight}[1][]{on line,colframe=red!70!white,colback=red!20!black,boxrule=0pt,arc=0pt,boxsep=0pt,left=1pt,right=1pt,top=2pt,bottom=2pt,tcbox raise base}

% Adjust soul highlighting for dark mode
\sethlcolor{yellow!30!black}  % Darker yellow highlight

%%%% EOF
