/**
 * Timeline History Section Styles
 * Colors: Primary #1261a4, Secondary #0e3f6e
 * 
 * Add this to your theme's CSS or enqueue as separate file
 */

/* ========================================
   Base Section Styles
   ======================================== */
.timeline-section {
  background-color: #ffffff;
  padding: 10px 0 80px 0;
  overflow: hidden;
}

.timeline-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.timeline-main-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #1261a4;
  margin-bottom: 60px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ========================================
   Timeline Structure
   ======================================== */
.timeline {
  position: relative;
  padding: 20px 0;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #1261a4 0%, #0e3f6e 100%);
  transform: translateX(-50%);
}

/* ========================================
   Timeline Item
   ======================================== */
.timeline-item {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 30px;
  margin-bottom: 60px;
  align-items: center;
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.timeline-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item:last-child {
  margin-bottom: 0;
}

/* ========================================
   Timeline Center (Year & Dot)
   ======================================== */
.timeline-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.timeline-year {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0e3f6e;
  background: #ffffff;
  padding: 5px 15px;
}

.timeline-dot {
  width: 20px;
  height: 20px;
  background-color: #ffffff;
  border: 4px solid #f9a825;
  border-radius: 50%;
  position: relative;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.timeline-item.is-visible .timeline-dot {
  animation: pulse 2s ease-in-out;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(249, 168, 37, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(249, 168, 37, 0);
  }
}

/* ========================================
   Timeline Content Sides
   ======================================== */
.timeline-left,
.timeline-right {
  min-height: 100px;
}

.timeline-left {
  text-align: right;
}

.timeline-right {
  text-align: left;
}

/* Content when on left side */
.timeline-item.right .timeline-left .timeline-content {
  text-align: right;
}

/* Content when on right side */
.timeline-item.left .timeline-right .timeline-content {
  text-align: left;
}

/* MOBILE-ONLY content - hidden on desktop */
.timeline-image--mobile,
.timeline-content--mobile {
  display: none;
}

/* ========================================
   Timeline Content Box
   ======================================== */
.timeline-content {
  padding: 20px 0;
}

.timeline-item-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0e3f6e;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #333333;
}

.timeline-text p {
  margin: 0 0 10px 0;
}

.timeline-text p:last-child {
  margin-bottom: 0;
}

.timeline-text a {
  color: #1261a4;
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.3s ease;
}

.timeline-text a:hover {
  color: #0e3f6e;
}

/* ========================================
   Timeline Image
   ======================================== */
.timeline-image {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(14, 63, 110, 0.15);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.timeline-image:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(14, 63, 110, 0.25);
}

.timeline-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.timeline-image:hover img {
  transform: scale(1.05);
}

/* ========================================
   CTA Button
   ======================================== */
.timeline-cta {
  text-align: center;
  margin-top: 60px;
}

.timeline-btn {
  display: inline-block;
  background-color: #1261a4;
  color: #ffffff;
  padding: 15px 50px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transition:
    background-color 0.3s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.timeline-btn:hover {
  background-color: #0e3f6e;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(14, 63, 110, 0.3);
  color: #ffffff;
}

/* ========================================
   Animations
   ======================================== */

/* Fade in from left */
.timeline-item.left .timeline-left {
  opacity: 0;
  transform: translateX(-30px);
  transition:
    opacity 0.6s ease 0.2s,
    transform 0.6s ease 0.2s;
}

.timeline-item.left.is-visible .timeline-left {
  opacity: 1;
  transform: translateX(0);
}

/* Fade in from right */
.timeline-item.left .timeline-right {
  opacity: 0;
  transform: translateX(30px);
  transition:
    opacity 0.6s ease 0.3s,
    transform 0.6s ease 0.3s;
}

.timeline-item.left.is-visible .timeline-right {
  opacity: 1;
  transform: translateX(0);
}

/* Reverse for right-positioned items */
.timeline-item.right .timeline-left {
  opacity: 0;
  transform: translateX(-30px);
  transition:
    opacity 0.6s ease 0.3s,
    transform 0.6s ease 0.3s;
}

.timeline-item.right.is-visible .timeline-left {
  opacity: 1;
  transform: translateX(0);
}

.timeline-item.right .timeline-right {
  opacity: 0;
  transform: translateX(30px);
  transition:
    opacity 0.6s ease 0.2s,
    transform 0.6s ease 0.2s;
}

.timeline-item.right.is-visible .timeline-right {
  opacity: 1;
  transform: translateX(0);
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet */
@media (max-width: 992px) {
  .timeline-main-title {
    font-size: 2rem;
    margin-bottom: 40px;
  }

  .timeline-item {
    gap: 20px;
    margin-bottom: 50px;
  }

  .timeline-year {
    font-size: 1.5rem;
  }

  .timeline-item-title {
    font-size: 0.9rem;
  }

  .timeline-text {
    font-size: 0.9rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .timeline-section {
    padding: 50px 0;
  }

  .timeline-main-title {
    font-size: 1.75rem;
    margin-bottom: 20px;
    padding-top: 10px;
  }

  .timeline-item {
    grid-template-columns: auto 1fr;
    gap: 15px;
    margin-bottom: 40px;
  }

  .timeline-line {
    left: 30px;
  }

  .timeline-center {
    flex-direction: column;
    gap: 10px;
    align-self: flex-start;
    padding-top: 10px;
  }

  .timeline-year {
    font-size: 1.25rem;
    padding: 3px 10px;
  }

  .timeline-dot {
    width: 16px;
    height: 16px;
    border-width: 3px;
  }

  /* FIXED: Hide left column (desktop-only content) */
  .timeline-left {
    display: none !important;
  }

  /* FIXED: Hide desktop-only content in right column */
  .timeline-image--desktop,
  .timeline-content--desktop {
    display: none !important;
  }

  /* FIXED: Show mobile-only content in right column */
  .timeline-image--mobile,
  .timeline-content--mobile {
    display: block !important;
  }

  /* Right column layout */
  .timeline-right {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: -70px;
  }

  /* Mobile content styling */
  .timeline-content--mobile {
    text-align: left;
    padding: 10px 0;
  }

  .timeline-image--mobile {
    max-width: 100%;
  }

  .timeline-item-title {
    font-size: 0.9rem;
    padding-top: 15px;
  }

  .timeline-text {
    font-size: 0.9rem;
  }

  .timeline-cta {
    margin-top: 40px;
  }

  .timeline-btn {
    padding: 12px 40px;
    font-size: 0.95rem;
  }

  /* Simplified animations for mobile */
  .timeline-item .timeline-right {
    opacity: 0;
    transform: translateY(20px);
    transition:
      opacity 0.5s ease,
      transform 0.5s ease;
  }

  .timeline-item.is-visible .timeline-right {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .timeline-container {
    padding: 0 15px;
  }

  .timeline-main-title {
    font-size: 1.5rem;
  }

  .timeline-line {
    left: 20px;
  }

  .timeline-year {
    font-size: 1.1rem;
  }

  .timeline-item-title {
    font-size: 0.85rem;
  }

  .timeline-text {
    font-size: 0.85rem;
    line-height: 1.6;
  }
}
