/**
 * File Name: process-support-flow.css
 * 2026-07-13 | Final Check (見出しゆとり調整・アロー完全最適化版)
 */

/* ==============================================================================
 * FLOWS PART (提供フロー)
 * ============================================================================== */
.p-common-service-contents-features-flows-section {
  width: 100%;
  padding: 40px 0 60px 0;
  background-color: #ffffff;
  color: #333333;
  font-family: "Helvetica Neue", Arial, "BIZ UDPGothic", "Meiryo", sans-serif;
  line-height: 1.7;
  box-sizing: border-box;
}

.p-common-service-contents-features-flows-section *,
.p-common-service-contents-features-flows-section *::before,
.p-common-service-contents-features-flows-section *::after {
  box-sizing: border-box;
}

.p-common-service-contents-features-flows-container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

.p-common-service-contents-flows-part__title {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--upper-color-2, #2b4365);
  margin: 0 0 35px 0;
  padding-bottom: 16px;
  border-bottom: 5px solid var(--upper-color-1, #1d3d5e);
  letter-spacing: 0.02em;
}

.p-common-service-contents-flows-part {
  width: 100%;
}

.p-common-service-contents-flows-list {
  display: flex;
  flex-direction: column;
  gap: 45px; /* カードの下の隙間を45pxに固定 */
}

.p-common-service-contents-flows-card {
  flex: 1;
  background-color: #ffffff;
  text-align: center;
  position: relative;
}

/* 🛠️ スマホ縦用の下向き「▼」アロー */
.p-common-service-contents-flows-card:not(:last-child)::after {
  content: "▼";
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(
    -50%
  ); /* 修正：これで自分の横幅の半分だけ左に戻り、完全中央になります */
  color: #3b821a;
  font-size: 1.3rem;
  font-weight: bold;
  z-index: 2;
}

.p-common-service-contents-flows-card__step-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 16px 0;
  background-color: var(--upper-color-1, #1d3d5e);
  padding: 12px 10px;
  border-radius: 6px;
  line-height: 1.4;
}

/* 🛠️ スマホ時に画像が115pxに縮んでしまう制限を全解除 */
.p-common-service-contents-flows-card__image {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 3 / 2;
  margin: 0 auto 15px auto;
  border-radius: 0px;
  overflow: hidden;
  box-shadow: none;
}

/* 🛠️ 画像自体の表示設定 */
.p-common-service-contents-flows-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.p-common-service-contents-flows-card__details-list {
  margin: 0 auto;
  padding: 0;
  list-style: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 280px;
}

.p-common-service-contents-flows-card__details-list li {
  font-size: 1rem;
  color: #444444;
  line-height: 1.6;
  position: relative;
  padding-left: 18px;
}

.p-common-service-contents-flows-card__details-list li::before {
  content: "・";
  position: absolute;
  left: 0;
  top: 0;
  color: #3b821a;
  font-weight: bold;
}

.p-common-service-contents-flows-card__desc {
  display: none;
}

/* スマホ縦画面での他ファイルからのアロー（::before）の干渉を確実にブロック */
body
  .p-common-service-contents-flows-list
  .p-common-service-contents-flows-card::before {
  content: none !important;
  display: none !important;
}

/* ==============================================================================
 * MEDIA QUERIES
 * ============================================================================== */

/* スマホ横向き（低画面高） */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .p-common-service-contents-features-flows-section {
    padding: 30px 0 40px 0;
  }
  .p-common-service-contents-flows-part__title {
    font-size: 1.5rem;
    margin-bottom: 25px;
  }
  .p-common-service-contents-flows-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 40px 20px;
  }
  .p-common-service-contents-flows-card {
    flex: none;
  }
  .p-common-service-contents-flows-card:not(:last-child)::after {
    display: none;
  }
  .p-common-service-contents-flows-card::before {
    content: "➔";
    position: absolute;
    top: 30%;
    right: -16px;
    transform: translateY(-50%);
    color: #c8e2d0;
    font-size: 1.3rem;
    font-weight: bold;
    z-index: 2;
  }
  .p-common-service-contents-flows-card:last-child::before {
    display: none;
  }
  .p-common-service-contents-flows-card:first-child:nth-last-child(4),
  .p-common-service-contents-flows-card:first-child:nth-last-child(4)
    ~ .p-common-service-contents-flows-card,
  .p-common-service-contents-flows-card:first-child:nth-last-child(8),
  .p-common-service-contents-flows-card:first-child:nth-last-child(8)
    ~ .p-common-service-contents-flows-card {
    width: calc((100% - 60px) / 4);
  }
  .p-common-service-contents-flows-card:first-child:nth-last-child(6),
  .p-common-service-contents-flows-card:first-child:nth-last-child(6)
    ~ .p-common-service-contents-flows-card {
    width: calc((100% - 40px) / 3);
  }
  .p-common-service-contents-flows-list:has(> :nth-child(6):last-child)
    .p-common-service-contents-flows-card:nth-child(3)::before {
    display: none;
  }
  .p-common-service-contents-flows-list:has(> :nth-child(8):last-child)
    .p-common-service-contents-flows-card:nth-child(4)::before {
    display: none;
  }

  /* 🛠️ 【修正】高さを一律固定して1行・2行どちらも高さを完全に統一 */
  .p-common-service-contents-flows-card__step-title {
    font-size: 1.05rem;
    padding: 0 5px; /* 上下paddingをゼロにして高さとflexで完全制御 */
    height: 62px; /* 2行表示が余裕で収まる高さに固定 */
    display: flex;
    align-items: center; /* 縦方向の上下中央揃え */
    justify-content: center; /* 横方向の左右中央揃え */
    line-height: 1.3;
    margin: 0 0 16px 0;
    background-color: var(--upper-color-1, #1d3d5e);
    border-radius: 6px;
    color: #ffffff;
    font-weight: 700;
  }

  .p-common-service-contents-flows-card__image {
    max-width: 100%;
    margin-bottom: 10px;
  }
  .p-common-service-contents-flows-card__details-list {
    max-width: 100%;
  }
}

/* タブレット・標準PCサイズ */
@media screen and (min-width: 768px) and (min-height: 501px) {
  .p-common-service-contents-features-flows-section {
    padding: 60px 0 80px 0;
  }
  .p-common-service-contents-features-flows-container {
    padding: 0 30px;
  }
  .p-common-service-contents-flows-part__title {
    font-size: 2.2rem;
    margin-bottom: 45px;
  }

  /* 1. 親リストをPC用の「横並び・複数行折り返し」の形に変更 */
  body .p-common-service-contents-flows-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 60px 30px;
  }

  .p-common-service-contents-flows-card {
    flex: none;
    position: relative;
  }

  /* 2. 【新・アロー制御】各カードの「右側」に対して共通の「＞」を生成して配置 */
  body
    .p-common-service-contents-flows-list
    .p-common-service-contents-flows-card::after {
    content: "" !important;
    display: block !important;
    position: absolute;

    /* 横位置：カードの右端から外側の隙間（30px）の真ん中へスライド */
    right: -15px;
    left: auto;
    transform: translate(50%, -50%) rotate(45deg) !important;

    /* 縦位置：見出しパーツの可変高さを考慮して70pxベースの垂直中央に微調整 */
    top: calc(70px + (100% - 70px) / 2);

    /* ＞ 矢印のデザイン（共通カラー #0ac5b4 を適用） */
    width: 12px;
    height: 12px;
    border-top: 3px solid #0ac5b4;
    border-right: 3px solid #0ac5b4;
    border-bottom: 0px none transparent;
    border-left: 0px none transparent;

    pointer-events: none;
    z-index: 99;
  }

  /* 3. 【ピンポイント打ち消し】各行の右端と、全体の最後の右アローだけを強制非表示 */

  /* 全体の最後の要素には不要 */
  body
    .p-common-service-contents-flows-list
    .p-common-service-contents-flows-card:last-child::after {
    content: none !important;
    display: none !important;
  }

  /* 3カラム構成のとき、1行目右端（③）の右アローを非表示 */
  body
    .p-common-service-contents-flows-list:has(> :nth-child(6):last-child)
    .p-common-service-contents-flows-card:nth-child(3)::after {
    content: none !important;
    display: none !important;
  }

  /* 4カラム構成のとき、1行目右端（④）の右アローを非表示 */
  body
    .p-common-service-contents-flows-list:has(> :nth-child(4):nth-last-child(1))
    .p-common-service-contents-flows-card:nth-child(4)::after,
  body
    .p-common-service-contents-flows-list:has(> :nth-child(8))
    .p-common-service-contents-flows-card:nth-child(4)::after {
    content: none !important;
    display: none !important;
  }

  /* 過去の共通CSSのbefore（左矢印）による干渉を完全に断ち切る */
  body
    .p-common-service-contents-flows-list
    .p-common-service-contents-flows-card::before {
    content: none !important;
    display: none !important;
  }

  /* 4. カラム（段組）幅の計算ロジック */
  .p-common-service-contents-flows-card:first-child:nth-last-child(4),
  .p-common-service-contents-flows-card:first-child:nth-last-child(4)
    ~ .p-common-service-contents-flows-card {
    width: calc((100% - 90px) / 4);
  }
  .p-common-service-contents-flows-card:first-child:nth-last-child(6),
  .p-common-service-contents-flows-card:first-child:nth-last-child(6)
    ~ .p-common-service-contents-flows-card {
    width: calc((100% - 60px) / 3);
  }
  .p-common-service-contents-flows-card:first-child:nth-last-child(8),
  .p-common-service-contents-flows-card:first-child:nth-last-child(8)
    ~ .p-common-service-contents-flows-card {
    width: calc((100% - 90px) / 4);
  }

  /* 5. 見出しの高さの固定を解除し、最低高さを担保しつつゆとりを持たせる */
  .p-common-service-contents-flows-card__step-title {
    font-size: 1.15rem; /* 1.25remから少しだけ小さくして余裕を持たせる */
    height: auto; /* 固定解除 */
    min-height: 54px; /* 2行の時でも窮屈にならない最低高さ */
    max-height: none; /* 固定解除 */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 16px 0;
    line-height: 1.3; /* 行間を少し詰め、上下の余白（ゆとり）を確保 */
    padding: 8px 6px; /* 左右上下に少しクッションを入れる */
  }

  .p-common-service-contents-flows-card__image {
    max-width: 100%;
  }
  .p-common-service-contents-flows-card__details-list {
    max-width: 100%;
    gap: 12px;
  }
  .p-common-service-contents-flows-card__details-list li {
    font-size: 1.05rem;
  }
}

/* 大型デスクトップサイズ */
@media screen and (min-width: 1024px) and (min-height: 501px) {
  .p-common-service-contents-features-flows-section {
    padding: 70px 0 100px 0;
  }
}
