/* -------------------------------- 
Primary style
-------------------------------- */
html * {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

*,
*:after,
*:before {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

img {
  max-width: 100%;
}

/* -------------------------------- 
Modules - reusable parts of our design
-------------------------------- */
.cd-container {
  width: 90%;
  max-width: 1170px;
  margin: 0 auto;
}
.cd-container::after {
  content: "";
  display: table;
  clear: both;
}

/* -------------------------------- 
Main components 
-------------------------------- */
.timeline-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2em;
}

.education-header, .experience-header {
  width: 45%;
  text-align: center;
  font-size: 1.5em;
  color: #4169e1;
  font-weight: bold;
}

#cd-timeline {
  position: relative;
  padding: 2em 0;
  margin-top: 2em;
  margin-bottom: 2em;
}

#cd-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  width: 4px;
  background: #d7e4ed;
  transform: translateX(-50%);
}

.cd-timeline-block {
  position: relative;
  margin: 2em 0;
}

.cd-timeline-block::after {
  content: "";
  display: table;
  clear: both;
}

.cd-timeline-img {
  position: absolute;
  top: 0;
  left: 50%;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px white, inset 0 2px 0 rgba(0, 0, 0, 0.08), 0 3px 0 4px rgba(0, 0, 0, 0.05);
  transform: translateX(-50%);
  z-index: 1;
  background-color: white; /* Add this to ensure a white background */
}

.cd-timeline-img img {
  display: block;
  width: 87%;
  height: 100%;
  position: relative;
  border-radius: 50%;
}

.cd-timeline-content {
  position: relative;
  margin-left: 60px;
  background: white;
  border-radius: 0.25em;
  padding: 1em;
  box-shadow: 0 3px 0 #d7e4ed;
  border: 1px solid #d7e4ed;
}

.cd-timeline-content .timeline_title {
  color: #4169e1;
  font-weight: bold;
  margin-bottom: 0.2em;
}

.cd-timeline-content::after {
  content: "";
  display: table;
  clear: both;
}

.cd-timeline-content h2 {
  color: #303e49;
}

.cd-timeline-content p, .cd-timeline-content .cd-read-more, .cd-timeline-content .cd-date {
  font-size: 15px;
  font-size: 1rem;
}

.cd-timeline-content .cd-read-more, .cd-timeline-content .cd-date {
  display: inline-block;
}

.cd-timeline-content p {
  margin: 1em 0;
  line-height: 1.6;
}

.cd-timeline-content::before {
  content: '';
  position: absolute;
  top: 16px;
  right: 100%;
  height: 0;
  width: 0;
  border: 7px solid transparent;
  border-right: 7px solid white;
}

.cd-timeline-content.education {
  float: left;
  width: 45%;
}

.cd-timeline-content.experience {
  float: right;
  width: 45%;
}

.cd-timeline-content.education::before {
  left: 100%;
  border-left: 7px solid white;
  border-right: none;
}

.cd-timeline-content.experience::before {
  left: auto;
  right: 100%;
  border-right: 7px solid white;
  border-left: none;
}

.cd-timeline-content .timeline_title {
  color: #4169e1;
  font-weight: bold;
  margin-bottom: 0.5em;
}

.cd-timeline-content .cd-date {
  display: block;
  font-size: 1em;
  margin-bottom: 0.5em;
  color: #888;
}

.cd-timeline-content .timeline_text {
  margin-bottom: 1em;
}

.expanded-content {
  display: none;
  transition: all 0.5s ease; /* Slower transition */
}


@media only screen and (min-width: 1170px) {

  .cd-timeline-img {
    width: 80px;  /* Even larger for desktop view */
    height: 80px; /* Even larger for desktop view */
  }

  .cd-timeline-content {
    margin-left: 0;
    padding: 1.6em;
    width: 45%;
  }

  .cd-timeline-content::before {
    top: 24px;
    left: 100%;
    border-color: transparent;
    border-left-color: white;
  }

  .cd-timeline-content.education {
    float: left;
  }

  .cd-timeline-content.experience {
    float: right;
  }

  .cd-timeline-content.education::before {
    left: 100%;
    border-left-color: white;
    border-right-color: transparent;
  }

  .cd-timeline-content.experience::before {
    left: auto;
    right: 100%;
    border-right-color: white;
    border-left-color: transparent;
  }

  .cd-timeline-content .cd-date {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    font-size: 1em;
    padding: 0;
    opacity: 0.7;
  }
  
  .cd-timeline-content.experience .cd-date {
    text-align: left;
  }
}

@media only screen and (max-width: 1169px) {
  .timeline-header {
    flex-direction: column;
    align-items: center;
  }
  
  .education-header, .experience-header {
    width: 100%;
    margin-bottom: 1em;
  }
  
  #cd-timeline::before {
    left: 18px;
  }
  
  .cd-timeline-img {
    left: 18px;
    transform: translateX(-50%);
  }
  
  .cd-timeline-content {
    width: calc(100% - 60px);
    float: right;
  }
  
  .cd-timeline-content::before {
    left: auto;
    right: 100%;
    border-right: 7px solid white;
    border-left: none;
  }
  
  .cd-timeline-content.education,
  .cd-timeline-content.experience {
    float: right;
    width: calc(100% - 60px);
  }
  
  .cd-timeline-content.education::before,
  .cd-timeline-content.experience::before {
    left: auto;
    right: 100%;
    border-right: 7px solid white;
    border-left: none;
  }
  
  .cd-timeline-content .cd-date {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    text-align: left;
    padding: 0;
    margin-bottom: 0.5em;
  }
}

/* Animations */
.cd-timeline-block {
  opacity: 0;
  transform: translateY(100px);
  transition: all 0.5s;
}

.cd-timeline-block.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-img-windaid {
  width: 80%;  /* Adjust as needed */
  height: 80%; /* Adjust as needed */
  object-fit: contain;
}

.cd-timeline-img.cd-cardiff {
  background-color: #D83346; /* Cardiff University red */
}
.timeline-img-cardiff {
  width: 80%;  /* Adjust as needed */
  height: 80%; /* Adjust as needed */
  object-fit: contain;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.timeline-img-cardiff-racing {
  width: 100%;  /* Adjust as needed */
  height: 100%; /* Adjust as needed */
  object-fit: contain;
}

.timeline-img-lostbytes {
  width: 90%;
  height: 90%;
  object-fit: contain;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.cd-timeline-img.cd-northeastern {
  background-color: #ffffff; /* White background */
  border: 2px solid #db192b; /* Northeastern red border */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cd-timeline-img .timeline-img-northeastern {
  width: 100%;
  height: 100%;
}

.cd-timeline-img .timeline-img-northeastern .cls-1 {
  fill: #db192b; /* Northeastern red */
}

.cd-timeline-img.cd-veeco {
  background-color: #ffffff; /* White background */
  border: 2px solid #0077be; /* Veeco blue border */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cd-timeline-img .timeline-img-veeco {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.cd-timeline-img.cd-northeastern-khoury {
  background-color: #000000; /* Black background */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cd-timeline-img .timeline-img-northeastern-khoury {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cd-timeline-img.cd-grantx {
  background-color: #ffffff; /* White background */
  border: 2px solid #4CAF50; /* Green border for tech/startup feel */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cd-timeline-img .timeline-img-grantx {
  width: 95%;
  height: 95%;
  object-fit: contain;
  padding: 0px;
}

.cd-timeline-content::before {
  display: none;
}

.expand-button {
  position: absolute;
  bottom: 10px;
  right: 10px;
  cursor: pointer;
  font-size: 20px;
  color: #007bff;
  background: none;
  border: none;
  padding: 5px;
  z-index: 10;
}

.expanded-content {
  display: none;
  margin-top: 10px;
}