/* =========================================================
   common.css
   飯塚病院リハビリテーション部 WEBサイト 共通スタイル
   Design Tokens & Base Styles
========================================================= */

/* ------------------------------
   1. Design Tokens (変数定義)
------------------------------ */
:root {
  /* ▼ Colors: ブランド & UI */
  --color-white: #ffffff;
  --color-black: #000000;

  /* グレー階調 */
  --color-gray-light: #f7f7f7; /* 背景用 */
  --color-gray-border: #e9e9e9; /* 境界線用 */
  --color-gray: #999999; /* 英語装飾など */
  --color-gray-dark: #333333; /* 本文など */

  /* ブランドカラー */
  --color-primary: #00a1e9; /* [ブランド] 明るいシアン */
  --color-primary-dark: #1b4b8d; /* [UI/Text] 深いネイビー */

  --color-secondary: #77ba18; /* 教育・新緑 */
  --color-tertiary: #00a999; /* 先進・グローバル */
  --color-accent-gold: #c9a646; /* アクセント */

  /* ▼ Typography: フォントスタック */
  --ff-sans: 'Helvetica Neue', 'Arial', 'Noto Sans JP',
    'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'YuGothic',
    sans-serif;
  --ff-serif: 'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', serif;

  /* ▼ Text Assignments */
  --text-main: var(--color-gray-dark);
  --text-sub: var(--color-gray);
  --text-link: var(--color-primary-dark);
  --text-link-hover: #007bbf;

  /* ▼ Backgrounds */
  --bg-body: var(--color-white);
  --bg-section: var(--color-gray-light);
  --bg-header: rgba(255, 255, 255, 0.98);
  --bg-footer: #f3f4f6;

  /* ▼ Z-Index Management */
  --z-header: 999;
  --z-drawer: 1100;

  /* ▼ Spacing Scale (rem based on 16px) */
  --space-xs: 0.5rem; /* 8px */
  --space-sm: 1rem; /* 16px */
  --space-md: 2.5rem; /* 40px */
  --space-lg: 5rem; /* 80px */
  --space-xl: 7.5rem; /* 120px */
}

/* ------------------------------
   2. Base Settings
------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--ff-sans);
  color: var(--text-main);
  background-color: var(--bg-body);
  line-height: 1.75;
  letter-spacing: 0.03em;
  margin: 0;
  padding-top: 64px; /* PCヘッダー高さ */
}

/* ------------------------------
   3. Typography
------------------------------ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--ff-serif);
  font-weight: 600;
  color: var(--color-black);
  line-height: 1.4;
  letter-spacing: 0.05em;
}

/* ------------------------------
   4. Links & Buttons
------------------------------ */
a {
  color: var(--text-link);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover,
a:focus {
  color: var(--text-link-hover);
}

.btn {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-family: var(--ff-sans);
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
}
.btn:hover {
  background: var(--color-tertiary);
  color: #fff;
}

/* ------------------------------
   5. Utility Classes
------------------------------ */
.container {
  width: min(92%, 1200px);
  margin: 0 auto;
}

.section {
  padding: 4rem 0; /* 64px */
}

.text-center {
  text-align: center;
}
.hidden {
  display: none !important;
}

/* アクセントライン */
.accent-line {
  width: 60px;
  height: 3px;
  background: var(--color-primary);
  margin: 0.75rem auto 2rem;
}

/* ------------------------------
   6. Responsive Base
------------------------------ */
@media (max-width: 1100px) {
  body {
    padding-top: 56px; /* SPヘッダー高さ */
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  .section {
    padding: 2.5rem 0;
  }
  .btn {
    padding: 0.65rem 1.2rem;
    font-size: 0.9rem;
  }
}

/* =========================================================
   Section Lead (共通導入文エリア) - 分離ロジック版
========================================================= */

.section-lead {
  padding: 100px 0;
  background-color: #fff;
}

.section-lead .container-narrow {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

/* --- 共通：PC版の設定 (769px以上) --- */
.lead-heading span,
.lead-text span {
  display: block; /* PCではどちらも意図した位置で改行 */
}

.lead-heading {
  font-family: var(--ff-serif);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  line-height: 1.5;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 40px;
  font-feature-settings: 'palt';
}

.lead-text {
  font-size: 1.05rem;
  line-height: 2.2;
  color: var(--text-main);
}

/* --- Responsive (Mobile: 768px以下) --- */
@media (max-width: 768px) {
  .section-lead {
    padding: 60px 0;
  }

  .section-lead .container-narrow {
    text-align: left; /* スマホでは左寄せ */
  }

  /* 【重要】見出し(h2)の制御：
     スマホでも display: block を維持し、デザイン崩れを防ぐ
  */
  .lead-heading span {
    display: block;
    margin-bottom: 0.2em; /* 行間を少し調整 */
  }

  /* 【重要】本文(lead-text)の制御：
     スマホでは display: inline にして、文章を繋げる
  */
  .lead-text span {
    display: inline;
  }

  .lead-heading {
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 25px;
  }

  .lead-text {
    font-size: 1rem;
    line-height: 1.8;
  }
}

/* =========================================================
   8. Common Components (Section & Headers)
   - 全ページ共通のセクション見出しと背景
========================================================= */

/* 基本セクション余白 */
.section-content {
  padding: 5rem 0; /* 80px */
}

/* グレー背景ユーティリティ */
.bg-gray {
  background-color: var(--color-gray-light);
}

/* セクション見出しコンテナ */
.section-header {
  margin-bottom: 4.5rem; /* コンテンツとの間隔 (テキストが入ると伸びるので少し詰める) */
  text-align: left;
}

/* 中央揃え用修飾クラス */
.section-header.text-center {
  text-align: center;
}

/* 英語タイトル (上の小さい文字) */
.en-title {
  display: block;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem; /* 少し広げて抜け感を出す */
  text-transform: uppercase;
}

/* 日本語タイトル (下の大きい文字) */
.ja-title {
  font-family: var(--ff-serif);
  font-size: 2rem; /* 存在感を出すため少しサイズアップ */
  color: var(--text-main);
  margin: 0;
  line-height: 1.4;
  font-feature-settings: 'palt';
}

/* ★追加: タイトル下の補足テキスト */
.section-lead-text {
  margin-top: 1.8rem; /* タイトルとの間に十分な余白を確保 */
  font-size: 1rem;
  line-height: 1.9; /* 行間を広げて読みやすく */
  color: var(--text-main);
  font-weight: 500;
  display: inline-block; /* text-center時に中央にまとまるように */
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .section-content {
    padding: 3.75rem 0; /* 60px */
  }

  .section-header {
    margin-bottom: 3.5rem;
  }

  .en-title {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
  }

  .ja-title {
    font-size: 1.6rem; /* 24-26px */
  }

  /* スマホでのテキスト調整 */
  .section-lead-text {
    margin-top: 1.2rem;
    font-size: 0.9rem;
    text-align: justify; /* スマホでは左揃え(両端揃え)が見やすい場合が多い */
    text-align-last: left;
    display: block;
  }
  /* 親がcenter指定でも、スマホの長文は左寄せにする */
  .section-header.text-center .section-lead-text {
    text-align: left;
  }
}

/* =========================================================
   9. Common CTA Section (Refined & Centered)
========================================================= */
.section-cta {
  padding: 7.5rem 0 6.25rem; /* 120px / 100px */
  background-color: var(--color-white);
  text-align: center;
  border-top: 1px solid var(--color-gray-border);
}

.section-cta .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* タイトル */
.cta-title {
  font-family: var(--ff-serif);
  font-size: 1.75rem;
  color: var(--text-main);
  margin-bottom: 2.5rem; /* 40px */
  line-height: 1.8;
  letter-spacing: 0.08em;
  text-align: center;
  width: 100%;
}

/* 本文 */
.cta-text {
  font-family: var(--ff-sans);
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 3.75rem; /* 60px */
  line-height: 2;
  letter-spacing: 0.05em;
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* ボタンエリア */
.cta-buttons {
  display: flex;
  justify-content: center;
  width: 100%;
  gap: 30px;
}

/* ボタン本体 */
.cta-buttons .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  padding: 0.875rem 1.875rem;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: #fff;
  background-color: var(--color-primary);
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 161, 233, 0.2);
}

.cta-buttons .btn::after {
  content: '→';
  margin-left: 10px;
  font-family: Arial, sans-serif;
  transition: transform 0.2s;
}

.cta-buttons .btn:hover {
  background-color: var(--color-tertiary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 161, 233, 0.3);
}

.cta-buttons .btn:hover::after {
  transform: translateX(4px);
}

/* Responsive (CTA) */
@media (max-width: 768px) {
  .section-cta {
    padding: 5rem 0;
  }

  .cta-title {
    font-size: 1.4rem;
    margin-bottom: 1.875rem;
  }

  .cta-text {
    font-size: 0.9rem;
    text-align: left;
    margin-bottom: 2.5rem;
  }

  .cta-buttons .btn {
    width: 100%;
    max-width: 280px;
    padding: 1rem 1.25rem;
  }
}

@media (max-width: 768px) {
  /* ... 既存のコード ... */

  .section-cta {
    padding: 5rem 0;
  }

  /* ★追加: ボタンを包むコンテナを縦並びにする */
  .cta-buttons {
    flex-direction: column; /* 縦積みに変更 */
    gap: 20px; /* ボタン間の余白 */
    align-items: center; /* 中央揃え */
  }

  .cta-buttons .btn {
    width: 100%;
    max-width: 280px; /* ボタンの最大幅 */
    padding: 1rem 1.25rem;
    /* marginなどは gap で制御するので削除してもOK */
  }
}
