body {
  font-family: sans-serif;
  margin: 0;
  padding: 2rem;
}

.timeline {
  position: relative;
  width: 100%;
  height: 1680px; /* Adjust based on your timeline's total height */
  border-left: 2px solid #333;
  margin-left: 100px;
  margin-right: -100px;
  /* overflow-y: auto; */
}

/* Year labels on the left of the axis */
.year-marker {
  position: absolute;
  left: -4%;
  font-size: 14px;
  color: #666;
}

/* Timeline bars */
.bar {
  position: absolute;
  background-color: #5588A3;
  border-radius: 2px;
  width: 8%;
}

.bar.left { left: 30%; }
.bar.middle { left: 40%; background-color: #145374; }
.bar.right { left: 50%; background-color: #145374; }


/* abroad bars */
.abroad-bar {
  position: absolute;
  background-color: transparent;
  border-top: 1px dashed #333;
  border-bottom: 1px dashed #333;
  border-radius: 0px;
  width: 80%;
  left: 5%;
  
  /* display: flex;
  align-items: center;    centers vertically */
}
.abroad-description {
  position: relative;
  background-color: transparent;
  /* left: 5px;   */
  max-width: 30%;
  /* bottom: 5px;  */
  font-size: smaller;
  padding: 5px 5px;
}


/* Labels */
.label {
  position: absolute;
  display: flex;
  width: 20%;
}

.label.right {
  left: 63%;
  /* margin-left: 20px; */
  flex-direction: row;
  align-items: left;
}

.label.left {
  left: 5%;
  /* margin-right: 20px; */
  flex-direction: row-reverse;
  align-items: right;
}

.line {
  height: 2px;
  background: #333;
  position: absolute;
}

.line.left-short {
  left: 26%;
  width: 5%;
}

.line.left-middle {
  left: 26%;
  width: 15%;
}

.line.right-short {
  left: 57%;
  width: 5%;
}

.line.right-middle {
  left: 47%;
  width: 15%;
}


.description {
  background: #eee;
  padding: 5px 10px;
  border-radius: 4px;
  width: auto;  /* fixed width */
  white-space: normal;
}


/* smaller CV text on mobile devices */
@media (max-width: 810px) {
  .description {
    font-size: 12px;
    padding: 4px 6px;
  }
  .year-marker {
    font-size: 11px;
    left: -10%;
  }
  .timeline {
    margin-left: 3%;
  }
  .abroad-bar {
    width: 102%;
    left: 3%;
  }
  .abroad-description {
    font-size: 11px;
    max-width: 35%;
    /* padding: 3px 6px; */
    /* max-width: 200px; narrower on mobile */
  }

  .label.right {
    width: 30%;
  }
  .label.left {
    width: 30%;
  }

  /* shift everything to allow left label larger */
  :root {
    --left-offset: 10%;
  }
  .bar.middle {
    left: calc(40% + var(--left-offset, 0));
  }
  /* LEFT elements */
  .bar.left {
    left: calc(30% + var(--left-offset, 0));
  }
  .line.left-short {
    left: calc(26% + var(--left-offset, 0));
  }
  .line.left-middle {
    left: calc(26% + var(--left-offset, 0));
  }
  /* RIGHT elements */
  .label.right {
    left: calc(63% + var(--left-offset, 0));
  }
  .bar.right {
    left: calc(50% + var(--left-offset, 0));
  }
  .line.right-short {
    left: calc(57% + var(--left-offset, 0));
  }
  .line.right-middle {
    left: calc(47% + var(--left-offset, 0));
  }


}

.greedy-nav a {
  margin: 0.0rem 0.8rem;
  padding: 0.7rem 0;
}


/* smaller nav bar on mobile devices */
@media (max-width: 500px) {
  .greedy-nav a {
    margin: 0.0rem 0.6rem;
    padding: 0.5rem 0;
  }
}
@media (max-width: 380px) {
  .greedy-nav a {
    margin: 0.0rem 0.5rem;
    padding: 0.5rem 0;
  }
}

.greedy-nav.is-collapsed a {
  font-size: 0.9rem;
  padding: 0.4rem 0.4rem;
}


/* dark mode */ 
html[data-theme="dark"] .description {
    background: rgb(53, 53, 53);
    /* color: #e0e0e0; */
  }
html[data-theme="dark"]  .line {
    background: #848383;
  }
  
html[data-theme="dark"] .year-marker {
    color: #bbb;
  }
  
    /* optional: adjust colors to be more dark-mode friendly */
/* html[data-theme="dark"] .bar {
    filter: brightness(0.8);
  } */

html[data-theme="dark"] .abroad-bar {
  /* background-color: #403F48; */
  border-top: 1px dashed #848383;
  border-bottom: 1px dashed #848383;
    /* filter: brightness(0.5); */
  }
  /* .label.left, .label.right {
    color: #373737;
  } */

