/* =====Hero區===== */

/* mobile圖片 */
.hero-1 {
  background: url("../images/advantage/all-in-one-erp-system-benefits-hero@1x.png")
    center/cover no-repeat;
}

/* tablet圖片 */
@media (min-width: 768px) {
  .hero-1 {
    background: url("../images/advantage/all-in-one-erp-system-benefits-hero@tablet.jpg")
      center center / cover no-repeat;
  }
}

/* desktop圖片 */
@media (min-width: 1024px) {
  .hero-1 {
    background: url("../images/advantage/all-in-one-erp-system-benefits-hero@desktop.jpg")
      center center / cover no-repeat;
  }
}

/* ========== ERP 優勢區塊 ========== */

.adv-advantage {
  padding-top: clamp(28px, 6vw, 48px);
  padding-bottom: clamp(32px, 7vw, 56px);
}

.adv-advantage__title {
  text-align: center;
  margin-bottom: clamp(16px, 4vw, 24px);
}

/* 圖片容器：置中 + 隨容器縮放 */
.adv-advantage__figure {
  margin: 0 auto;
  max-width: 760px; /* 圖最大寬度，可依需求調整 */
}

.adv-advantage__img {
  display: block;
  width: 100%; /* 跟著容器縮放 */
  height: auto; /* 等比縮放，不變形 */
  object-fit: contain; /* 永不裁切 */
}

/* 平板以上可以讓圖再大一點 */
@media (min-width: 1024px) {
  .adv-advantage__figure {
    max-width: 880px; /* 桌機更寬一點，保持置中 */
    padding-top: 32px; /* ↑ 新增：上方空間 */
    padding-bottom: 32px; /* ↑ 新增：下方空間（略大，視覺更穩定） */
  }
}

/* 手機版：圖片左右加空間 */
@media (max-width: 767.98px) {
  .adv-advantage__figure {
    padding-left: 20px;
    padding-right: 20px; /* 讓圖片不貼邊、符合 Figma 留白 */
  }
}

/* ========== Story Cards（圖片 + 標題 + 內文 + Readmore） ========== */

.adv-story {
  margin-top: clamp(32px, 7vw, 56px);
  padding-bottom: clamp(40px, 8vw, 64px);
}

/* 卡片清單：手機直排，平板以上變 2/3 欄 */
.adv-story__list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* --- 卡片本體 --- */
.adv-story-card {
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06); /* 更高級的柔光陰影 */
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  margin-left: 24px;
  margin-right: 24px;
}

/* hover（桌機） */
@media (hover: hover) {
  .adv-story-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
  }
}

/* --- 圖片區 --- */
.adv-story-card__imgwrap {
  padding-left: 20px;
  padding-right: 20px;
  padding-top: 20px; /* 多加上方空間，視覺更平衡 */
}

.adv-story-card__imgwrap img {
  width: 100%;
  height: auto;
  border-radius: 14px; /* 圖片圓角略小於卡片圓角 → 更精緻 */
  object-fit: cover;
  display: block;
}

/* 內文左右留白 */
.adv-story-card__content {
  padding: 20px 20px 24px; /* 左右一致留白 */
}

/* 標題 */
.adv-story-card__title {
  font-size: clamp(18px, 4.6vw, 22px);
  font-weight: 600;
  text-align: center;
  margin-bottom: 14px;
  color: #222;
}

/* 內文：預設只顯示前幾行（可調整行數） */
.adv-story-card__body {
  font-size: clamp(15px, 4vw, 17px);
  line-height: 1.85;
  color: #444;
  max-height: 7.4em; /* 控制展示行數 */
  overflow: hidden;
  position: relative;
}

/* 收闔狀態時的淡淡漸層遮罩 */
.adv-story-card__body::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2.6em;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff);
}

/* 展開狀態：解除高度限制，拿掉遮罩 */
.adv-story-card.is-open .adv-story-card__body {
  max-height: none;
}
.adv-story-card.is-open .adv-story-card__body::after {
  display: none;
}

/* --- Read more 按鈕（更精緻） --- */
.adv-story-card__toggle {
  margin-top: 12px;
  background: none;
  border: 0;
  font-size: 14px;
  font-weight: 600;
  color: #999;
  letter-spacing: 0.05em;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease;
  text-transform: uppercase;
  display: block;
  text-align: center;
}

/* hover 小小反應（桌機為主） */
.adv-story-card__toggle:hover {
  color: #666;
}

/* 平板以上：2 欄，桌機：3 欄 */
@media (min-width: 768px) {
  .adv-story__list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 36px;
  }
}

@media (min-width: 1200px) {
  .adv-story__list {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
  }
}

/* 平板版：左右留白再多一點（因為畫面更寬） */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .adv-story {
    padding-left: 32px;
    padding-right: 32px;
  }
}

/* 桌機版：大螢幕左右留白更寬，畫面更大氣 */
@media (min-width: 1200px) {
  .adv-story {
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px; /* 保留外邊界，不會太貼邊 */
    padding-right: 24px;
  }
}

/* ===========================
   Story Card：平板 & 桌機橫向版
   =========================== */

/* 平板以上：改為橫向卡片 */
@media (min-width: 768px) {
  .adv-story__list {
    display: flex;
    flex-direction: column; /* 一排一張卡片 */
    gap: 32px;
  }

  .adv-story-card {
    display: grid;
    grid-template-columns: 38% 1fr; /* 左圖右文 */
    align-items: start;
    gap: 24px;
    padding: 24px; /* 讓卡片成為真正的橫向長方形 */
    border-radius: 20px; /* 維持你的卡片風格 */
  }

  /* 圖片不要有手機版的 padding */
  .adv-story-card__imgwrap {
    padding: 0 !important;
  }

  .adv-story-card__imgwrap img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 讓圖片填滿左側 */
    border-radius: 14px; /* 保留你的微圓角 */
  }

  /* 右側文案區域 */
  .adv-story-card__content {
    padding: 0 !important;
  }

  .adv-story-card__title {
    text-align: left; /* 平板以上文字靠左更合理 */
    margin-bottom: 10px;
  }

  /* 平板/桌機：內文直接顯示，不限制行數（更自然） */
  .adv-story-card__body {
    max-height: none !important;
    overflow: visible;
  }

  .adv-story-card__body::after {
    display: none !important; /* 移除漸層遮罩 */
  }

  /* Readmore 保留，功能仍然正常 */
  .adv-story-card__toggle {
    text-align: left;
    padding-left: 0;
  }
}

/* 桌機版讓圖片略窄一些更平衡 */
@media (min-width: 1200px) {
  .adv-story-card {
    grid-template-columns: 32% 1fr;
  }
}

/* 桌機 (≥1024px)：全文顯示，不用 Readmore */
@media (min-width: 1024px) {
  .adv-story-card__body {
    max-height: none !important;
    overflow: visible !important;
  }
  .adv-story-card__body::after {
    display: none !important;
  }
  .adv-story-card__toggle {
    display: none !important; /* 隱藏 readmore 按鈕 */
  }
}

/* ===========================
   title & images
   =========================== */

/* 區塊外層 */
.adv-picture-stack {
  width: 100%;
  padding: 40px 0;
}

/* 標題 */
.adv-picture-title {
  text-align: center;
  font-weight: 700;
  font-size: clamp(22px, 5vw, 30px);
  margin: 40px 0 24px;
  padding: 0 16px; /* 手機左右也留空 */
}

/* 圖片容器（控制左右空間 + 限制最大寬） */
.adv-picture-wrap {
  width: 100%;
  max-width: 1100px; /* 桌機最大寬度 */
  margin: 0 auto 48px;
  padding: 0 20px; /* 手機 / 平板左右都要留空 */
  box-sizing: border-box;
}

/* 圖片 */
.adv-picture-wrap picture,
.adv-picture-wrap img {
  width: 100%;
  display: block;
}

.adv-picture-wrap img {
  height: auto;
}

/* 平板版（768px～1023px）：大幅拉開間距 */
@media (min-width: 768px) {
  .adv-picture-wrap {
    margin-top: 80px;
    margin-bottom: 80px;
  }

  .adv-picture-title {
    margin-top: 40px;
  }
}

/* 桌機版（≥1024px）：更大器、章節感更明顯 */
@media (min-width: 1024px) {
  .adv-picture-wrap {
    margin-top: 100px;
    margin-bottom: 100px;
  }

  .adv-picture-title {
    margin-top: 56px; /* 原 40 → 56，標題距離更大器 */
  }
}

/* ===========================
   feature-icon Section
   =========================== */
/* ====== 區塊外層 ====== */
.adv-feature-icons {
  padding: 48px 20px;
  text-align: center;
}

/* 標題樣式 */
.adv-feature-icons__title {
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 700;
  color: #000;
  margin-bottom: 36px;
}

/* ====== GRID 版面 ====== */
.adv-feature-icons__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 20px;
  max-width: 680px;
  margin: 0 auto;
}

/* 平板以上改 3 欄 */
@media (min-width: 768px) {
  .adv-feature-icons__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 28px;
  }
}

/* ====== Icon Item ====== */
.adv-feature-icons__item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 圓形淺灰底（1:1 比例） */
.adv-feature-icons__iconwrap {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

/* icon 圖片 */
.adv-feature-icons__iconwrap img {
  width: 60%;
  height: auto;
  object-fit: contain;
}

/* 文字 */
.adv-feature-icons__label {
  font-size: clamp(15px, 4vw, 18px);
  color: #333;
  font-weight: 500;
  margin: 0;
}

/* ======== 桌機版（≥1024px）：更大器的展示 ======== */
@media (min-width: 1024px) {
  .adv-feature-icons {
    padding: 80px 20px; /* 區塊更大氣 */
  }

  .adv-feature-icons__title {
    font-size: 32px;
    margin-bottom: 48px;
  }

  /* grid 更穩定的寬度排版 */
  .adv-feature-icons__grid {
    max-width: 1000px; /* 固定在頁面中央，不會太分散 */
    grid-template-columns: repeat(3, 1fr);
    gap: 56px 40px; /* 更寬鬆的呼吸感 */
  }

  /* 圓形背景更大，icon 更有存在感 */
  .adv-feature-icons__iconwrap {
    width: 180px;
    height: 180px;
    margin-bottom: 20px;
  }

  /* icon 放大但不壓迫 */
  .adv-feature-icons__iconwrap img {
    width: 70%;
  }

  /* 標題文字更明顯 */
  .adv-feature-icons__label {
    font-size: 20px;
    font-weight: 600;
  }
}

/* ====== 共用：item & icon 動畫基礎 ====== */
.adv-feature-icons__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.adv-feature-icons__iconwrap {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04); /* B：細緻陰影 */
  transition: transform 0.25s ease, box-shadow 0.25s ease,
    background-color 0.25s ease;
}

/* 文字：兼容單行 / 雙行（C） */
.adv-feature-icons__label {
  max-width: 11em; /* 避免太長一行拉得很寬 */
  line-height: 1.5;
  min-height: 3.2em; /* 預留約 2 行高度，單行也不會太貼近 icon */
}

/* ====== 桌機版：大器＋ hover 動效（A+B） ====== */
@media (min-width: 1024px) and (hover: hover) {
  .adv-feature-icons__item:hover .adv-feature-icons__iconwrap {
    transform: translateY(-4px) scale(1.04); /* A：微縮放＋上浮 */
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.1); /* B：陰影加深 */
    background-color: #f8f8f8;
  }

  .adv-feature-icons__item:hover {
    transform: translateY(-2px);
  }

  .adv-feature-icons__item:hover .adv-feature-icons__label {
    color: #111; /* 文字微強調 */
  }
}

/* 桌機版加寬（≥1200px） */
@media (min-width: 1200px) {
  .adv-feature-icons__grid {
    max-width: 1200px; /* 原本 1000px → 改成 1200px */
    grid-template-columns: repeat(3, 1fr);
    gap: 64px 48px; /* 稍微加大欄距，看起來更大氣 */
  }

  .adv-feature-icons {
    padding-left: 40px;
    padding-right: 40px; /* 保留左右緩衝，不要貼滿 */
  }
}
