/* ==========================================================================
   RBS陸上教室の3つの特徴 - 統一完全版
   ========================================================================== */

@layer pages {

/* =============================================================================
 * 特徴セクション全体
 * ============================================================================= */

/* 特徴セクションタイトル */
.features-title {
  text-align: center;
  font-size: clamp(34px, 5vw, 52px);
  color: var(--navy-dark);
  margin: clamp(60px, 8vw, 90px) 0 clamp(48px, 6vw, 72px);
  font-weight: var(--font-weight-black);
  position: relative;
  z-index: 2;
  
  /* 日本語改行最適化 */
  word-break: auto-phrase;
  overflow-wrap: break-word;
  hyphens: auto;
  line-break: strict;
  word-spacing: 0.05em;
  letter-spacing: 0.02em;
  font-feature-settings: "palt", "kern";
  -webkit-font-feature-settings: "palt", "kern";
  text-rendering: optimizeLegibility;
}

.features-title::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 8px;
  background: var(--primary-blue);
  border-radius: 4px;
}

/* 特徴セクション全体コンテナ */
#about .features,
.features {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 60px;
  width: 100%;
  position: relative;
  z-index: 2;
}

/* =============================================================================
 * 特徴カード基本スタイル
 * ============================================================================= */

/* 特徴カード */
#about .feature-card,
.feature-card {
  background: var(--white);
  padding: 30px 20px;
  border-radius: 20px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  
  /* 日本語改行最適化 */
  word-break: auto-phrase;
  overflow-wrap: break-word;
  text-align: left;
  hyphens: auto;
  line-break: loose;
  word-spacing: 0.05em;
  letter-spacing: 0.02em;
  font-feature-settings: "palt", "kern";
  -webkit-font-feature-settings: "palt", "kern";
  text-rendering: optimizeLegibility;
}

/* カード上部の青い線 */
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--primary-blue);
  border-radius: 20px 20px 0 0;
}

/* 右上の装飾円 */
.feature-card::after {
  content: '';
  position: absolute;
  top: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: var(--primary-blue);
  border-radius: 50%;
  opacity: 0.1;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.feature-card:hover::after {
  transform: scale(1.5);
  opacity: 0.2;
}

/* =============================================================================
 * 特徴番号
 * ============================================================================= */

.feature-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--primary-blue);
  color: var(--white);
  font-size: 24px;
  font-weight: 800;
  border-radius: 50%;
  margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
  position: relative;
  overflow: hidden;
}

.feature-number::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 4s infinite;
}

/* =============================================================================
 * 特徴タイトルと説明
 * ============================================================================= */

/* 特徴タイトル */
.feature-card h3 {
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--navy-dark);
  line-height: 1.5;
  font-weight: 800;
  
  /* タイトル専用改行強化 */
  word-break: auto-phrase;
  line-break: loose;
  overflow-wrap: anywhere;
  word-spacing: 0.1em;
  letter-spacing: 0.02em;
  text-align: left;
  hyphens: auto;
}

/* 特徴説明 */
.feature-card p {
  line-height: 1.8;
  color: var(--gray-medium);
  font-size: 15px;
  font-weight: 500;
  margin: 0;
  
  /* 説明文専用改行強化 */
  word-break: auto-phrase;
  overflow-wrap: break-word;
  text-align: left;
  letter-spacing: 0.01em;
  hyphens: auto;
}

/* 強調テキスト */
.feature-card strong {
  color: var(--navy-dark);
  font-weight: 700;
  word-break: auto-phrase;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* 色付きテキスト */
.text-primary { 
  color: var(--primary-blue); 
  font-weight: 700;
  word-break: auto-phrase;
  overflow-wrap: anywhere;
}

.text-success { 
  color: var(--primary-teal); 
  font-weight: 700;
  word-break: auto-phrase;
  overflow-wrap: anywhere;
}

.text-warning { 
  color: var(--primary-orange); 
  font-weight: 700;
  word-break: auto-phrase;
  overflow-wrap: anywhere;
}

/* =============================================================================
 * レスポンシブデザイン
 * ============================================================================= */

/* タブレット以上 (768px+) */
@media (min-width: 768px) {
  .features-title {
    margin: 100px 0 80px 0;
  }

  #about .features,
  .features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-top: 80px;
  }

  .feature-card {
    padding: 40px 30px;
    border-radius: 25px;
  }

  .feature-card::before {
    border-radius: 25px 25px 0 0;
  }

  .feature-number {
    width: 60px;
    height: 60px;
    font-size: 28px;
    margin-bottom: 25px;
  }

  .feature-card h3 {
    font-size: 22px;
    margin-bottom: 25px;
    line-height: 1.4;
    word-spacing: 0.05em;
  }

  .feature-card p {
    font-size: 16px;
    line-height: 1.7;
    word-spacing: 0.04em;
  }
}

/* デスクトップ (1200px+) */
@media (min-width: 1200px) {
  .features-title {
    margin: 120px 0 100px 0;
  }

  #about .features,
  .features {
    grid-template-columns: repeat(3, 1fr);
    gap: 50px;
    margin-top: 100px;
  }

  .feature-card {
    padding: 50px 40px;
    border-radius: 30px;
  }

  .feature-card::before {
    border-radius: 30px 30px 0 0;
  }

  .feature-number {
    width: 70px;
    height: 70px;
    font-size: 32px;
    margin-bottom: 30px;
  }

  .feature-card h3 {
    font-size: 26px;
    margin-bottom: 30px;
    line-height: 1.3;
    word-spacing: 0.03em;
  }

  .feature-card p {
    font-size: 17px;
    line-height: 1.6;
    word-spacing: 0.02em;
  }
}

/* モバイル (480px以下) */
@media (max-width: 480px) {
  .features-title {
    font-size: clamp(26px, 7vw, 34px);
    margin: 60px 0 40px 0;
    word-spacing: 0.12em;
    letter-spacing: 0.04em;
    line-break: loose;
  }

  .features-title::after {
    width: 80px;
    height: 6px;
  }

  #about .features,
  .features {
    gap: 25px;
    margin-top: 40px;
  }

  .feature-card {
    padding: 25px 20px;
    border-radius: 15px;
    word-spacing: 0.12em;
    letter-spacing: 0.04em;
    line-break: loose;
  }

  .feature-card::before {
    border-radius: 15px 15px 0 0;
  }

  .feature-number {
    width: 45px;
    height: 45px;
    font-size: 20px;
    margin-bottom: 15px;
  }

  .feature-card h3 {
    font-size: 16px;
    margin-bottom: 15px;
    line-height: 1.4;
    word-spacing: 0.15em;
    letter-spacing: 0.03em;
    overflow-wrap: anywhere;
  }

  .feature-card p {
    font-size: 14px;
    line-height: 1.7;
    word-spacing: 0.12em;
    letter-spacing: 0.02em;
    overflow-wrap: anywhere;
  }
}

/* 極小画面 (375px以下) */
@media (max-width: 375px) {
  .features-title {
    font-size: clamp(18px, 5vw, 24px);
    margin: 50px 0 30px 0;
    word-spacing: 0.15em;
    letter-spacing: 0.05em;
    line-break: anywhere;
  }

  .feature-card {
    padding: 20px 15px;
    word-spacing: 0.15em;
    letter-spacing: 0.05em;
    line-break: anywhere;
  }

  .feature-card h3 {
    font-size: 15px;
    line-height: 1.3;
    word-spacing: 0.18em;
    letter-spacing: 0.04em;
  }

  .feature-card p {
    font-size: 13px;
    line-height: 1.6;
    word-spacing: 0.15em;
    letter-spacing: 0.03em;
  }
}

/* =============================================================================
 * アニメーション
 * ============================================================================= */

@keyframes shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* =============================================================================
 * アクセシビリティ
 * ============================================================================= */

@media (prefers-reduced-motion: reduce) {
  .feature-card,
  .feature-number::before,
  .feature-card::after {
    transition: none;
    animation: none;
  }
}

@media (prefers-contrast: high) {
  .feature-card {
    border: 3px solid var(--navy-dark);
  }
  
  .feature-number {
    box-shadow: 0 0 0 2px var(--white);
  }
}

/* =============================================================================
 * デバッグ用スタイル（開発時のみ）
 * ============================================================================= */

/* デバッグ時にグリッドを可視化（本番では削除推奨）
.features {
  outline: 2px dashed red;
}

.feature-card {
  outline: 1px solid blue;
}
*/

}
