/* ============================================
   CASE STUDY 一覧ページ
   ============================================ */

/* 見出しセクション（白背景） */
.casestudy-intro {
  background: #fff;
  padding: 80px 0 60px;
}

/* 一覧セクション（青背景） */
.casestudy-list {
  background: rgba(75, 100, 130, 1); /* 中間青 */
  padding: 80px 0 120px;
}
.casestudy-list__inner {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 316px;
  box-sizing: border-box;
}
.casestudy-list__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

/* 黒丸3つ（縦並び・中央寄せ） */
.casestudy-list__dots {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  margin-top: 80px;
}
.casestudy-list__dot {
  width: 15px;
  height: 15px;
  background: #383838;
  border-radius: 50%;
}

/* ============================================
   カード（TOP と共通デザイン）
   XD: white bg / 角丸 / 本文24px/40 / 会社24px/40 / ラベル14px/28 / システム20px/28
   ============================================ */
.case-card {
  background: #fff;
  border-radius: 12px;
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.case-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  color: inherit;
}
.case-card__lead {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 24px;
  line-height: 38px;
  letter-spacing: 0;
  color: #2D507F;
  margin: 0 0 22px;
}
.case-card__image {
  margin: 0 0 20px;
}
.case-card__image img {
  display: block;
  width: 100%;
  aspect-ratio: 340 / 260;
  object-fit: cover;
}
.case-card__company {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 24px;
  line-height: 40px;
  letter-spacing: 0;
  color: #000;
  margin: 0 0 14px;
}
.case-card__label {
  display: block;
  background: #2D507F;
  color: #fff;
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 14px;
  line-height: 28px;
  letter-spacing: 0;
  padding: 4px 10px;
  margin-bottom: 8px;
}
.case-card__system {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 20px;
  line-height: 28px;
  letter-spacing: 0;
  color: #2D507F;
  margin: 0;
}

/* ============================================
   詳細ページ
   ============================================ */
.casestudy-detail {
  background: #fff;
  padding: 40px 0 120px;
}
.casestudy-detail__inner {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 316px;
  box-sizing: border-box;
}
.casestudy-detail__lead {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.6;
  color: #2D507F;
  margin: 0 0 24px;
}
.casestudy-detail__company {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.4;
  color: #000;
  margin: 0 0 16px;
}
.casestudy-detail__system-wrap {
  margin-bottom: 60px;
}
/* 導入システム ラベル: 18px Bold / 背景 #486F91 / 幅100% */
.casestudy-detail__label {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: #486F91;
  color: #fff;
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.5;
  padding: 6px 16px;
  margin-bottom: 12px;
}
/* システム名: 24px Bold / Color #486F91 */
.casestudy-detail__system {
  display: block;
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.4;
  color: #486F91;
}

/* メイン画像（上部・全幅・PC/SP共通） */
.casestudy-detail__main-image {
  margin-bottom: 60px;
}
.casestudy-detail__main-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* 本文エリア: PC = 左テキスト / 右サブ画像（2カラム） */
.casestudy-detail__body {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}
.casestudy-detail__sections {
  flex: 1 1 auto;
  min-width: 0;
}
.casestudy-detail__image {
  flex: 0 0 46%;        /* 右カラム（2枚目の画像） */
}
.casestudy-detail__image img {
  display: block;
  width: 100%;
  height: auto;
}
.casestudy-detail__section {
  margin-bottom: 48px;
}
.casestudy-detail__section:last-child {
  margin-bottom: 0;
}
/* 見出し ■: 20px Bold / 下線なし */
.casestudy-detail__heading {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.5;
  color: #2D507F;
  margin: 0 0 16px;
  padding-bottom: 0;
  border-bottom: none;
}
/* 本文テキスト: 17px Medium / line-height 34px */
.casestudy-detail__text {
  font-family: var(--font-ja);
  font-weight: 500;
  font-size: 17px;
  line-height: 34px;
  color: #000;
}
.casestudy-detail__text p {
  margin: 0 0 24px;
}
.casestudy-detail__text p:last-child {
  margin-bottom: 0;
}

/* 前後記事ナビ: 前の記事=左 / 次の記事=右 */
.casestudy-detail__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 80px;
}
.casestudy-detail__nav-link {
  font-family: var(--font-ja);
  font-weight: 500;
  font-size: 22px;
  line-height: 1;
  color: #383838;
  text-decoration: none;
  transition: color 0.3s;
}
.casestudy-detail__nav-link:hover {
  color: #2D507F;
}

.casestudy-detail__back {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}
/* 一覧に戻る: ボーダーなし（プレーンなテキストリンク） */
.casestudy-detail__back-link {
  display: inline-block;
  font-family: var(--font-ja);
  font-weight: 500;
  font-size: 22px;
  line-height: 1;
  color: #383838;
  text-decoration: none;
  padding: 16px 60px;
  border: none;
  background: none;
  transition: color 0.3s;
}
.casestudy-detail__back-link:hover {
  color: #2D507F;
}

/* ============================================
   SP対応
   ============================================ */
@media (max-width: 991.98px) {
  .casestudy-intro {
    padding: 60px 0 40px;
  }
  .casestudy-list {
    padding: 60px 0 80px;
  }
  .casestudy-list__inner {
    padding: 0 20px;          /* カード = 390 - 40 = 350px */
  }
  .casestudy-list__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .case-card {
    border-radius: 20px;      /* 角丸 20 */
    padding: 26px;            /* カードのパディング 26px */
  }
  .case-card__lead {
    font-size: 20px;          /* 見出し 20 Bold */
    line-height: 1.6;
  }
  .case-card__company {
    font-size: 24px;          /* クライアント名 24 Bold */
    line-height: 1.4;
  }
  .case-card__label {
    font-size: 12px;          /* 導入システム 12 Bold */
  }
  .case-card__system {
    font-size: 17px;          /* システム名 17 Bold */
  }
  /* 黒点: TOP・他ページと統一（7.6px） */
  .casestudy-list__dots {
    gap: 16px;
    margin-top: 32px;
  }
  .casestudy-list__dot {
    width: 7.6px;
    height: 7.6px;
  }
  .casestudy-detail {
    padding: 20px 0 80px;
  }
  .casestudy-detail__inner {
    padding: 0 24px;
  }
  .casestudy-detail__lead {
    font-size: 22px;          /* 見出し(昔ながらの…) 22 Bold */
  }
  .casestudy-detail__company {
    font-size: 18px;          /* 株式会社… 18 */
  }
  /* 導入システム / システム名 を縦積み（ラベルは全幅バー） */
  .casestudy-detail__system-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .casestudy-detail__label {
    font-size: 16px;          /* 導入システム 16 */
  }
  .casestudy-detail__system {
    font-size: 18px;          /* 生産計画… 18 */
  }
  /* SP: メイン画像 → サブ画像(全幅) → セクション の縦並び */
  .casestudy-detail__body {
    flex-direction: column;
    gap: 0;
  }
  .casestudy-detail__image {
    order: -1;                /* サブ画像をセクションより前＝メイン画像の直下へ */
    flex: none;
    width: 100%;
    margin-bottom: 24px;
  }
  .casestudy-detail__sections {
    flex: none;
    width: 100%;
  }
  .casestudy-detail__section {
    margin-bottom: 32px;
  }
  .casestudy-detail__heading {
    font-size: 17px;          /* SP見出し（下線なしは共通） */
    margin-bottom: 12px;
  }
  .casestudy-detail__text {
    font-size: 15px;          /* SP本文 */
    line-height: 28px;
  }
  .casestudy-detail__nav {
    margin-top: 48px;
  }
  .casestudy-detail__nav-link {
    font-size: 14px;
  }
  .casestudy-detail__back-link {
    font-size: 16px;
    padding: 14px 36px;
  }
}
