/* CSS VARIABLES FOR LIGHT THEME (DEFAULT) */
/* These variables define colors for the light theme */
:root {
  --bg-color: #fff;                    /* Background color (white) */
  --text-color: #070000;               /* Main text color (almost black) */
  --heading-color: #222;               /* Main heading color (dark gray) */
  --heading-2-color: #393939;          /* Secondary heading color */
  --heading-3-color: #494949;          /* Tertiary heading color */
  --link-color: #800000;               /* Link color (maroon) */
  --link-hover-color: #600000;         /* Link color when hovering (darker maroon) */
  --border-color: #800000;             /* Border color (light gray) */
  --code-bg: #f8f8f8;                  /* Code background color (very light gray) */
  --code-color: #333;                  /* Code text color */
  --header-bg: #f4f4f4;                /* Header background color */
  --header-border: #e0e0e0;            /* Header border color */
  --strong-color: #222;                /* Bold text color */
  --dt-color: #444;                    /* Definition term color */
  --collapse-hover: #ad95ae;           /* Collapse button hover color (purple-ish) */
}

/* CSS VARIABLES FOR DARK THEME */
/* When dark mode is active, these color values replace the light theme colors */
[data-theme="dark"] {
  --bg-color: #1a1a1a;                 /* Background color (very dark gray) */
  --text-color: #e0e0e0;               /* Main text color (light gray) */
  --heading-color: #f0f0f0;            /* Main heading color (very light gray) */
  --heading-2-color: #d0d0d0;          /* Secondary heading color */
  --heading-3-color: #c0c0c0;          /* Tertiary heading color */
  --link-color: #c08080;               /* Link color (light maroon/rose) */
  --link-hover-color: #d09090;         /* Link color when hovering (lighter rose) */
  --border-color: #404040;             /* Border color (medium gray) */
  --code-bg: #2a2a2a;                  /* Code background color (dark gray) */
  --code-color: #e0e0e0;               /* Code text color (light gray) */
  --header-bg: #252525;                /* Header background color */
  --header-border: #404040;            /* Header border color */
  --strong-color: #f0f0f0;             /* Bold text color */
  --dt-color: #d0d0d0;                 /* Definition term color */
  --collapse-hover: #8b6f8d;           /* Collapse button hover color */
}

body {
  background-color: var(--bg-color);
  padding:50px;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  color: var(--text-color);
  font-weight:400;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--heading-color);
  margin:0 0 20px;
}

p, ul, ol, table, pre, dl {
  margin:0 0 20px;
}

h1, h2, h3 {
  line-height:1.1;
}

h1 {
  font-size:28px;
  font-weight: 500;
}

h2 {
  font-size:20px;
  color: var(--heading-2-color);
  font-weight: 500;
}

h3, h4, h5, h6 {
  color: var(--heading-3-color);
  font-weight: 500;
}

a {
  color: var(--link-color);
  text-decoration:none;
}

a:hover {
  color: var(--link-hover-color);
}

a small {
  font-size:11px;
  color:#777;
  margin-top:-0.3em;
  display:block;
}

a:hover small {
  color:#777;
}

.wrapper {
  width:1050px;
  margin:0 auto;
}

blockquote {
  border-left:1px solid var(--border-color);
  margin:0;
  padding:0 0 0 20px;
  font-style:italic;
}

code, pre {
  font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal, Consolas, Liberation Mono, DejaVu Sans Mono, Courier New, monospace;
  color: var(--code-color);
}

pre {
  padding:8px 20px;
  background: var(--code-bg);
  border-radius:5px;
  border:1px solid var(--border-color);
  overflow-x: auto;
}

table {
  width:100%;
  border-collapse:collapse;
}

th, td {
  text-align:justify;
  padding:5px 10px;
  border-bottom:1px solid var(--border-color);
}

dt {
  color: var(--dt-color);
  font-weight:500;
}

th {
  color: var(--dt-color);
}

img {
  max-width:100%;
}

header {
  width:320px;
  float:left;
  position:fixed;
  -webkit-font-smoothing:subpixel-antialiased;
}

header ul {
  list-style:none;
  height:40px;
  padding:0;
  background: var(--header-bg);
  border-radius:5px;
  border:1px solid var(--header-border);
  width:270px;
}

header li {
  width:89px;
  float:left;
  border-right:1px solid var(--header-border);
  height:40px;
}

header li:first-child a {
  border-radius:5px 0 0 5px;
}

header li:last-child a {
  border-radius:0 5px 5px 0;
}

header ul a {
  line-height:1;
  font-size:11px;
  color:#999;
  display:block;
  text-align:center;
  padding-top:6px;
  height:34px;
}

header ul a:hover {
  color:#999;
}

header ul a:active {
  background-color:#f0f0f0;
}

strong {
  color: var(--strong-color);
  font-weight:500;
}

header ul li + li + li {
  border-right:none;
  width:89px;
}

header ul a strong {
  font-size:14px;
  display:block;
  color: var(--strong-color);
}

section {
  width:650px;
  float:right;
  padding-bottom:50px;
}

small {
  font-size:11px;
}

hr {
  border:0;
  background: var(--border-color);
  height:1px;
  margin:0 0 20px;
}

footer {
  width:270px;
  float:left;
  position:fixed;
  bottom:50px;
  -webkit-font-smoothing:subpixel-antialiased;
}

@media print, screen and (max-width: 960px) {

  div.wrapper {
    width:auto;
    margin:0;
  }

  header, section, footer {
    float:none;
    position:static;
    width:auto;
  }

  header {
    padding-right:320px;
  }

  section {
    padding:20px 0;
    margin:0 0 20px;
  }

  header a small {
    display:inline;
  }

  header ul {
    position:absolute;
    right:50px;
    top:52px;
  }
}

@media print, screen and (max-width: 720px) {
  body {
    word-wrap:break-word;
  }

  header {
    padding:0;
  }

  header ul, header p.view {
    position:static;
  }

  pre, code {
    word-wrap:normal;
  }
}

@media print, screen and (max-width: 480px) {
  body {
    padding:15px;
  }

  header ul {
    width:99%;
  }

  header li, header ul li + li + li {
    width:33%;
  }
}

@media print {
  body {
    padding:0.4in;
    font-size:12pt;
    color:#444;
  }
}

/* Dark/Light mode toggle switch - container */
.switch {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 20px;
    z-index: 1000;
}

/* Hide the actual checkbox input (we use a custom slider instead) */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The sliding background track */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ad95ae;
    transition: 0.3s;
}

/* The white circle that slides left/right */
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
}

/* When the switch is ON (dark mode), change background to maroon */
input:checked + .slider {
    background-color: var(--border-color);
}

/* When the switch is ON, move the circle to the right */
input:checked + .slider:before {
    transform: translateX(20px);
}

/* Make the slider track rounded */
.slider.round {
    border-radius: 20px;
}

/* Make the sliding circle rounded */
.slider.round:before {
    border-radius: 50%;
}

/* Sun and Moon icons in the toggle switch */
.slider .sun-icon,
.slider .moon-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    transition: opacity 0.3s;
    pointer-events: none;
}

.slider .sun-icon {
    left: 4px;
    color: #ad95ae;
}

.slider .moon-icon {
    right: 4px;
    color: #800000;
}

/* In light mode (unchecked): show moon, hide sun (covered by circle) */
.slider .sun-icon {
    opacity: 0;
}

.slider .moon-icon {
    opacity: 1;
}

/* In dark mode (checked): show sun, hide moon (covered by circle) */
input:checked + .slider .sun-icon {
    opacity: 1;
}

input:checked + .slider .moon-icon {
    opacity: 0;
}

/* CONTACT LINKS - Icons below photo */
.contact-links {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.contact-links a {
  font-size: 14px;
  text-decoration: none;
  color: var(--link-color);
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.contact-links a:hover {
  background-color: var(--header-bg);
  color: var(--link-hover-color);
}

/* Working papers list with arrow icons */
.papers-list {
  list-style: none;
  padding-left: 0;
}

.papers-list li {
  padding-left: 1.5em;
  position: relative;
  margin-bottom: 1.5em;
}

.papers-list li:before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--link-color);
  font-weight: bold;
}

/* Collapsible abstract buttons and text */
.collapse {
  border: none;
  outline: none;
  font-size: 15px;
}

.active,
.collapse:hover {
  background-color: #ad95ae;
}

.text {
  display: none;
  font-size: 12px;
}

/* News section styling */
.news-box {
  background-color: var(--header-bg);
  border-left: 3px solid var(--link-color);
  padding: 10px 12px;
  margin: 15px 0;
  font-size: 14px;
  border-radius: 3px;
}

.news-box i {
  color: var(--link-color);
  margin-right: 8px;
}