/* ==============================
   成功案例區塊
   ============================== */

/* ========== Circle Images  ========== */
.cases-section {
  padding: clamp(40px, 6vw, 80px) 0;
  text-align: center;
}

/* 背景圖＋透明漸層 */
.cases-section--brandbg {
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.6),
      rgba(255, 255, 255, 0.6)
    ),
    linear-gradient(rgba(44, 41, 90, 0.08), rgba(44, 41, 90, 0.08)),
    url("../images/frontpage/cases/case-bg.png");
  background-blend-mode: overlay;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.cases-section--brandbg {
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.6),
      rgba(255, 255, 255, 0.6)
    ),
    linear-gradient(rgba(44, 41, 90, 0.08), rgba(44, 41, 90, 0.08)),
    url("../images/frontpage/cases/case-bg@mobile.png");
  background-blend-mode: overlay;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* 標題與副標 */
.cases-section .section-title {
  font-weight: 700;
  font-size: clamp(22px, 5.5vw, 28px);
  margin: 0;
}
.cases-section .section-subtitle {
  color: #666;
  font-size: 0.95rem;
  margin: 0.25rem 0 1rem;
}

/* ==============================
   卡片與圖片
   ============================== */
.case-card {
  text-align: center;
}

.case-thumb {
  width: 160px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
.case-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 文字（調整大小與間距） */
.case-title {
  font-size: clamp(1.125rem, 3.8vw, 1.25rem); /* 手機 18px → 桌機 20px */
  font-weight: 600;
  margin-top: 0.25rem; /* 原本 0.35rem → 更靠近圖片 */
  line-height: 1.35; /* 字行距略縮緊但仍保持可讀性 */
  color: #2c295a;
}

/* ==============================
   hover 效果：僅桌機觸發
   ============================== */
@media (hover: hover) and (pointer: fine) {
  .case-thumb img {
    transition: transform 0.25s ease;
  }
  .case-card:hover .case-thumb img {
    transform: scale(1.06);
  }
}

/* ==============================
   展開/收合按鈕
   ============================== */
.btn-cases-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: var(--color-primary, #2c295a);
  color: var(--white, #fff);
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-cases-toggle .when-expanded {
  display: none;
}
.btn-cases-toggle.collapsed .when-collapsed {
  display: inline;
}
.btn-cases-toggle.collapsed .when-expanded {
  display: none;
}
.btn-cases-toggle:not(.collapsed) .when-collapsed {
  display: none;
}
.btn-cases-toggle:not(.collapsed) .when-expanded {
  display: inline;
}
@media (hover: hover) and (pointer: fine) {
  .btn-cases-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  }
}

/* ==============================
   RWD 排版設定
   ============================== */

/* 手機版：兩欄 */
@media (max-width: 767.98px) {
  .cases-grid > [class*="col-"] {
    flex: 0 0 50%;
    max-width: 50%;
  }
  .cases-grid {
    row-gap: 1rem; /* 每排卡片之間的距離略縮小 */
  }
}

/* 平板：3 欄 */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .cases-grid > [class^="col-"],
  .cases-grid > [class*=" col-"] {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
  }
}

/* 桌機：4 欄（≥1200px）*/
@media (min-width: 1200px) {
  .cases-grid > [class^="col-"],
  .cases-grid > [class*=" col-"] {
    flex: 0 0 25%;
    max-width: 25%;
  }
}

/* 平板版：圖片略大 */
@media (min-width: 768px) {
  .case-thumb {
    width: 180px;
  }
}

/* 桌機版：圖片再放大一點 */
@media (min-width: 1200px) {
  .case-thumb {
    width: 200px;
  }
}
