/* case-cards-slider.css (修正版) */

/* コンテナ */
.case-cards-slider {
  width: 100%;
  box-sizing: border-box;
  padding: 20px 0;
}

/* Swiper スライドの基本 */
.case-cards-slider .swiper-wrapper {
  align-items: stretch;
}
.case-cards-slider .swiper-slide {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8px 0;
  flex: 0 0 auto; /* Swiper の幅計算を尊重 */
  box-sizing: border-box;
}

/* inner-card を幅100%で伸縮させつつ max-width で上限を設定 */
/* aspect-ratio で縦横比を固定（例: 320 / 420 = 32 / 42） */
.inner-card {
  width: 100%;
  max-width: 320px;      /* PC でのカード最大幅（必要に応じて調整） */
  box-sizing: border-box;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  /* 縦横比を固定する（画面サイズに関係なく比率を保つ） */
  aspect-ratio: 320 / 420;
}

/* リンク全体をブロックに */
.inner-card a {
  color: inherit;
  text-decoration: none;
  display: block;
  height: 100%;
}

/* 画像領域はカードの上部に配置し、比率に合わせて高さを自動調整 */
/* ここではカード内で画像領域を 52% 程度にする例（必要に応じて調整） */
.card-img {
  width: 100%;
  height: 52%;           /* inner-card の高さに対する割合 */
  overflow: hidden;
  background: #f4f4f4;
}

/* 画像を切り抜いて全カードで見た目を統一 */
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 本文領域は残りの高さを使う */
.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 48%;           /* inner-card の残り */
  box-sizing: border-box;
  overflow: hidden;
}

/* タイトルと抜粋 */
.card-title {
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 0;
  color: #222;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-text {
  font-size: 0.92rem;
  color: #666;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* ナビの色調整 */
.case-cards-slider .swiper-button-prev,
.case-cards-slider .swiper-button-next {
  color: #333;
}

/* aspect-ratio が無効な環境向けのフォールバック用クラス */
.inner-card--ratio-fallback {
  position: relative;
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
  overflow: hidden;
}

/* 内部コンテンツを絶対配置して padding-top で比率を作る（例: 320/420 ≒ 75%） */
.inner-card--ratio-fallback .inner-card-content {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
}



/* レスポンシブ調整 */
/* タブレット */
@media (max-width: 1199px) {
  .inner-card { max-width: 300px; aspect-ratio: 300 / 400; }
  .card-img { height: 52%; }
  .card-body { height: 48%; }
}

/* スマホ */
@media (max-width: 767px) {
  .inner-card { max-width: 360px; aspect-ratio: 360 / 420; }
  .card-img { height: 57%; }
  .card-body { height: 43%; }
}

/* 追加の補助（必要に応じて） */
.case-cards-slider .swiper-slide .inner-card {
  transition: transform .25s ease;
}