/* =========================================================
   service-inpatient.css
   - 入院リハビリテーション詳細ページ専用スタイル
========================================================= */

/* ---------------------------------------------------------
   Hero Section (Unique Background)
--------------------------------------------------------- */
#hero-inpatient {
  /* 共通クラス page-hero-level3 の設定に加え、固有画像を適用（不要なら削除可） */
  /* 今回はHTML側で画像を表示するMinimalスタイルなので背景指定は必須ではありません */
}

/* --- Utilities --- */
.bg-gray {
  background-color: var(--color-gray-light);
  padding: 6rem 0;
}
.mt-4 {
  margin-top: 2rem;
}

/* ---------------------------------------------------------
   4. Features (3 Columns)
--------------------------------------------------------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 50px;
}

.feature-box {
  background: #fff;
  padding: 40px 30px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
  border-bottom: 3px solid var(--color-primary);
  height: 100%;
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  display: inline-block;
}

.feature-box h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 15px;
}

.feature-box p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-main);
  text-align: left;
}

/* ---------------------------------------------------------
   5. Environments (Zig-Zag Layout)
   - 病床・環境別（画像とテキストの交互配置）
--------------------------------------------------------- */
.env-list {
  display: flex;
  flex-direction: column;
  gap: 60px;
  margin-top: 50px;
}

.env-item {
  display: flex;
  align-items: stretch; /* 高さを揃える */
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  /* gap削除 */
}

/* 偶数番目は左右反転 (Zig-Zag) */
.env-item:nth-child(even) {
  flex-direction: row-reverse;
}

.env-img {
  flex: 1; /* 幅50% */
  min-height: 300px;
  position: relative;
}
.env-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute; /* 親に合わせて広げる */
  top: 0;
  left: 0;
  object-position: center 25%;
}

.env-text {
  flex: 1; /* 幅50% */
  padding: 40px 50px; /* PCでの十分な余白 */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.env-text h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 20px;
  position: relative;
  padding-left: 20px;
}
.env-text h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 100%;
  background-color: var(--color-primary);
  border-radius: 2px;
}

.env-text p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-main);
  text-align: justify;
}

/* ---------------------------------------------------------
   6. Diseases (Card Grid)
   - 疾患別カード
--------------------------------------------------------- */
.disease-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 50px;
}

.disease-card {
  background: #fff;
  border: 1px solid var(--color-gray-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
}
.disease-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.disease-thumb {
  width: 100%;
  height: 300px;
  overflow: hidden;
}
.disease-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.disease-card:hover .disease-thumb img {
  transform: scale(1.05);
}

.disease-body {
  padding: 25px;
  flex: 1;
}

.disease-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.disease-body p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-main);
  text-align: justify;
}

/* ---------------------------------------------------------
   7. Flow (Vertical Step)
   - リハビリの流れ（縦型）
--------------------------------------------------------- */
.flow-steps.vertical {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 40px;
  position: relative;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* 連結線 */
.flow-steps.vertical::before {
  content: '';
  position: absolute;
  top: 40px;
  bottom: 40px;
  left: 40px;
  width: 2px;
  background-color: #ddd;
  z-index: 0;
}

.flow-step {
  display: flex;
  position: relative;
  z-index: 1;
  background: transparent;
  padding-bottom: 40px;
}
.flow-step:last-child {
  padding-bottom: 0;
}

.step-num {
  width: 80px;
  height: 80px;
  background-color: #fff;
  border: 4px solid var(--color-primary);
  border-radius: 50%;
  color: var(--color-primary);
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 40px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.step-content {
  flex: 1;
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--color-gray-border);
  position: relative;
  top: 0;
}

.step-content::before {
  content: '';
  position: absolute;
  top: 30px;
  left: -10px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 10px solid #fff;
}

/* ---------------------------------------------------------
   Responsive
--------------------------------------------------------- */
@media (max-width: 900px) {
  /* Tablet */
  .features-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .disease-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Mobile */

  /* Features */
  .features-grid {
    gap: 30px;
  }

  /* Environments (Zig-Zag解除・縦積み) */
  .env-list {
    gap: 40px;
  }
  .env-item,
  .env-item:nth-child(even) {
    flex-direction: column;
    height: auto;
  }

  .env-img {
    width: 100%;
    min-height: 300px;
    position: relative;
    flex: none;
  }
  .env-img img {
    position: relative;
    height: 300px;
  }

  .env-text {
    flex: none;
    width: 100%;
    /* ★修正完了: ここを 0 10px から拡大 */
    padding: 30px 25px;
  }
  .env-text h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
  }

  /* Disease Grid */
  .disease-grid {
    grid-template-columns: 1fr;
  }

  /* Flow */
  .flow-steps.vertical::before {
    display: none;
  }

  .flow-step {
    flex-direction: column;
    padding-bottom: 30px;
  }

  .step-num {
    width: 60px;
    height: 60px;
    font-size: 1.4rem;
    margin-bottom: 15px;
    margin-right: 0;
    align-self: flex-start;
  }

  .step-content {
    width: 100%;
  }
  .step-content::before {
    display: none;
  }
}
