html {
  overflow-y: scroll;
}

.site-nav .page-link {
  vertical-align: middle;
}

html.dark-mode body,
body.dark-mode {
  background-color: #202020 !important;
  color: #e0e0e0 !important;
}
html.dark-mode body .site-header,
body.dark-mode .site-header {
  background-color: #202020 !important;
  border-bottom: 1px solid #404040 !important;
}
html.dark-mode body .site-title,
html.dark-mode body .site-title:visited,
body.dark-mode .site-title, 
body.dark-mode .site-title:visited,
body.dark-mode .site-nav .page-link {
  color: #e0e0e0 !important;
}
html.dark-mode body .wrapper,
body.dark-mode .wrapper {
  background-color: #202020 !important;
}
html.dark-mode body .post-meta,
body.dark-mode .post-meta {
  color: #a0a0a0 !important;
}
html.dark-mode body a,
body.dark-mode a {
  color: #6fa3ef !important;
}
html.dark-mode body .site-footer,
body.dark-mode .site-footer {
  background-color: #202020 !important;
  border-top: 1px solid #404040 !important;
  color: #a0a0a0 !important;
}
html.dark-mode body pre,
body.dark-mode pre {
  background-color: #1a1a1a !important;
  color: #e0e0e0 !important;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 10px;
  overflow-x: auto;
}

html.dark-mode body .highlighter-rouge .highlight,
body.dark-mode .highlighter-rouge .highlight {
  background-color: transparent !important;
}

html.dark-mode body code,
body.dark-mode code {
  background-color: #2a2a2a !important;
  color: #e0e0e0 !important;
  padding: 2px 4px;
  border-radius: 3px;
}


/* Ensure code inside pre blocks doesn't double up on background/padding */
html.dark-mode body pre code,
body.dark-mode pre code {
  background-color: transparent !important;
  padding: 0;
  border-radius: 0;
}


/* Syntax Highlighting for Dark Mode */
.dark-mode .highlight .c, .dark-mode .highlight .cm, .dark-mode .highlight .c1 { color: #8e908c; font-style: italic; } /* Comment */
.dark-mode .highlight .k, .dark-mode .highlight .kd, .dark-mode .highlight .kn, .dark-mode .highlight .kp, .dark-mode .highlight .kr { color: #c397d8; } /* Keyword */
.dark-mode .highlight .o, .dark-mode .highlight .ow { color: #70c0b1; } /* Operator */
.dark-mode .highlight .s, .dark-mode .highlight .sb, .dark-mode .highlight .sc, .dark-mode .highlight .sd, .dark-mode .highlight .s2, .dark-mode .highlight .se, .dark-mode .highlight .sh, .dark-mode .highlight .si, .dark-mode .highlight .sx, .dark-mode .highlight .s1, .dark-mode .highlight .ss { color: #b9ca4a; } /* String */
.dark-mode .highlight .m, .dark-mode .highlight .mf, .dark-mode .highlight .mh, .dark-mode .highlight .mi, .dark-mode .highlight .mo, .dark-mode .highlight .il { color: #e78c45; } /* Number */
.dark-mode .highlight .n, .dark-mode .highlight .na, .dark-mode .highlight .nb, .dark-mode .highlight .nc, .dark-mode .highlight .no, .dark-mode .highlight .nd, .dark-mode .highlight .ni, .dark-mode .highlight .ne, .dark-mode .highlight .nf, .dark-mode .highlight .nl, .dark-mode .highlight .nn, .dark-mode .highlight .nx, .dark-mode .highlight .py { color: #7aa6da; } /* Name */
.dark-mode .highlight .nt { color: #d54e53; } /* Tag */
.dark-mode .highlight .err { color: #d54e53; background-color: transparent; } /* Error */

html.dark-mode body blockquote,
body.dark-mode blockquote {
  background-color: #333 !important;
  border-left-color: #6fa3ef !important;
  color: #e0e0e0 !important;
}
html.dark-mode body img,
body.dark-mode img {
  opacity: 0.9;
}


.post-content {
  max-width: 800px !important;
  margin: 0 auto !important;
}

body.width-wide .post-content {
  max-width: 1200px !important;
  margin: 0 calc((100% - 1200px) / 2) !important;
}

body.width-full .post-content {
  max-width: 100vw !important;
  margin: 0 calc((100% - 100vw) / 2) !important;
  padding: 0 30px !important;
}

/* Table of Contents */
.toc-sidebar {
  position: fixed;
  top: 100px;
  right: 0;
  width: 220px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  z-index: 100;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s, visibility 0.5s;
}

.toc-sidebar.toc-hidden {
  opacity: 0;
  visibility: hidden;
}

.toc-sidebar.toc-hidden:hover,
body:has(.toc-trigger:hover) .toc-sidebar {
  opacity: 1;
  visibility: visible;
}

.toc-trigger {
  position: fixed;
  top: 0;
  right: 0;
  width: 100px;
  height: 100vh;
  z-index: 99;
  display: none;
}

body:has(#toc-list li) .toc-trigger {
  display: block;
}

.toc-sidebar nav {
  background: #fafafa;
  padding: 15px;
  border-radius: 8px;
  font-size: 0.85em;
  border: 1px solid #e0e0e0;
}

.dark-mode .toc-sidebar nav {
  background: #2a2a2a;
  border-color: #404040;
}

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

.toc-sidebar li {
  margin: 5px 0;
}

.toc-sidebar a {
  color: #333;
  text-decoration: none;
}

.dark-mode .toc-sidebar a {
  color: #e0e0e0;
}

.toc-sidebar a:hover {
  color: #6fa3ef;
}

.content.with-toc {
  margin-right: 240px;
}

@media (max-width: 900px) {
  .toc-sidebar {
    display: none;
  }
  .content.with-toc {
    margin-right: 0;
  }
}

/* Toggle buttons */
/* Header alignment fixes */
.site-header .wrapper {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 56px !important;
  max-width: 800px !important;
  margin: 0 auto !important;
  padding: 0 15px !important;
}

.site-header .wrapper::after {
  display: none !important;
}

.site-title {
  float: none !important;
  margin-right: 20px !important;
  line-height: 56px !important;
  flex-shrink: 0;
  color: inherit !important;
  text-decoration: none !important;
}

.site-nav {
  float: none !important;
  line-height: inherit !important;
  position: static !important; /* Override absolute positioning in Minima */
}

.site-nav .trigger {
  display: flex !important;
  align-items: center !important;
}

.site-nav .page-link {
  line-height: inherit !important;
  margin-left: 0 !important;
  margin-right: 20px !important;
  vertical-align: middle !important;
}

@media screen and (max-width: 600px) {
  .site-nav .trigger {
    display: none !important; /* Keep mobile menu hidden by default */
  }
  
  .site-nav .nav-trigger:checked ~ .trigger {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    right: 15px;
    top: 50px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    z-index: 10;
  }
  
  .dark-mode .site-nav .nav-trigger:checked ~ .trigger {
    background: #2a2a2a;
    border-color: #404040;
  }
}

.site-nav .page-link {
  color: #333 !important;
  vertical-align: middle;
  height: 32px !important;
  width: auto !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  padding: 0 !important;
  font-size: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  margin-left: 20px !important;
}

.dark-mode .site-nav .page-link {
  color: #e0e0e0 !important;
}

#theme-toggle {
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin-left: 20px !important;
  display: flex !important;
  align-items: center !important;
  color: #333 !important;
}

.dark-mode #theme-toggle {
  color: #a0a0a0 !important;
}

.site-footer .footer-col-wrapper {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
}
/* Resume page */
.resume-container {
  max-width: 900px;
  margin: 0 auto;
}

.resume-header {
  margin-bottom: 2em;
  text-align: center;
}

.resume-header h2 {
  margin-bottom: 0.2em;
}

.resume-subtitle {
  color: #666;
  margin-top: 0;
  margin-bottom: 0.5em;
  font-size: 1.2em;
}

.resume-contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  font-size: 0.9em;
  color: #666;
}

.dark-mode .resume-subtitle,
.dark-mode .resume-contact {
  color: #a0a0a0;
}

.resume-contact span i {
  margin-right: 5px;
}

.resume-section {
  margin-bottom: 2.5em;
}

.resume-section h3 {
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 0.3em;
  margin-bottom: 1em;
  text-transform: uppercase;
  font-size: 1.1em;
  letter-spacing: 0.05em;
}

.dark-mode .resume-section h3 {
  border-color: #404040;
}

.resume-item {
  margin-bottom: 1.5em;
}

.resume-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.2em;
}

.resume-item-title {
  font-weight: 700;
  font-size: 1.1em;
}

.resume-item-date {
  font-style: italic;
  font-size: 0.9em;
  color: #666;
}

.dark-mode .resume-item-date {
  color: #a0a0a0;
}

.resume-item-company,
.resume-item-degree {
  font-weight: 600;
  font-style: italic;
  margin-bottom: 0.5em;
  color: #444;
}

.dark-mode .resume-item-company,
.dark-mode .resume-item-degree {
  color: #ccc;
}

.resume-item-highlights {
  margin-top: 0.5em;
  padding-left: 1.5em;
}

.resume-item-highlights li {
  margin-bottom: 0.3em;
  font-size: 0.95em;
}

.resume-skills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}

.resume-skill-group {
  font-size: 0.95em;
}

.resume-pdf-section {
  margin-top: 3em;
  border-top: 2px dashed #eee;
  padding-top: 2em;
}

.dark-mode .resume-pdf-section {
  border-color: #333;
}

.resume-pdf {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.dark-mode .resume-pdf {
  border-color: #404040;
}

.resume-pdf object {
  display: block;
  background: #fff;
}

.resume-download {
  text-align: center;
  margin-top: 1.5em;
}

.resume-download a {
  display: inline-block;
  padding: 0.6em 1.5em;
  border: 1px solid #333;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
}

.dark-mode .resume-download a {
  border-color: #e0e0e0;
  color: #e0e0e0;
}

.resume-download a:hover {
  background: #333;
  color: #fff;
}

.dark-mode .resume-download a:hover {
  background: #e0e0e0;
  color: #202020;
}

