/* ============================================
   STRENGTHS.CSS - strengths.html専用BEMスタイル
   Block prefix: st- (Strengths)
   ============================================ */

/* ---------- Section ---------- */
.st-section {
  padding: 120px 0 120px 0;
  background: var(--color-bg-white);
  border-radius: 0 clamp(80px, calc(80px + (100vw - 320px) / 10), 400px) 0 0;
}

/* ---------- Amita Strengths Block ---------- */
.st-amita {
  position: relative;
  padding-top: 60px;
}

/* Background accent text */
.st-amita__bg-text {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  min-width: 100%;
  font-size: clamp(3rem, 18vw, 16rem);
  font-weight: 400;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.05em;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Cards container */
.st-amita__cards {
  position: relative;
  z-index: var(--z-base);
  display: grid;
  grid-template-columns: repeat(2, 1fr);  /* ← 960px以上で必ず2列 */
  grid-auto-rows: 1fr;                   /* ← 行の高さを揃える */
  gap: 40px;
  width: 100%;
  max-width: 1320px;
  padding: clamp(200px, 29.23vw - 60.88px, 360px) 0 60px;
  box-sizing: border-box;
}

/* Card wrap (label and card container) */
.st-amita__wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-width: 0;
  height: 100%;  /* ← グリッドの行高さを継承 */
}

/* Individual card */
.st-amita__card {
  background: var(--color-bg-white);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  width: 100%;
  min-width: 0;
  height: 100%;  /* ← カード高さを揃える */
  margin-top: -14px;
  position: relative;
  z-index: var(--z-base);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Card number label */
.st-amita__num {
  display: inline-block;
  font-size: 1rem;
  letter-spacing: 0.1rem;
  font-weight: 600;
  color: var(--color-primary);
  padding: 6px 32px;
  border: 1px solid var(--color-primary);
  border-radius: 20px;
  background: var(--color-bg-white);
  z-index: var(--z-elevated);
  position: relative;
}

/* Card image */
.st-amita__img {
  width: 100%;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.st-amita__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Card title */
.st-amita__title {
  font-size: clamp(1.05rem, 1.6vw, 2rem);  /* ← 2行に収まるサイズに調整 */
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #222;
  line-height: 1.5;  /* ← padding(32px)より小さく保つ */
  padding: 16px 0 24px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;  /* ← 必ず2行 */
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
  overflow-wrap: anywhere;
  flex-shrink: 0;  /* ← 縮小しない */
}

/* Bottom copy with accent band */
.st-amita__copy {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 40px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.st-amita__copy:hover .st-amita__line {
  color: #ffeb3b;
  background-position: 100% 50%;
  transition: color 0.3s ease, background-position 0.5s ease-out;
}

.st-amita__line {
  font-weight: 700;
  color: var(--color-bg-white);
  letter-spacing: 0.02em;
  line-height: 1.3;
  padding: 20px 40px;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background-position 0.5s ease-out;
}

/* PC時（376px以上）: 親要素に統一背景、個別<p>は透明 */
@media (min-width: 376px) {
  .st-amita__line-wrap {
    background: var(--gradient-45);
    background-size: 200% auto;
    background-position: 0% 50%;
    transition: background-position 0.5s ease-out;
    width: fit-content; /* コンテンツ幅に合わせる */
  }
  
  .st-amita__line-wrap:hover {
    background-position: 100% 50%;
  }
  
  .st-amita__line-wrap .st-amita__line--primary {
    background: transparent;
    width: auto; /* テキスト幅 + paddingで自動調整 */
    font-size: clamp(19.5px, 4.8vw, 46.5px);
  }
  
  /* 1行目の右padding、2行目の左paddingを0にして連続表示 */
  .st-amita__line-wrap .st-amita__line--primary:first-child {
    padding-right: 0;
  }
  
  .st-amita__line-wrap .st-amita__line--primary:last-child {
    padding-left: 0;
  }
}

.st-amita__line--primary {
  display: block;
  max-width: 1320px;
  font-size: clamp(19.5px, 4.8vw, 53.9px);
  box-sizing: border-box;
}

.st-amita__line--secondary {
  display: block;
  width: fit-content; /* テキスト幅 + paddingで自動調整 */
  max-width: 100%;
  font-size: clamp(19.5px, 4.8vw, 46.5px);
  box-sizing: border-box;
  background: var(--gradient-45);
  background-size: 200% auto;
  background-position: 0% 50%;
}

/* Wrapper for primary lines - PC: horizontal, Mobile: vertical */
.st-amita__line-wrap {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  width: 100%; /* 親コンテナの幅に合わせる */
  max-width: 100%;
  box-sizing: border-box;
}

/* ============================================
   RESPONSIVE: 768px以下でセクション余白調整
   ============================================ */
@media (max-width: 768px) {
  .st-section {
    padding: 120px 0;
  }
}

/* ============================================
   RESPONSIVE: 960px以下で1カラム化
   ============================================ */
@media (max-width: 960px) {
  :root {
    --title-font-size: clamp(1rem, 4.3vw, 1.9rem);  /* 2カード共通フォントサイズ */
  }

  .st-amita__cards {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: clamp(64px, 26.67vw - 36px, 220px) 0 40px;
  }

  .st-amita__card {
    padding: 40px 40px 24px 40px;
  }

  .st-amita__title {
    font-size: clamp(0.90rem, calc(4.10vw + -0.06rem), 2.40rem);
    line-height: 1.45;  /* 2行維持・paddingより小さく */
  }

  .st-amita__img {
    height: auto !important;
    aspect-ratio: 16 / 9;
    overflow: hidden;
  }

  .st-amita__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .st-amita__copy {
    gap: 40px;
    align-items: flex-start;
  }

  .st-amita__line {
    font-size: clamp(18px, 4.8vw, 53.9px);
    padding: 20px 24px;
    white-space: nowrap;
    letter-spacing: 0.02em;
    line-height: 1.3;
  }
}

/* ============================================
   RESPONSIVE: 769px-1248px - line-wrap overflow fix
   ============================================ */
@media (min-width: 769px) and (max-width: 1248px) {
  .st-amita__line-wrap {
    width: 100%; /* グラデーションからはみ出さないように */
  }
  
  .st-amita__line-wrap .st-amita__line--primary,
  .st-amita__line--secondary {
    font-size: clamp(18px, 5.2vw, 2.2rem);
  }
}

/* ============================================
   RESPONSIVE: 960px以下で3行レイアウト
   ============================================ */
@media (max-width: 960px) {
  .st-amita__copy {
    gap: 16px;
    align-items: stretch;
  }
  
  .st-amita__line-wrap {
    flex-direction: column;
    gap: 16px;
    background: transparent;
  }
  
  /* スマホ時: 個別に背景を設定 */
  .st-amita__line-wrap .st-amita__line--primary,
  .st-amita__line--secondary {
    background: var(--gradient-45);
    background-size: 200% auto;
    background-position: 0% 50%;
    white-space: normal;
    word-break: keep-all;
    padding: 16px;
    margin: 0;
  }
  
  /* 短い行は自然な幅、最長行（3行目）のみ100% */
  .st-amita__line-wrap .st-amita__line--primary {
    width: fit-content;
    min-width: auto;
  }
  
  /* 3行レイアウト時はpaddingを復活 */
  .st-amita__line-wrap .st-amita__line--primary:first-child {
    padding-right: 16px;
  }
  
  .st-amita__line-wrap .st-amita__line--primary:last-child {
    padding-left: 16px;
  }
  
  .st-amita__line--secondary {
    width: 100%;
  }
  
  /* hoverエフェクト */
  .st-amita__copy:hover .st-amita__line {
    background-position: 100% 50%;
  }
}
