.education {
  background-color: #161F33;
  border: 2px solid #2060D0;
  padding: 5px 10px 5px 10px;
}

.education-block {
  display: grid;
  grid-template-columns: 70% 30%;
}

.education-block img{
  padding: 15px 10px;
  width: 100%
  max-width: 150px;
  height: auto;
  display: block;
}

* {
  box-sizing: border-box;
}


.timeline {
  height: 480px;
  margin: 40px auto;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 40px;
  width: 100%;
  max-width: 1200px;
  border: 2px solid #FF9F55;
}


/* Inner track stretches as wide as needed */
.timeline-track {
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  min-width: 100%;
  height: 100%;
  padding-right: 60px; /* buffer so the line extends past the last circle */
}

/* Central line anchored to the inner track */
.timeline-track::before {
  content: '';
  position: absolute;
  height: 6px;
  background-color: #e2e8f0;
  left: 0;
  right: 0; /* now spans 100% of the true content width */
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

/* 3. Common item styling */
.timeline-item {
  position: relative;
  flex: 0 0 260px; /* fixed card width */
  z-index: 2;
  /* Pull items horizontally closer so they stagger diagonally */
  margin-right: -40px; 
}

.timeline-item:last-child {
  margin-right: 40px;
}

/* Circle node on the line */
.timeline-item::after {
  content: '';
  position: absolute;
  margin-bottom: -5px;
  margin-top: -5px;
  width: 22px;
  height: 22px;
  background-color: #ffffff;
  border: 4px solid #FF9F55;
  border-radius: 50%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}

/* ----------------------------------
    TOP CARDS (Push up above the line)
    ---------------------------------- */
.timeline-item.top {
  margin-bottom: 240px; /* lifts card above line */
}

.timeline-item.top::after {
  bottom: -32px; /* anchors circle on center line */
}


/* --------------------------------------
    BOTTOM CARDS (Push down below the line)
    -------------------------------------- */
.timeline-item.bottom {
  margin-top: 240px; /* pushes card below line */
}

.timeline-item.bottom::after {
  top: -32px; /* anchors circle on center line */
}


/* Card appearance with vertical scrolling */
.timeline-item .content {
  background-color: #ffffff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 4px 15px #161F33;
  position: relative;

  /* 1. Cap card height and enable vertical scrolling */
  max-height: 140px;
  overflow-y: auto;

  /* 2. Sleek thin scrollbar for Firefox */
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

/* 3. Sleek thin scrollbar for Chrome, Edge, Safari */
.timeline-item .content::-webkit-scrollbar {
  width: 5px;
  color: #2060D0;
}

.timeline-item .content::-webkit-scrollbar-track {
  background: #2060D0;
  color: #2060D0;
}

.timeline-item .content::-webkit-scrollbar-thumb {
  background: #2060D0;
  border-radius: 4px;
  color: #2060D0;
}

.timeline-item .content::-webkit-scrollbar-thumb:hover {
  background: #2060D0;
  color: #2060D0;
}

.timeline-item .content h1 {
  font-size: 16px;
}

.timeline-item .content h2 {
  font-size: 12px;
  color:#161F33;
}

.timeline-item .content h3 {
  font-size: 12px;
  text-align: center;
}

.timeline-item .content p {
  font-size: 11px;
  color: #94a3b8;
}

@media screen and (max-width: 600px) {

  .education-block {
  display: flex;
  flex-wrap: wrap;
  }
}

.timeline {
  min-width: 0;
  max-width: 100%;
}