@charset "UTF-8";

/* =========================================
   Reason (選ばれる理由エリア)
   ========================================= */
.reason {
  padding: 12rem 0;
  background-image: url('../images/reason_bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.reason__inner {
  padding: 0 2rem;
}

.reason__header-title {
  margin-bottom: 6rem;
}

/* 理由カードリスト全体 (Flexboxで中央揃え) */
.reason__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4rem 3rem; /* 上下余白 4rem / 左右余白 3rem */
  width: 100%;
  max-width: 132rem;
  margin: 0 auto;
}

.reason__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* PC環境での3列ベースの幅計算 */
  width: calc(33.333% - 2rem);
  max-width: 41.8rem;
}

/* カード単体 (共通CSSの .c-box-outline で枠線と角丸を担保) */
.reason__card {
  width: 100%;
  height: 30.7rem; /* PC時はデザインカンプ通り高さを固定 */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.reason__image {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.reason__image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.reason__text {
  margin-top: 2rem;
  color: var(--color-text-dark);
  font-size: 2.0rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

/* =========================================
   Responsive Settings
   ========================================= */
/* タブレット表示 (768px〜1024px) */
@media (max-width: 1024px) {
  .reason {
    background-image: url('../images/reason_bg_sp.jpg');
    padding: 4rem 0 8rem;
  }
  
  .reason__header-title {
    margin-bottom: 3rem;
  }

  .reason__list {
    gap: 3rem 2rem;
  }

  .reason__item {
    width: calc(50% - 1rem);
  }
  
  .reason__card {
    /* 固定高さを解除し、中の画像に合わせてカードの高さが決まるように変更 */
    height: auto; 
    /* 上下のpaddingを小さく指定。これが直接余白になります */
    padding: 1.5rem 1.5rem; 
  }

  .reason__image {
    height: auto;
  }

  .reason__image img {
    width: 100%;
    height: auto;
    /* 必要に応じて画像の最大高さを制限 */
    max-height: 20rem; 
  }

  .reason__text {
    font-size: 1.4rem;
    white-space: normal;
    line-height: 1.4;
  }
}

/* スマホ表示 (767px以下) */
@media (max-width: 767px) {
  .reason {
    background-image: url('../images/reason_bg_sp.jpg');
    padding: 6rem 0;
  }

  .reason__header-title {
    margin-bottom: 4rem;
  }

  .reason__list {
    flex-direction: column;
    align-items: center;
    gap: 4rem;
  }

  .reason__item {
    width: 100%;
    max-width: 34rem;
  }

  .reason__card {
    height: auto; /* SPも同様に固定高さを解除 */
    padding: 1.5rem;
  }

  .reason__image img {
    max-height: 18rem;
  }

  .reason__text {
    font-size: 1.6rem;
    white-space: normal;
    line-height: 1.4;
  }
}