/* =====================================================
   ORDEREDLIST MINIMAL THEME - MODIFIED
   ===================================================== */

/*@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600&display=swap');*/
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600&display=swap');

/* =====================================================
   CSS CUSTOM PROPERTIES (Light Mode - Default)
   ===================================================== */
:root {
  --bg-primary: #faf8f2;
  --bg-secondary: #fff;
  --bg-inset: #f0ede6;
  --bg-hover: #fff;
  
  --text-primary: #222;
  --text-secondary: #727272;
  --text-muted: #999;
  
  --accent-color: #267cb9;
  --accent-hover: #069;
  
  --border-color: #e0ddd5;
  --border-light: #e5e5e5;
  --timeline-line: #ccc;
  --timeline-dot: #666;
  
  --tag-new-bg: #fff3cd;
  --tag-new-text: #856404;
  --tag-paper-bg: #e8f4e8;
  --tag-paper-text: #2e6b2e;
  --tag-code-bg: #e3f2fd;
  --tag-code-text: #1565c0;
  --tag-talk-bg: #f3e5f5;
  --tag-talk-text: #7b1fa2;
  
  --shadow-soft: rgba(0,0,0,0.06);
  --shadow-medium: rgba(0,0,0,0.08);
}

/* =====================================================
   DARK MODE
   ===================================================== */
[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #242424;
  --bg-inset: #1e1e1e;
  --bg-hover: #2a2a2a;
  
  --text-primary: #e8e8e8;
  --text-secondary: #a0a0a0;
  --text-muted: #707070;
  
  --accent-color: #5ba3d9;
  --accent-hover: #7bbfef;
  
  --border-color: #3a3a3a;
  --border-light: #333;
  --timeline-line: #444;
  --timeline-dot: #888;
  
  --tag-new-bg: #3d3520;
  --tag-new-text: #e0c67a;
  --tag-paper-bg: #1e2e1e;
  --tag-paper-text: #7ac77a;
  --tag-code-bg: #1a2a3a;
  --tag-code-text: #6eb5e8;
  --tag-talk-bg: #2a1a2e;
  --tag-talk-text: #c490d4;
  
  --shadow-soft: rgba(0,0,0,0.2);
  --shadow-medium: rgba(0,0,0,0.3);
}

/* =====================================================
   THEME TOGGLE
   ===================================================== */
.theme-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.theme-toggle {
  position: relative;
  width: 44px;
  height: 22px;
  background: var(--border-color);
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.3s ease;
  border: none;
  padding: 0;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--bg-secondary);
  border-radius: 50%;
  transition: transform 0.3s ease, background 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

[data-theme="dark"] .theme-toggle {
  background: var(--accent-color);
}

[data-theme="dark"] .theme-toggle::after {
  transform: translateX(22px);
}

.theme-toggle-icon {
  font-size: 12px;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.theme-toggle-icon.sun {
  color: var(--text-muted);
}

.theme-toggle-icon.moon {
  color: var(--text-muted);
}

[data-theme="dark"] .theme-toggle-icon.moon {
  color: var(--accent-color);
}

:root:not([data-theme="dark"]) .theme-toggle-icon.sun {
  color: var(--accent-color);
}

/* =====================================================
   BASE STYLES
   ===================================================== */

body {
  background-color: var(--bg-primary);
  padding: 50px;
  /*font: 14px/1.6 "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;*/
  font: 14px/1.6 "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text-secondary);
  font-weight: 400;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  margin: 30px 0 20px;
  font-weight: 500;
  font: 18px/1.6 "DM-Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

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

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

h1 {
  font-size: 28px;
}

h2 {
  color: var(--text-primary);
}

h3, h4, h5, h6 {
  color: var(--text-primary);
}

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

a:hover, a:focus {
  color: var(--accent-hover);
  text-decoration: underline;
}

a small {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: -0.3em;
  display: block;
}

a:hover small {
  color: var(--text-muted);
}

.wrapper {
  float: left;
  max-width: 1400px;
  margin: 0 auto;
}

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

code, pre {
  font-family: Monaco, Consolas, "Courier New", monospace;
  color: var(--text-primary);
}

pre {
  padding: 8px 15px;
  background: var(--bg-secondary);
  border-radius: 5px;
  border: 1px solid var(--border-light);
  overflow-x: auto;
}

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

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

dt {
  color: var(--text-primary);
  font-weight: 700;
}

th {
  color: var(--text-primary);
}

img {
  max-width: 100%;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

small {
  font-size: 11px;
  color: var(--text-muted);
}

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

/* =====================================================
   HEADER / SIDEBAR
   ===================================================== */

header {
  width: 270px;
  position: fixed;
  top: 50px;
  left: 50px;
  bottom: 50px;
  -webkit-font-smoothing: subpixel-antialiased;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

header > footer {
  margin-top: auto;
  margin-bottom: 0;
}

footer {
  margin-top: 40px;
  -webkit-font-smoothing: subpixel-antialiased;
}

footer p {
  margin: 0;
}

header h1 {
  font-size: 28px;
  font-weight: 500;
  margin-top: 8px;
}

header h1 a {
  color: var(--accent-color);
}

header h1 a:hover {
  text-decoration: none;
  color: var(--accent-hover);
}

.profile-photo {
  width: 180px;
  border-radius: 3px;
  margin-top: 12px;
  margin-bottom: 20px;
}

.sidebar-email {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 12px;
}

.sidebar-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-links li {
  margin: 4px 0;
}

.sidebar-links a {
  color: var(--accent-color);
  font-size: 13px;
  text-decoration: none;
  display: flex;
  align-items: center;  /* keeps icon + text aligned */
}

.sidebar-links i {
  margin-right: 4px;
}

.sidebar-links a span::before {
  content: ":";
  margin-right: 6px;
}


/* =====================================================
   CONTENT AREA - THREE COLUMN LAYOUT
   ===================================================== */

.content-area {
  margin-left: 310px;
  display: grid;
  grid-template-columns: minmax(400px, 580px) minmax(350px, 450px);
  grid-template-areas:
    "about news"
    "publications news";
  gap: 0 60px;
  align-items: start;
}

.about-section {
  grid-area: about;
}

.about-section > h1:first-child,
.news-section > h1:first-child {
  margin-top: 0;
}

.about-section > p:first-of-type {
  margin-top: 25px;
}

.news-section {
  grid-area: news;
  padding-right: 8px; /* space for shadow */
}

.publications-section {
  grid-area: publications;
}

.publications-section strong {
  font-weight: 500;
}

/* Legacy section styles (keep for compatibility) */
section {
  padding-bottom: 50px;
}

/* =====================================================
   FOOTER
   ===================================================== */

footer {
  margin-top: 40px;
  -webkit-font-smoothing: subpixel-antialiased;
}

footer p {
  margin: 0;
}

/* =====================================================
   TIMELINE STYLES
   ===================================================== */

.timeline {
  position: relative;
  padding-left: 24px;
  margin: 30px 0;
}

/* Vertical line */
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 20px;
  width: 1px;
  background: var(--timeline-line);
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

/* Simple dot */
.timeline-item::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 6px;
  width: 5px;
  height: 5px;
  background: var(--timeline-dot);
  border-radius: 50%;
}

.timeline-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
  float: right;
  margin-top: 0;
  margin-left: 12px;
  text-align: right;
  max-width: 45%;
}

.timeline-date i {
  margin-right: 4px;
  opacity: 0.8;
}

.timeline-title {
  font-size: 15px;
  font-weight: 300;
  color: var(--text-primary);
  margin: 0 0 6px 0;
  overflow: hidden;
}

.timeline-title a {
  color: var(--text-primary);
}

.timeline-title a:hover {
  color: var(--accent-color);
}

.timeline-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
  clear: both;
}

/* Highlighted box with inset style and hover transition */
.timeline-item.highlight .timeline-box {
  background: var(--bg-inset);
  border: 1px solid var(--border-color);
  padding: 14px 16px;
  position: relative;
  margin-bottom: 4px;
  box-shadow: inset 0 2px 4px var(--shadow-medium), inset 0 1px 2px var(--shadow-soft);
  transition: all 0.25s ease-out;
}

/* Outset (raised) style on hover */
.timeline-item.highlight .timeline-box:hover {
  background: var(--bg-hover);
  box-shadow: 0 2px 8px var(--shadow-medium), 0 4px 12px var(--shadow-soft);
  transform: translateY(-2px);
}

.timeline-item.highlight .timeline-title {
  padding-right: 0;
}

/* Header row with tag left, date right */
.timeline-item.highlight .timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.timeline-item.highlight .timeline-header .timeline-date {
  float: none;
  margin: 0;
  max-width: none;
}

.timeline-item.highlight .timeline-description {
  clear: both;
}

/* Clickable timeline box (when event has a link) */
a.timeline-box-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.timeline-box-link:hover {
  text-decoration: none;
}

a.timeline-box-link .timeline-title {
  color: var(--text-primary);
}

a.timeline-box-link:hover .timeline-title {
  color: var(--text-primary);
}

/* Tag styles */
.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

.tag.new {
  background: var(--tag-new-bg);
  color: var(--tag-new-text);
}

.tag.paper {
  background: var(--tag-paper-bg);
  color: var(--tag-paper-text);
}

.tag.code {
  background: var(--tag-code-bg);
  color: var(--tag-code-text);
}

.tag.talk {
  background: var(--tag-talk-bg);
  color: var(--tag-talk-text);
}

/* Today divider with subtle pulsing diamond marker */
.timeline-today {
  position: relative;
  margin: 30px 0;
}

.timeline-today::before {
  content: '';
  position: absolute;
  left: -23px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: var(--timeline-dot);
  animation: pulse 2.5s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(100, 100, 100, 0.35);
  }
  70%, 100% {
    box-shadow: 0 0 0 6px rgba(100, 100, 100, 0);
  }
}

.timeline-today-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* =====================================================
   RESPONSIVE STYLES
   ===================================================== */

/* Wide screens: extend timeline line to full height of content */
@media screen and (min-width: 1201px) {
  .wrapper {
    overflow: hidden;
  }
  
  .news-section {
    overflow: visible;
  }
  
  .timeline {
    overflow: visible;
  }
  
  /* Extend the timeline's vertical line */
  .timeline::before {
    bottom: -1000px; /* extend well beyond the timeline content */
  }
}

/* Medium screens: 2 columns (sidebar + single content column) */
@media screen and (max-width: 1200px) {
  .content-area {
    grid-template-columns: 1fr;
    grid-template-areas:
      "about"
      "news"
      "publications";
    gap: 30px;
    max-width: 600px;
  }

  .news-section {
    position: static;
    width: auto;
    overflow-y: visible;
  }
}

/* Narrow screens: single column, everything stacks */
@media print, screen and (max-width: 960px) {
  div.wrapper {
    width: auto;
    margin: 0;
  }

  header {
    float: none;
    position: static;
    width: auto;
    border: none;
  }
  
  header h1 {
    border: none;
    text-decoration: none;
  }
  
  /* Remove any pseudo-element lines */
  header::after,
  header::before,
  header h1::after,
  header h1::before {
    display: none;
  }

  .content-area {
    margin-left: 0;
    grid-template-columns: 1fr;
    grid-template-areas:
      "about"
      "news"
      "publications";
    gap: 30px;
    max-width: none;
  }

  .news-section {
    position: static;
    width: auto;
    overflow-y: visible;
  }

  header {
    margin-bottom: 30px;
  }
  
  /* Hide sidebar footer completely on narrow screens */
  header > footer {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
  }
  
  /* Show page footer on narrow screens */
  footer.page-footer {
    display: block !important;
    position: static;
    float: none;
    width: auto;
  }
}

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

  header {
    padding: 0;
  }

  pre, code {
    word-wrap: normal;
  }
  
  /* Stack date above title on narrow screens for non-highlighted items */
  .timeline-item:not(.highlight) .timeline-date {
    float: none;
    display: block;
    margin-bottom: 4px;
    margin-left: 0;
    max-width: none;
    text-align: left;
  }
}

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

@media print {
  body {
    padding: 0.4in;
    font-size: 12pt;
    color: var(--text-primary);
  }
}

/* =====================================================
   PAGE FOOTER (for narrow screens)
   ===================================================== */
.page-footer {
  display: none; /* Hidden by default, shown on narrow screens */
  margin: 40px 15px 20px;
  padding: 20px 0 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  position: static;
  float: none;
  width: auto;
  clear: both;
}

.page-footer p {
  margin: 0;
  color: var(--text-muted);
}

.page-footer small {
  color: var(--text-muted);
}

.page-footer .theme-toggle-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
  position: static;
}

