/* ==========================================================================
   依頼メリットセクション
   ファイル: template-parts/merit-section.css
   追記日: 2026/02/26
   
   ※ #content_builder を前置してTCDテーマの既定スタイルに確実に勝つ
   ========================================================================== */

/* --- セクション全体 --- */
#content_builder .ms-merit {
  max-width: 1000px;
  margin: 0 auto;
  padding: 10px 20px 0 !important;
}

/* --- フェーズ別カード --- */
#content_builder .ms-merit__phases {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

/* 1本の通し線（STEP01アイコン中央 ～ STEP03アイコン中央） */
#content_builder .ms-merit__phases::before {
  content: "";
  position: absolute;
  top: 110px; /* padding(40) + STEPラベル(18) + gap(8) + アイコン半径(40) ≒ 106 → 余裕見て110 */
  bottom: 50px;
  left: 40px;
  width: 2px;
  background: #d4e8db;
  z-index: 0;
}

#content_builder .ms-merit__phase {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding: 40px 0;
  position: relative;
}
#content_builder .ms-merit__phase:last-child {
  padding-bottom: 0;
}

/* --- アイコン列 --- */
#content_builder .ms-merit__phase-icon-col {
  flex-shrink: 0;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* --- ステップラベル --- */
#content_builder .ms-merit__phase-step {
  font-size: 11px;
  font-weight: 700;
  color: #006633;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
  text-transform: uppercase;
  position: relative;
  z-index: 2;
  background: #fff;
  padding: 0 4px;
}

/* --- フェーズアイコン --- */
#content_builder .ms-merit__phase-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f0f7f2;
  color: #006633;
  border: 2px solid #c8ddd0;
  position: relative;
  z-index: 2;
}
#content_builder .ms-merit__phase-icon svg {
  width: 36px;
  height: 36px;
  display: block;
}

/* --- フェーズコンテンツ --- */
#content_builder .ms-merit__phase-content {
  flex: 1;
  min-width: 0;
  padding-top: 18px;
}
#content_builder .ms-merit__phase-name {
  font-size: 24px;
  font-weight: 700;
  color: #006633;
  margin: 0 0 6px 0;
  padding: 0;
  line-height: 1.4;
  border: none;
  background: none;
}
#content_builder .ms-merit__phase-subtitle {
  font-size: 14px;
  color: #666;
  margin: 0 0 20px 0;
  padding: 0 0 16px 0;
  line-height: 1.6;
  border-bottom: 1px solid #e8e8e8;
  border-top: none;
  border-left: none;
  border-right: none;
  background: none;
}

/* --- 箇条書き（テーマリセット込み） --- */
#content_builder .ms-merit__phase-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
#content_builder .ms-merit__phase-list li {
  position: relative;
  padding: 0 0 0 20px;
  margin: 0 0 10px 0;
  font-size: 14.5px;
  line-height: 1.8;
  color: #333;
  list-style: none;
  background: none;
  border: none;
}
#content_builder .ms-merit__phase-list li:last-child {
  margin-bottom: 0;
}
#content_builder .ms-merit__phase-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #006633;
}
/* テーマの li マーカーを確実にリセット */
#content_builder .ms-merit__phase-list li::marker {
  content: none;
  display: none;
}

/* --- CTA ラッパー --- */
#content_builder .ms-merit__cta-wrap {
  margin-top: 48px;
}

/* ==========================================================================
   レスポンシブ
   ========================================================================== */
@media screen and (max-width: 768px) {
  #content_builder .ms-merit {
    padding: 10px 16px 0;
  }
  #content_builder .ms-merit__phase {
    gap: 20px;
    padding: 32px 0;
  }
  #content_builder .ms-merit__phase-icon-col {
    width: 64px;
  }
  #content_builder .ms-merit__phases::before {
    left: 32px;
    top: 90px;
    bottom: 44px;
  }
  #content_builder .ms-merit__phase-icon {
    width: 64px;
    height: 64px;
  }
  #content_builder .ms-merit__phase-icon svg {
    width: 30px;
    height: 30px;
  }
  #content_builder .ms-merit__phase-content {
    padding-top: 14px;
  }
  #content_builder .ms-merit__phase-name {
    font-size: 21px;
  }
  #content_builder .ms-merit__cta-wrap {
    margin-top: 36px;
  }
}
@media screen and (max-width: 480px) {
  #content_builder .ms-merit {
    padding: 8px 16px 0;
  }
  #content_builder .ms-merit__phases::before {
    display: none;
  }
  /* カード区切り */
  #content_builder .ms-merit__phase {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 0 12px;
    padding: 0 0 28px 0;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 28px;
  }
  #content_builder .ms-merit__phase:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }
  /* アイコン列：1行目左 */
  #content_builder .ms-merit__phase-icon-col {
    grid-column: 1;
    grid-row: 1;
    width: auto;
    align-items: center;
    justify-content: center;
  }
  #content_builder .ms-merit__phase-step {
    display: none;
  }
  #content_builder .ms-merit__phase-icon {
    width: 44px;
    height: 44px;
  }
  #content_builder .ms-merit__phase-icon svg {
    width: 22px;
    height: 22px;
  }
  /* コンテンツ：display:contents で子要素をグリッドに参加させる */
  #content_builder .ms-merit__phase-content {
    display: contents;
    padding-top: 0;
  }
  /* 見出し：1行目右（アイコン横） */
  #content_builder .ms-merit__phase-name {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    font-size: 19px;
    margin-bottom: 0;
  }
  /* サブタイトル：2行目全幅 */
  #content_builder .ms-merit__phase-subtitle {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 13px;
    margin-top: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }
  /* リスト：3行目全幅 */
  #content_builder .ms-merit__phase-list {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  #content_builder .ms-merit__phase-list li {
    font-size: 14px;
  }
  #content_builder .ms-merit__cta-wrap {
    margin-top: 28px;
    grid-column: 1 / -1;
  }
}
