.ms-section {
  background: var(--svc-bg);
  padding: clamp(56px, 8vw, 96px) 0;
}

.ms-shell {
  width: min(calc(100% - 40px), 1080px);
  margin: 0 auto;
}

.ms-title {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--svc-ink);
}

.ms-lead,
.ms-content > p {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 2;
  letter-spacing: 0.06em;
  color: #5c5650;
  max-width: 880px;
}

.ms-content > p:first-child {
  margin-bottom: 40px;
}

.ms-content > h2,
.ms-content > h3 {
  margin: 32px 0 16px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--svc-ink);
}

.ms-content > h2 { font-size: 22px; }
.ms-content > h3 { font-size: 18px; }

.ms-table-wrap,
.ms-content .wp-block-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 24px;
}

.ms-table,
.ms-content .wp-block-table table,
.ms-content > table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: #fff;
}

.ms-table thead th,
.ms-content .wp-block-table thead th,
.ms-content > table thead th {
  padding: 15px 30px;
  background: #434343;
  color: #fff;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  border: 0.5px solid #c3c3c3;
}

/* 欄寬比例:服務項目 / 金額 / 單位 / 備註 ≈ 200 / 200 / 100 / 550 (Figma) */
.ms-table thead th:nth-child(1),
.ms-content .wp-block-table thead th:nth-child(1),
.ms-content > table thead th:nth-child(1) { width: 19%; }
.ms-table thead th:nth-child(2),
.ms-content .wp-block-table thead th:nth-child(2),
.ms-content > table thead th:nth-child(2) { width: 19%; }
.ms-table thead th:nth-child(3),
.ms-content .wp-block-table thead th:nth-child(3),
.ms-content > table thead th:nth-child(3) { width: 9.5%; }

.ms-table tbody td,
.ms-content .wp-block-table tbody td,
.ms-content > table tbody td {
  padding: 15px 30px;
  border: 0.5px solid #c3c3c3;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: #434343;
  text-align: center;
}

/* 備註欄(最後一欄)靠左 */
.ms-table tbody td:last-child,
.ms-content .wp-block-table tbody td:last-child,
.ms-content > table tbody td:last-child {
  padding-left: 40px;
  padding-right: 40px;
  text-align: left;
}

@media (max-width: 767px) {
  /* 拿掉強制 640px 的 min-width,讓表格符合手機寬度、不再橫向捲動;
     欄寬改依內容自動分配,服務項目欄才容得下四個字 */
  .ms-table,
  .ms-content .wp-block-table table,
  .ms-content > table {
    min-width: 0;
    table-layout: auto;
  }

  .ms-table thead th,
  .ms-table tbody td,
  .ms-content .wp-block-table thead th,
  .ms-content .wp-block-table tbody td,
  .ms-content > table thead th,
  .ms-content > table tbody td {
    padding: 12px 8px;
    font-size: 13px;
  }

  /* 服務項目 / 金額 / 單位 三欄不換行(服務項目維持四個字一行),備註欄自動換行吸收剩餘寬度 */
  .ms-table thead th:not(:last-child),
  .ms-table tbody td:not(:last-child),
  .ms-content .wp-block-table thead th:not(:last-child),
  .ms-content .wp-block-table tbody td:not(:last-child),
  .ms-content > table thead th:not(:last-child),
  .ms-content > table tbody td:not(:last-child) {
    white-space: nowrap;
  }

  /* 服務項目欄:手機版讓標註內容(如(雅緻)、香火暫曆)斷到第二行 */
  .ms-content .ms-paren {
    display: block;
  }

  .ms-table tbody td:last-child,
  .ms-content .wp-block-table tbody td:last-child,
  .ms-content > table tbody td:last-child {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* ----- Hero (per-page) ----- */
.ms-hero {
  width: 100%;
  aspect-ratio: 1440 / 450;
  background: url('../../assets/ms-hero-1.webp') center/cover no-repeat;
}

@media (max-width: 767px) {
  .ms-hero {
    aspect-ratio: 4 / 3;
  }
}
