.wp-block-kinako-step-item {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-bottom: var(--kinako-step-item-margin-bottom, 2rem);
}

.wp-block-kinako-step-item:last-child {
  margin-bottom: 0;
}

@media (min-width: 640px) {
  .wp-block-kinako-step-item {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1.5rem;
    align-items: flex-start;
  }
}

/* ==========================================
 * コンテンツ領域の共通スタイル (ステップ・タイムライン共通)
 * ========================================== */
.kinako-step-item-content {
  background-color: var(--kinako-step-content-bg, transparent);
  border-style: solid;
  border-width: var(--kinako-step-content-border-width, 0px);
  border-color: var(--kinako-step-content-border-color, transparent);
  border-radius: var(--kinako-step-content-border-radius, 0px);
  padding: var(--kinako-step-content-padding, 0);
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--kinako-step-content-gap, 0);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ==========================================
 * 1. ステップ形式 (style-step)
 * ========================================== */
.wp-block-kinako-step-item.style-step {
  position: relative;
}

/* スマホ表示時：子要素を接続線の右側にインデント配置 */
.wp-block-kinako-step-item.style-step .kinako-step-item-content {
  padding-left: 2.5rem;
}

@media (min-width: 640px) {
  .wp-block-kinako-step-item.style-step .kinako-step-item-content {
    padding-left: 0;
  }
}

/* 接続線: 左側 (left: 1.25rem) に配置、上バッジから下バッジまで密着 */
.wp-block-kinako-step-item.style-step::before {
  content: "";
  position: absolute;
  top: 1rem;
  bottom: calc(-1 * var(--kinako-step-item-margin-bottom, 2rem) - 1rem);
  left: 1.25rem;
  width: 2px;
  background-color: var(
    --kinako-step-line-color,
    var(--wp--preset--color--primary, #2563eb)
  );
  z-index: 1;
}

.wp-block-kinako-step-item:last-child.style-step::before {
  display: none;
}

.wp-block-kinako-step-item.style-step .kinako-step-item-header {
  position: relative;
  display: flex;
  align-items: center;
  z-index: 2;
  margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
  .wp-block-kinako-step-item.style-step .kinako-step-item-header {
    margin-bottom: 0;
  }
}

.wp-block-kinako-step-item.style-step .kinako-step-item-badge {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  background-color: var(--kinako-step-badge-bg, var(--wp--preset--color--primary, #2563eb));
  color: var(--kinako-step-badge-color, #ffffff);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  border-radius: 9999px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

/* バッジの形状バリエーション */
.wp-block-kinako-step-item.style-step .kinako-step-item-badge.badge-shape-pill {
  border-radius: 9999px;
}

.wp-block-kinako-step-item.style-step .kinako-step-item-badge.badge-shape-rounded {
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
}

.wp-block-kinako-step-item.style-step .kinako-step-item-badge.badge-shape-square {
  border-radius: 0px;
  padding: 0.35rem 0.75rem;
}

.wp-block-kinako-step-item.style-step .kinako-step-item-badge.badge-shape-circle {
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  aspect-ratio: 1 / 1;
  padding: 0;
  box-sizing: border-box;
  flex-shrink: 0;
}

/* ==========================================
 * 2. タイムライン形式 (style-timeline)
 * ========================================== */
.wp-block-kinako-step-item.style-timeline {
  position: relative;
}

.wp-block-kinako-step-item.style-timeline .kinako-step-item-content {
  padding-left: 1.75rem;
}

@media (min-width: 640px) {
  .wp-block-kinako-step-item.style-timeline .kinako-step-item-content {
    padding-left: 0;
  }
}

/* タイムライン接続線: 左側ドット (left: 0.6rem) に配置、上下密着 */
.wp-block-kinako-step-item.style-timeline::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  bottom: calc(-1 * var(--kinako-step-item-margin-bottom, 2rem) - 0.5rem);
  left: 0.6rem;
  width: 2px;
  background-color: var(
    --kinako-step-line-color,
    var(--wp--preset--color--primary, #2563eb)
  );
  z-index: 1;
}

.wp-block-kinako-step-item:last-child.style-timeline::before {
  display: none;
}

.wp-block-kinako-step-item.style-timeline .kinako-step-item-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  z-index: 2;
  margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
  .wp-block-kinako-step-item.style-timeline .kinako-step-item-header {
    margin-bottom: 0;
  }
}

.wp-block-kinako-step-item.style-timeline .kinako-step-item-badge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  z-index: 2;
}

.wp-block-kinako-step-item.style-timeline .kinako-timeline-dot {
  position: relative;
  z-index: 2;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background-color: var(
    --kinako-step-badge-bg,
    var(--wp--preset--color--primary, #2563eb)
  );
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px
    var(--kinako-step-badge-bg, var(--wp--preset--color--primary, #2563eb));
}

.wp-block-kinako-step-item.style-timeline .kinako-timeline-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(
    --kinako-step-line-color,
    var(--wp--preset--color--primary, #2563eb)
  );
  letter-spacing: 0.03em;
}

.kinako-step-item-content > *:first-child {
  margin-top: 0;
}

.kinako-step-item-content > *:last-child {
  margin-bottom: 0;
}

.kinako-step-item-content h1,
.kinako-step-item-content h2,
.kinako-step-item-content h3,
.kinako-step-item-content h4,
.kinako-step-item-content h5,
.kinako-step-item-content h6 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--wp--preset--color--heading, #1e293b);
}

.kinako-step-item-content .wp-block-image,
.kinako-step-item-content .wp-block-gallery,
.kinako-step-item-content .wp-block-columns {
  margin-top: 1rem;
  margin-bottom: 1rem;
}
