/* ========================================
   導入事例セクション専用スタイル
   ======================================== */

/* カラー変数定義 */
:root {
  --primary-color: #0066cc;
  --secondary-color: #f0f5ff;
  --accent-color: #ff6b35;
  --text-dark: #333333;
  --text-light: #666666;
  --border-color: #e0e0e0;
  --white: #ffffff;
  --light-gray: #f8f9fa;
}

/* ========================================
   導入事例セクション全体
   ======================================== */
#benefit-section {
  background-color: var(--light-gray);
  padding: 60px 0;
}

/* ========================================
   セクションヘッダー
   ======================================== */
.benefit-header {
  text-align: center;
  margin-bottom: 50px;
}

.benefit-header h2 {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 15px;
}

.benefit-header .subtitle {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.benefit-header .description {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto;
}

/* ========================================
   フィルタータブ
   ======================================== */
.filter-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 10px 20px;
  border: 2px solid var(--border-color);
  background-color: var(--white);
  color: var(--text-dark);
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  font-family: 'Noto Sans JP', sans-serif;
}

.filter-tab:hover {
  border-color: var(--primary-color);
  background-color: var(--primary-color);
  color: var(--white);
}

.filter-tab.active {
  border-color: var(--primary-color);
  background-color: var(--primary-color);
  color: var(--white);
}

.filter-tab:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ========================================
   導入事例カードグリッド
   ======================================== */
.case-study-grid {
  display: grid;
  /* 5件以下でも均等に配置 */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 50px;
  /* 最小限の幅を確保して、少ないカード数でも見栄え良くする */
  min-height: auto;
}

/* 5件以下の場合は左寄せから中央寄せに変更 */
@supports (width: 100%) {
  .case-study-grid {
    justify-items: stretch;
  }
}

/* ========================================
   導入事例カードリンク（全体をリンク化）
   ======================================== */
.case-card-link-wrapper {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
  /* 最小幅を設定して、少ない件数でもバランスを取る */
  min-width: 280px;
}

.case-card-link-wrapper:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 10px;
}

/* ========================================
   導入事例カード
   ======================================== */
.case-card {
  background-color: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
  /* カードを完全に埋める */
  width: 100%;
}

.case-card-link-wrapper:hover .case-card {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-4px);
}

/* カード画像 */
.case-card-image {
  width: 100%;
  height: 260px;
  overflow: hidden;
  background-color: var(--secondary-color);
  flex-shrink: 0;
}

.case-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.case-card-link-wrapper:hover .case-card-image img {
  transform: scale(1.05);
}

/* カードコンテンツ */
.case-card-content {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  /* 下部の余白を自動的に調整 */
  justify-content: space-between;
}

/* カテゴリバッジ */
.case-card-category {
  display: inline-block;
  background-color: var(--secondary-color);
  color: var(--primary-color);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  width: fit-content;
  font-family: 'Noto Sans JP', sans-serif;
  flex-shrink: 0;
}

/* カード内のタイトル */
.case-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
  line-height: 1.6;
  flex-grow: 1;
  font-family: 'Noto Sans JP', sans-serif;
}

/* 企業名 */
.case-card-company {
  font-size: 13px;
  color: var(--text-light);
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
  margin-bottom: 12px;
  font-family: 'Noto Sans JP', sans-serif;
  flex-shrink: 0;
}

/* リンクテキスト */
.case-card-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  font-family: 'Noto Sans JP', sans-serif;
  flex-shrink: 0;
}

.case-card-link-wrapper:hover .case-card-link {
  gap: 12px;
  color: var(--accent-color);
}

/* ========================================
   レスポンシブデザイン
   ======================================== */

/* デスクトップ（大画面）：2行3列の配置 */
@media (min-width: 1200px) {
  .case-study-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* タブレット（1024px-1199px）：2行2列の配置 */
@media (min-width: 769px) and (max-width: 1199px) {
  .case-study-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .case-card-link-wrapper {
    min-width: auto;
  }
}

/* タブレット（768px以下）：1列配置 */
@media (max-width: 768px) {
  .benefit-header h2 {
    font-size: 28px;
  }

  .benefit-header .subtitle {
    font-size: 14px;
  }

  .benefit-header .description {
    font-size: 13px;
  }

  .case-study-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .case-card-link-wrapper {
    min-width: auto;
  }

  .filter-tabs {
    gap: 8px;
  }

  .filter-tab {
    padding: 8px 15px;
    font-size: 12px;
  }
}

/* スマートフォン（480px以下） */
@media (max-width: 480px) {
  .benefit-header {
    margin-bottom: 30px;
  }

  .benefit-header h2 {
    font-size: 24px;
    margin-bottom: 10px;
  }

  .benefit-header .subtitle {
    font-size: 13px;
  }

  .benefit-header .description {
    font-size: 12px;
  }

  .filter-tabs {
    gap: 6px;
    margin-bottom: 30px;
  }

  .filter-tab {
    padding: 7px 12px;
    font-size: 11px;
  }

  .case-study-grid {
    gap: 12px;
  }

  .case-card-image {
    height: 150px;
  }

  .case-card-content {
    padding: 16px;
  }

  .case-card-category {
    font-size: 11px;
    padding: 5px 10px;
    margin-bottom: 10px;
  }

  .case-card-title {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .case-card-company {
    font-size: 12px;
    padding: 10px 0;
    margin-bottom: 10px;
  }

  .case-card-link {
    font-size: 12px;
  }
}

/* ========================================
   カード表示・非表示アニメーション
   ======================================== */
.case-card-link-wrapper {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.case-card-link-wrapper[style*="display: none"] {
  opacity: 0;
  pointer-events: none;
}

/* ========================================
   印刷時のスタイル
   ======================================== */
@media print {
  .filter-tabs {
    display: none;
  }

  .case-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid var(--border-color);
  }

  .case-card-link {
    display: none;
  }
}

/* ============ case detail ============ */

.case-detail-wrap {
	width: 100%;
	height: auto;
	padding: 60px 0;
	max-width: 1000px;
	margin: 0 auto;
}

.case-detail-header {
	margin-bottom: 40px;
	text-align: center;
}

.case-detail-title {
	font-size: min(3vw, 36px);
	font-weight: bold;
	color: #333;
	margin-bottom: 20px;
}

.case-detail-lead {
	font-size: 18px;
	line-height: 1.8;
	color: #666;
	margin-bottom: 0;
}

/* ============ メイン画像と企業情報（左右配置） ============ */

.case-detail-profile-wrapper {
	margin-bottom: 60px;
}

.case-detail-imgarea-main {
	margin-bottom: 0;
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 20px;
}

.case-detail-imgsize-main {
	width: 100%;
	height: auto;
	display: block;
}

/* 企業情報 */
.case-detail-profile {
	background-color: #f9f9f9;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 30px;
	height: 100%;
}

.profile-item {
	margin-bottom: 25px;
	padding-bottom: 20px;
	border-bottom: 1px solid #e0e0e0;
}

.profile-item:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.profile-label {
	font-size: 11px;
	font-weight: bold;
	color: #083692;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 8px;
}

.profile-value {
	font-size: 16px;
	color: #333;
	font-weight: bold;
	line-height: 1.4;
}

/* ============ セクション共通 ============ */

.case-section {
	margin-bottom: 80px;
}

.case-section-title {
	font-size: min(2vw, 28px);
	font-weight: bold;
	color: #083692;
	margin-bottom: 40px;
	padding-bottom: 15px;
	border-bottom: 3px solid #083692;
	text-align: center;
}

/* ============ お困りごと（文章形式） ============ */

.case-problem-text-area {
	line-height: 1.8;
}

.case-problem-text-area p {
	font-size: 15px;
	color: #666;
	margin-bottom: 20px;
}

.case-problem-text-area p:first-child {
	margin-bottom: 30px;
}

.case-problem-text-area p strong {
	color: #333;
	font-weight: bold;
}


/* ============ 導入効果（文章形式） ============ */

.case-effect-text-area {
	line-height: 1.8;
}

.case-effect-text-area > p {
	font-size: 15px;
	color: #666;
	margin-bottom: 30px;
}

.case-effect-text-area >p strong {
	color: #083692;
	font-weight: bold;
}


.case-effect-highlight-box {
	background-color: #D6EAF8;
	border-left: 4px solid #083692;
	padding: 25px 30px;
	margin: 40px 0;
	border-radius: 4px;
}

.case-effect-quote {
	font-size: 16px;
	line-height: 1.8;
	color: #083692;
	font-weight: bold;
	font-style: italic;
}

.case-effect-list-section {
	margin: 40px 0;
}

.case-effect-subtitle {
	font-size: 16px;
	font-weight: bold;
	color: #333;
	margin-bottom: 15px;
	padding-bottom: 10px;
	border-bottom: 2px solid #083692;
}

.case-effect-list-section p {
	font-size: 15px;
	color: #666;
	line-height: 1.8;
	margin-bottom: 0;
}


/* ============ 関連事例 ============ */

.case-list-card-small {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 15px;
	text-align: center;
	background-color: #f9f9f9;
	transition: box-shadow 0.3s ease;
	margin-bottom: 20px;
}

.case-list-card-small:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.case-list-imgarea-small {
	margin-bottom: 15px;
	overflow: hidden;
	border-radius: 6px;
}

.case-list-imgsize-small {
	width: 100%;
	height: 120px;
	object-fit: cover;
	display: block;
}

.case-list-subtitle-small {
	font-size: 12px;
	font-weight: bold;
	color: #083692;
	margin-bottom: 8px;
	line-height: 1.3;
}

.case-list-company-small {
	font-size: 11px;
	font-weight: bold;
	color: #333;
	margin-bottom: 10px;
}

.case-list-btnarea-small {
	text-align: center;
}

.case-list-btnarea-small a {
	text-decoration: none;
	display: inline-block;
}

.case-list-btn-small {
	display: inline-block;
	background-color: #083692;
	color: white;
	padding: 8px 15px;
	border-radius: 4px;
	font-size: 11px;
	transition: background-color 0.3s ease;
}

.case-list-btnarea-small a:hover .case-list-btn-small {
	background-color: #0A47C2;
}

/* 関連事例なし */
.no-related {
  text-align: center;
  color: #999;
  padding: 30px;
  grid-column: 1 / -1;
}


/* ページナビゲーション */
.case-detail-navigation {
  margin-top: 60px;
  margin-bottom: 60px;
  padding-top: 40px;
  border-top: 1px solid #e0e0e0;
}

.case-detail-nav-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.case-detail-backbtn,
.case-detail-listbtn,
.case-detail-nextbtn {
  flex: 0 1 auto;
}

.case-detail-backbtn a,
.case-detail-listbtn a,
.case-detail-nextbtn a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  text-decoration: none;
  border: 1px solid #333;
  border-radius: 4px;
  color: #333;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.case-detail-backbtn a:hover,
.case-detail-listbtn a:hover,
.case-detail-nextbtn a:hover {
  background-color: #333;
  color: #fff;
}

.case-detail-backbtn a .glyphicon,
.case-detail-listbtn a .glyphicon,
.case-detail-nextbtn a .glyphicon {
  margin: 0 8px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .case-detail-nav-container {
    flex-wrap: wrap;
    gap: 15px;
  }

  .case-detail-backbtn,
  .case-detail-listbtn,
  .case-detail-nextbtn {
    flex: 1 1 calc(50% - 8px);
    min-width: 140px;
  }

  .case-detail-listbtn {
    flex-basis: 100%;
  }

  .case-detail-backbtn a,
  .case-detail-listbtn a,
  .case-detail-nextbtn a {
    padding: 10px 16px;
    font-size: 13px;
  }
}

/* ============ レスポンシブ ============ */

@media (max-width: 575px) {
	.case-detail-wrap {
		padding: 40px 0;
	}

	.case-detail-title {
		font-size: 24px;
	}

	.case-detail-lead {
		font-size: 14px;
	}

	.case-detail-profile {
		padding: 20px;
		margin-top: 20px;
	}

	.profile-item {
		margin-bottom: 15px;
		padding-bottom: 15px;
	}

	.profile-label {
		font-size: 10px;
	}

	.profile-value {
		font-size: 14px;
	}

	.case-section-title {
		font-size: 20px;
		margin-bottom: 30px;
	}

	.case-problem-text-area p,
	.case-problem-list li {
		font-size: 14px;
	}

	.case-effect-text-area p,
	.case-effect-list-section p {
		font-size: 14px;
	}

	.case-effect-subtitle {
		font-size: 14px;
	}

	.case-effect-quote {
		font-size: 14px;
	}

	.metric-number {
		font-size: 28px;
	}

	.case-comment-box {
		padding: 25px 20px;
	}

	.case-comment-text {
		font-size: 14px;
	}

	.case-section {
		margin-bottom: 50px;
	}
}

@media screen and (min-width: 576px) and (max-width: 767px) {
	.case-detail-title {
		font-size: 28px;
	}

	.case-section-title {
		font-size: 22px;
	}

	.case-detail-profile {
		padding: 25px;
	}
}

@media screen and (min-width: 768px) and (max-width: 991px) {
	.case-detail-profile-wrapper {
		margin-bottom: 60px;
	}

	.case-detail-imgarea-main {
		margin-bottom: 20px;
	}
}
