/* ================================
   Timeline Block Styles - Figma Design
   ================================ */

.cd-timeline {
  overflow: hidden;
  padding: 4rem 0;
  margin: 2rem 0;
}

.cd-timeline__container {
  position: relative;
  padding: 2rem 0;
  max-width: 1200px;
  margin: 0 auto;
}

/* Vertical timeline line */
.cd-timeline__container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  width: 2px;
  background: var(--navy-200, #AAC4FD);
}

/* Timeline Block */
.cd-timeline__block {
  position: relative;
  margin-bottom: 6rem;
  width: 100%;
  clear: both;
}

.cd-timeline__block::after {
  content: '';
  display: table;
  clear: both;
}

.cd-timeline__block:last-child {
  margin-bottom: 0;
}

/* Date Badge - positioned outside content box */
.cd-timeline__date-badge {
  position: absolute;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--grey-500, #6D7797);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  z-index: 1;
  top: 20px;
}

/* Odd blocks - date on left side of timeline */
.cd-timeline__block:nth-child(odd) .cd-timeline__date-badge {
  right: calc(50% + 45px);
  text-align: right;
}

/* Even blocks - date on right side of timeline */
.cd-timeline__block:nth-child(even) .cd-timeline__date-badge {
  left: calc(50% + 45px);
  text-align: left;
}

/* Timeline Image/Icon Container */
.cd-timeline__img {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--white, #fff);
  border: 3px solid var(--navy-200, #AAC4FD);
  z-index: 3;
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  transition: all 0.3s ease;
}

.cd-timeline__block:hover .cd-timeline__img {
  transform: translateX(-50%) scale(1.08);
  border-color: var(--navy-500, #2856FA);
}

.cd-timeline__img img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 50%;
}

.cd-timeline__img svg {
  width: 28px;
  height: 28px;
  color: var(--navy-500, #2856FA);
  transition: color 0.3s ease;
}

.cd-timeline__block:hover .cd-timeline__img svg {
  color: var(--navy-600, #053FEA);
}

/* Timeline Content with Speech Bubble */
.cd-timeline__content {
  position: relative;
  background: var(--white, #fff);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  width: 45%;
  max-width: 500px;
}

/* Speech bubble triangle pointer */
.cd-timeline__content::before {
  content: '';
  position: absolute;
  top: 20px;
  width: 0;
  height: 0;
  border-style: solid;
}

/* Odd blocks - content on right, pointer on left */
.cd-timeline__block:nth-child(odd) .cd-timeline__content {
  float: right;
  margin-right: 0;
  margin-left: calc(50% + 50px);
}

.cd-timeline__block:nth-child(odd) .cd-timeline__content::before {
  left: -12px;
  border-width: 12px 12px 12px 0;
  border-color: transparent var(--white, #fff) transparent transparent;
}

/* Even blocks - content on left, pointer on right */
.cd-timeline__block:nth-child(even) .cd-timeline__content {
  float: left;
  margin-left: 0;
  margin-right: calc(50% + 50px);
}

.cd-timeline__block:nth-child(even) .cd-timeline__content::before {
  right: -12px;
  border-width: 12px 0 12px 12px;
  border-color: transparent transparent transparent var(--white, #fff);
}

.cd-timeline__content:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.cd-timeline__content h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--navy-900, #02215A);
  transition: color 0.3s ease;
}

.cd-timeline__content:hover h2 {
  color: var(--navy-500, #2856FA);
}

/* Main Image inside content */
.cd-timeline__main-image {
  margin: 1.25rem 0;
  border-radius: 8px;
  overflow: hidden;
}

.cd-timeline__main-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.cd-timeline__content .color-contrast-medium {
  margin-bottom: 0;
  color: var(--grey-500, #6D7797);
  line-height: 1.6;
  font-size: 0.95rem;
}

.cd-timeline__content .color-contrast-medium p {
  margin-bottom: 0.75rem;
}

.cd-timeline__content .color-contrast-medium p:last-child {
  margin-bottom: 0;
}

/* Link wrapper */
.cd-timeline__link-wrapper {
  margin-top: 1.5rem;
}

/* Button Styles */
.cd-timeline__content .btn {
  display: inline-block;
  padding: 0.625rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.875rem;
  font-weight: 600;
}

.cd-timeline__content .btn--subtle {
  background: transparent;
  color: var(--navy-500, #2856FA);
  border: 2px solid var(--navy-500, #2856FA);
}

.cd-timeline__content .btn--subtle:hover {
  background: var(--navy-500, #2856FA);
  color: var(--white, #fff);
}

/* ================================
   Animation Styles
   ================================ */

.cd-timeline__block--hidden {
  opacity: 1;
  visibility: visible;
}

.cd-timeline__img--hidden,
.cd-timeline__content--hidden {
  visibility: visible;
  opacity: 1;
}

/* Bounce-in animation for images */
@keyframes cd-bounce-icon {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.3);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.1);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

.cd-timeline__img--bounce-in {
  animation: cd-bounce-icon 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  visibility: visible !important;
  opacity: 1 !important;
}

/* Slide-in animation for content from right (odd blocks) */
@keyframes cd-slide-in-right {
  0% {
    opacity: 0;
    transform: translateX(-60px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide-in animation for content from left (even blocks) */
@keyframes cd-slide-in-left {
  0% {
    opacity: 0;
    transform: translateX(60px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Odd blocks - content slides from left */
.cd-timeline__block:nth-child(odd) .cd-timeline__content--bounce-in {
  animation: cd-slide-in-right 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation-delay: 0.15s;
  animation-fill-mode: both;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Even blocks - content slides from right */
.cd-timeline__block:nth-child(even) .cd-timeline__content--bounce-in {
  animation: cd-slide-in-left 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation-delay: 0.15s;
  animation-fill-mode: both;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ================================
   Mobile Responsive Adjustments
   ================================ */

@media (max-width: 767px) {
  .cd-timeline {
    padding: 2rem 0;
  }

  .cd-timeline__container {
    padding: 1rem;
  }

  .cd-timeline__container::before {
    left: 32px;
    transform: none;
  }

  .cd-timeline__block {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    margin-bottom: 3rem;
  }

  .cd-timeline__block:last-child {
    margin-bottom: 0;
  }

  /* Date badge - above icon on mobile */
  .cd-timeline__date-badge {
    position: absolute;
    left: 0;
    top: -24px;
    text-align: left;
    font-size: 0.7rem;
  }

  .cd-timeline__block:nth-child(even) .cd-timeline__date-badge {
    left: 0;
    text-align: left;
  }

  .cd-timeline__img {
    position: relative;
    left: 0;
    transform: none;
    width: 60px;
    height: 60px;
    margin-right: 1.25rem;
    flex-shrink: 0;
  }

  .cd-timeline__block:hover .cd-timeline__img {
    transform: scale(1.05);
  }

  .cd-timeline__img img {
    width: 32px;
    height: 32px;
  }

  .cd-timeline__img svg {
    width: 24px;
    height: 24px;
  }

  /* Content box - no speech bubble on mobile */
  .cd-timeline__content {
    width: 100%;
    padding: 1.25rem;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .cd-timeline__content::before {
    display: none;
  }

  .cd-timeline__content h2 {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
  }

  .cd-timeline__main-image {
    margin: 1rem 0;
  }

  .cd-timeline__content .color-contrast-medium {
    font-size: 0.875rem;
    line-height: 1.5;
  }

  .cd-timeline__link-wrapper {
    margin-top: 1rem;
  }

  .cd-timeline__content .btn {
    font-size: 0.8rem;
    padding: 0.5rem 1.2rem;
  }

  /* Mobile animations - simpler */
  @keyframes cd-bounce-icon {
    0% {
      opacity: 0;
      transform: scale(0.5);
    }
    50% {
      opacity: 1;
      transform: scale(1.1);
    }
    100% {
      opacity: 1;
      transform: scale(1);
    }
  }

  .cd-timeline__block:nth-child(odd) .cd-timeline__content--bounce-in,
  .cd-timeline__block:nth-child(even) .cd-timeline__content--bounce-in {
    animation: cd-slide-in-right 0.5s ease-out;
    animation-delay: 0.1s;
    animation-fill-mode: both;
  }
}

/* ================================
   Tablet Adjustments
   ================================ */

@media (min-width: 768px) and (max-width: 1024px) {
  .cd-timeline__content {
    width: 42%;
    padding: 1.5rem;
  }

  .cd-timeline__block:nth-child(odd) .cd-timeline__date-badge {
    right: calc(50% + 70px);
  }

  .cd-timeline__block:nth-child(even) .cd-timeline__date-badge {
    left: calc(50% + 70px);
  }

  .cd-timeline__content h2 {
    font-size: 1.25rem;
  }
}

/* ================================
   Print Styles
   ================================ */

@media print {
  .cd-timeline__img--hidden,
  .cd-timeline__content--hidden {
    visibility: visible !important;
  }

  .cd-timeline__content::before {
    display: none;
  }
}