.interactive-timeline {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  font-family: Arial, sans-serif;
}

.interactive-timeline.layout-left { flex-direction: row; }
.interactive-timeline.layout-right { flex-direction: row-reverse; }

/* ==== MEDIA AREA ==== */
.timeline-media {
  flex: 0 0 50%;
  position: relative;      /* เพื่อวางภาพแบบ absolute ด้านใน */
  aspect-ratio: 16 / 9;    /* กันกระโดดเลย์เอาต์ (ปรับได้ถ้าต้องการ) */
  overflow: hidden;        /* ตัดขอบขณะ slide */
}

/* รูปทุกตัวซ้อนทับกัน แต่มีรูปเดียวที่ opacity:1 */
.timeline-image {
  position: absolute;
  inset: 0;                /* top:0 right:0 bottom:0 left:0 */
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  z-index: 1;
  pointer-events: none;
  will-change: opacity, transform;
}

.timeline-image.active {
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 2;
  pointer-events: auto;
}

.timeline-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;     /* หรือ cover ถ้าต้องการเต็มกรอบ */
  display: block;
}

/* ==== CONTENT AREA ==== */
.timeline-content {
  flex: 1 1 50%;
  background: var(--content-bg, transparent);
}

.timeline-content ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-step {
  padding: 15px 20px;
  cursor: pointer;
  transition: background-color 0.25s ease;
  border-radius: 6px;
  margin-bottom: 10px;
  outline: none;
}

.timeline-step.active,
.timeline-step:hover {
  background-color: #e6f0ff;
}

.timeline-step h4 {
  margin: 0 0 5px 0;
  color: #003a8c;
  font-weight: 600;
}

.timeline-step p {
  margin: 0;
  color: #555;
  font-size: 14px;
  line-height: 1.5;
}

/* title wrapper */
.timeline-step-title-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Icon sizing & recolor via CSS filter variable */
.timeline-step-icon {
  width: var(--icon-size, 24px);
  height: var(--icon-size, 24px);
  object-fit: contain;
  display: inline-block;
  /* ทำโทนสีด้วย CSS filter (รับค่าสีจาก inline style --icon-color) */
  filter:
    brightness(0) saturate(100%)
    invert(34%) sepia(73%) saturate(636%)
    hue-rotate(196deg) brightness(92%) contrast(88%);
}
/* ถ้าต้องการใช้ custom color ผ่านตัวแปร --icon-color (option เสริมสำหรับ browser ทันสมัย) */
.timeline-step-icon {
  /* โทนสีผ่าน SVG ชัดกว่าจะดี แต่ถ้าเป็น PNG ใช้ filter ตามข้างบน */
}
