/**
 * Japan Awaits — Cruise Course / Route Stops Timeline Block CSS
 */

.ja-course-timeline-section {
  width: 100%;
  box-sizing: border-box;
}

.ja-course-timeline-grid {
  display: grid;
  grid-template-columns: repeat(var(--ja-stops-per-row, 6), 1fr);
  row-gap: var(--ja-row-gap, 42px);
  column-gap: 0 !important;
  width: 100%;
  box-sizing: border-box;
}

/* Single Stop Item */
.ja-course-stop {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-sizing: border-box;
  padding: 0 !important;
  margin: 0 !important;
  width: 100%;
  overflow: visible;
}

/* Badge Slot above the dot */
.ja-course-stop-badge-slot {
  height: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 8px;
  width: 100%;
}

.ja-course-stop-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  background-color: var(--ja-highlight-col, #c83232);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(200, 50, 50, 0.35);
  letter-spacing: 0.02em;
}

/* Node wrap: contains the continuous connecting line and the central dot */
.ja-course-stop-node-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 20px;
  overflow: visible;
}

/* Seamless connecting line starting from dot center to next stop dot */
.ja-course-stop-line {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100% + 2px);
  height: var(--ja-line-thick, 2px);
  background-color: var(--ja-line-col, #94a3b8);
  transform: translateY(-50%);
  z-index: 1;
  pointer-events: none;
}

/* Central dot */
.ja-course-stop-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--ja-dot-col, #0c2340);
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ja-course-stop--highlight .ja-course-stop-dot {
  background-color: var(--ja-highlight-col, #c83232);
  box-shadow: 0 0 0 3px rgba(200, 50, 50, 0.25);
}

/* Stop text content below the dot */
.ja-course-stop-content {
  margin-top: 10px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0 6px;
}

.ja-course-stop-title {
  font-weight: 700;
  color: var(--ja-title-col, #0f2942);
  line-height: 1.35;
  word-break: break-word;
}

.ja-course-stop-sub {
  font-style: italic;
  color: var(--ja-sub-col, #64748b);
  margin-top: 3px;
  line-height: 1.3;
  word-break: break-word;
}

/* Desktop row boundary */
@media (min-width: 1025px) {
  .ja-course-stop.is-row-end .ja-course-stop-line,
  .ja-course-stop:last-child .ja-course-stop-line {
    display: none !important;
  }
}

/* Tablet Breakpoint (769px - 1024px: 4 columns) */
@media (max-width: 1024px) and (min-width: 641px) {
  .ja-course-timeline-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    row-gap: 36px;
  }
  .ja-course-stop .ja-course-stop-line {
    display: block !important;
  }
  .ja-course-stop:nth-child(4n) .ja-course-stop-line,
  .ja-course-stop:last-child .ja-course-stop-line {
    display: none !important;
  }
}

/* Mobile Breakpoint (<= 640px: 2 columns) */
@media (max-width: 640px) {
  .ja-course-timeline-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    row-gap: 30px;
  }
  .ja-course-stop .ja-course-stop-line {
    display: block !important;
  }
  .ja-course-stop:nth-child(2n) .ja-course-stop-line,
  .ja-course-stop:last-child .ja-course-stop-line {
    display: none !important;
  }
  .ja-course-stop-title {
    font-size: 13px !important;
  }
}
