/* ==========================================================
   Resume – centre-line timeline (Experience block only)
   web-craftsman.com
   Load AFTER css/main.css:
   <link rel="stylesheet" href="css/resume-timeline.css">
   ========================================================== */

section[data-id="resume"] .col-md-8 > .timeline {
  position: relative;
  display: grid;
  gap: 28px;
  border-left: 0;
  padding: 8px 0;
}

/* the centre line */
section[data-id="resume"] .col-md-8 > .timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #222;
  transform: translateX(-1px);
}

section[data-id="resume"] .col-md-8 > .timeline > .timeline-event {
  position: relative;
  width: calc(50% - 32px);
  padding: 0;
}

/* alternate sides */
section[data-id="resume"] .col-md-8 > .timeline > .timeline-event:nth-child(odd) {
  justify-self: start;
  text-align: right;
}
section[data-id="resume"] .col-md-8 > .timeline > .timeline-event:nth-child(even) {
  justify-self: end;
  text-align: left;
}

/* square marker on the line */
section[data-id="resume"] .col-md-8 > .timeline > .timeline-event::after {
  content: "";
  position: absolute;
  top: 4px;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid #222;
  transition: background .2s;
}
section[data-id="resume"] .col-md-8 > .timeline > .timeline-event:nth-child(odd)::after  { right: -39px; }
section[data-id="resume"] .col-md-8 > .timeline > .timeline-event:nth-child(even)::after { left: -39px; }

/* current job and hovered job get a filled marker */
section[data-id="resume"] .col-md-8 > .timeline > .timeline-event:first-child::after,
section[data-id="resume"] .col-md-8 > .timeline > .timeline-event:hover::after {
  background: #222;
}

/* date badge: drop the original negative offset */
section[data-id="resume"] .col-md-8 > .timeline .event-date {
  margin: 0 0 3px;
  padding: 5px 8px;
}

/* bullets: dash on the right for right-aligned items, left for the others */
section[data-id="resume"] .col-md-8 > .timeline ul {
  list-style: none;
  padding: 0;
}
section[data-id="resume"] .col-md-8 > .timeline li {
  position: relative;
}
section[data-id="resume"] .col-md-8 > .timeline li::before {
  content: "";
  position: absolute;
  top: .75em;
  width: 8px;
  height: 1px;
  background: #222;
}
section[data-id="resume"] .col-md-8 > .timeline > .timeline-event:nth-child(odd) li  { padding-right: 18px; }
section[data-id="resume"] .col-md-8 > .timeline > .timeline-event:nth-child(odd) li::before  { right: 0; }
section[data-id="resume"] .col-md-8 > .timeline > .timeline-event:nth-child(even) li { padding-left: 18px; }
section[data-id="resume"] .col-md-8 > .timeline > .timeline-event:nth-child(even) li::before { left: 0; }

/* phones: single line on the left */
@media (max-width: 640px) {
  section[data-id="resume"] .col-md-8 > .timeline::before { left: 6px; }

  section[data-id="resume"] .col-md-8 > .timeline > .timeline-event,
  section[data-id="resume"] .col-md-8 > .timeline > .timeline-event:nth-child(odd),
  section[data-id="resume"] .col-md-8 > .timeline > .timeline-event:nth-child(even) {
    width: auto;
    justify-self: stretch;
    text-align: left;
    padding-left: 32px;
  }

  section[data-id="resume"] .col-md-8 > .timeline > .timeline-event:nth-child(odd)::after,
  section[data-id="resume"] .col-md-8 > .timeline > .timeline-event:nth-child(even)::after {
    left: 0;
    right: auto;
  }

  section[data-id="resume"] .col-md-8 > .timeline > .timeline-event:nth-child(odd) li {
    padding-right: 0;
    padding-left: 18px;
  }
  section[data-id="resume"] .col-md-8 > .timeline > .timeline-event:nth-child(odd) li::before {
    right: auto;
    left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  section[data-id="resume"] .col-md-8 > .timeline > .timeline-event::after { transition: none; }
}
