/* Top Services (Team Module) Section Background & Spacing */
.top-services {
  position: relative;
  overflow: hidden;
  min-height: auto;
  background: #f2f8fa;
  padding: 75px 0 80px;
}

/* Remove excessive 2.5rem vertical flex gap from parent content container */
.top-services .top-services__content {
  display: flex;
  flex-direction: column;
  gap: 0 !important;
}

.top-services .top-services__title-body {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.top-services .top-services__team-copy {
  margin: 0 0 10px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.top-services .top-services__team-copy:last-child {
  margin-bottom: 0;
}

/* Compact team roles grid - tight, elegant spacing */
.top-services .top-services__team-roles {
  margin-top: 14px;
  margin-bottom: 16px;
}

.top-services .top-services__team-roles .top-services__row,
.top-services .top-services__team-roles .top-services__row2 {
  display: flex;
  gap: 8px;
  margin-bottom: 7px;
}

.top-services .top-services__team-roles .top-services__item-01,
.top-services .top-services__team-roles .top-services__item-02,
.top-services .top-services__team-roles .top-services__item-03,
.top-services .top-services__team-roles .top-services__item-04,
.top-services .top-services__team-roles .top-services__item-05,
.top-services .top-services__team-roles .top-services__item-06 {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid #d8eeee;
  border-radius: 10px;
  background: #ffffff;
  color: #0c5f80 !important;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.top-services .top-services__team-roles .top-services__item-01:hover,
.top-services .top-services__team-roles .top-services__item-02:hover,
.top-services .top-services__team-roles .top-services__item-03:hover,
.top-services .top-services__team-roles .top-services__item-04:hover,
.top-services .top-services__team-roles .top-services__item-05:hover,
.top-services .top-services__team-roles .top-services__item-06:hover {
  background: #eef9f9;
  border-color: #bfe3e2;
  color: #168cbd !important;
  text-decoration: none !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(22, 140, 189, 0.12);
}

.top-services .top-services__team-roles i {
  color: #168cbd;
  font-size: 0.95rem;
}

/* Refined Pill Buttons (matching cremation.php style) */
.top-services .top-services__team-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 0;
}

.top-services .top-services__team-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 13px 28px;
  border-radius: 999px;
  color: #fff !important;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.top-services .top-services__team-btn i {
  font-size: 14px;
  transition: transform .2s ease;
}

.top-services .top-services__team-btn:hover {
  transform: translateY(-2px);
  color: #fff !important;
}

.top-services .top-services__team-btn:hover i {
  transform: translateX(4px);
}

.top-services .top-services__team-btn--primary {
  background: #168cbd;
  box-shadow: 0 10px 20px rgba(22, 140, 189, 0.28);
}

.top-services .top-services__team-btn--primary:hover {
  background: #1178a3;
  box-shadow: 0 12px 26px rgba(22, 140, 189, 0.42);
}

.top-services .top-services__team-btn--teal {
  background: #137f7b;
  box-shadow: 0 10px 20px rgba(19, 127, 123, 0.3);
}

.top-services .top-services__team-btn--teal:hover {
  background: #0e6562;
  box-shadow: 0 12px 26px rgba(19, 127, 123, 0.45);
}

/* Five service figures */
.top-services__team-stats {
  display: grid;
  flex: 0 0 100%;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  margin-top: 48px;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.top-services__team-stat {
  display: flex;
  min-height: 110px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 10px;
  border: 1px solid #d8eeee;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(12, 95, 128, .06);
  text-align: center;
  transition: transform .2s ease, box-shadow .2s ease;
}

.top-services__team-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(12, 95, 128, .1);
}

.top-services__team-stat-value {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  color: #168cbd;
  line-height: 1;
}

.top-services__team-stat-value strong {
  font-size: clamp(24px, 2.4vw, 38px);
  font-weight: 800;
  letter-spacing: -.04em;
}

.top-services__team-stat-value span {
  font-size: 14px;
  font-weight: 800;
}

.top-services__team-stat-label {
  margin-top: 10px;
  color: #0c5f80;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

@media (max-width: 1199.98px) {
  .top-services__team-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 575.98px) {
  .top-services {
    padding: 50px 0;
  }
  .top-services .top-services__team-roles .top-services__row,
  .top-services .top-services__team-roles .top-services__row2 {
    flex-direction: row;
    gap: 6px;
    margin-bottom: 6px;
  }
  .top-services .top-services__team-actions {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .top-services .top-services__team-btn {
    width: 100%;
  }
  .top-services__team-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 30px;
  }
  .top-services__team-stat {
    min-height: 96px;
    padding: 14px 8px;
  }
  .top-services__team-stat-value strong {
    font-size: 25px;
  }
  .top-services__team-stat-label {
    font-size: 12px;
  }
}

/* Team visual — 參考 About 頁「我們的故事」圖片風格（白邊斜切圓角 + 細線外環 + 浮動標籤）。
   容器固定 1:1 比例，日後直接換成正方形相片即可，object-fit: cover 自動填滿。 */
.top-services__visual {
  position: relative;
  width: 100%;
  max-width: 540px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}

.top-services__visual-ring {
  position: absolute;
  inset: 0 0 7px 28px;
  border: 1px solid rgba(22, 140, 189, .28);
  border-radius: 32% 18% 28% 18%;
  transform: rotate(7deg);
}

.top-services__visual figure {
  position: absolute;
  inset: 25px 8px 22px 0;
  z-index: 1;
  margin: 0;
  overflow: hidden;
  border: 10px solid #fff;
  border-radius: 32% 18% 28% 18%;
  box-shadow: 0 22px 50px rgba(18, 59, 82, .16);
  transform: rotate(-2deg);
}

.top-services__visual figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-services__visual-note {
  position: absolute;
  right: -18px;
  bottom: 32px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 16px;
  color: #0c5f80;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 14px 28px rgba(18, 59, 82, .14);
  font-weight: 700;
}

.top-services__visual-note i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  background: #168cbd;
}

/* iPad / 平板（直向）：欄位上下堆疊，圖片區塊置中並限制尺寸 */
@media (max-width: 991.98px) {
  .top-services__visual {
    max-width: 560px;
    margin-bottom: 40px;
  }
  .top-services__visual-note {
    right: 0;
  }
}

/* 手機：縮小留白與白邊，浮動標籤收進版面內避免溢出 */
@media (max-width: 767.98px) {
  .top-services__visual {
    max-width: 420px;
    margin-bottom: 32px;
  }
  .top-services__visual figure {
    inset: 14px 8px 14px 0;
    border-width: 8px;
  }
  .top-services__visual-ring {
    inset: 0 0 5px 18px;
  }
  .top-services__visual-note {
    right: 0;
    bottom: 20px;
    padding: 10px 14px;
    font-size: 14px;
  }
  .top-services__visual-note i {
    width: 30px;
    height: 30px;
  }
}
