/* 療程頁「本療程醫師」區塊（tools/column/procedure-doctors.mjs 產生，建置時依 Sanity 醫師專長寫進療程頁）。
   卡片樣式沿用 onda-pro 的醫師卡片（RWD_css/onda-pro.css 的 op-doc-card）。
   這支 CSS 載在療程頁 <head> 的最後面；療程頁各自的 CSS 對 h2、ul、section 有全域樣式，這裡的值都寫死，不吃繼承。 */

.pd-section {
  --pd-accent: #b5a999;
  --pd-border: rgba(181, 169, 153, 0.24);
  background: linear-gradient(to bottom, #fff 0%, #faf7f2 12%, #faf7f2 100%);
  padding: clamp(3.5rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem);
  margin: 0;
  text-align: center;
}

.pd-section__head {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.pd-section .pd-eyebrow {
  text-align: center;
  font-family: "Archivo", sans-serif;
  font-size: clamp(0.625rem, 1.1vw, 0.75rem);
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--pd-accent);
  margin: 0 0 0.7rem;
  line-height: 1.4;
}

.pd-section .pd-title {
  font-family: "Noto Sans TC", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: #1a1a1a;
  margin: 0;
  padding: 0;
}

.pd-section .pd-lead {
  text-align: center;
  font-weight: 400;
  margin: 0.9rem auto 0;
  font-size: clamp(0.875rem, 1.2vw, 1rem);
  line-height: 1.75;
  color: rgba(0, 0, 0, 0.6);
  text-wrap: pretty;
}

/* 桌機：置中換行；手機：橫向滑動（第一張、最後一張的 auto 邊界讓卡片少的時候也置中） */
.pd-section .pd-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(0.75rem, 1.6vw, 1.25rem);
  max-width: 84rem;
  margin: clamp(1.75rem, 3.5vw, 2.75rem) auto 0;
  padding: 0 clamp(1rem, 4vw, 2rem);
  text-align: left;
}

.pd-list > li {
  flex: 0 0 clamp(12.5rem, 17vw, 14.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 639px) {
  .pd-section .pd-list {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
  }
  .pd-section .pd-list::-webkit-scrollbar {
    display: none;
  }
  .pd-list > li {
    flex-basis: 42vw;
    scroll-snap-align: start;
  }
  .pd-list > li:first-child {
    margin-left: auto;
  }
  .pd-list > li:last-child {
    margin-right: auto;
  }
}

.pd-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid var(--pd-border);
  border-radius: 2px;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.28s ease, box-shadow 0.28s ease, transform 0.28s ease;
}

.pd-card__photo {
  margin: 0;
  aspect-ratio: 5 / 6;
  overflow: hidden;
  background: #efece7;
}

.pd-card__photo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 15%;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.pd-card__body {
  flex: 1;
  text-align: left;
  padding: 0.75rem 0.9rem 0.5rem;
}

.pd-card__type {
  display: block;
  margin-bottom: 0.35rem;
  font-size: clamp(0.6875rem, 1vw, 0.8125rem);
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--pd-accent);
  line-height: 1.4;
}

.pd-section .pd-card__name {
  margin: 0 0 0.5rem;
  padding: 0;
  font-family: "Noto Sans TC", sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: #1a1a1a;
}

.pd-section .pd-card__creds {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pd-section .pd-card__creds li {
  position: relative;
  margin: 0;
  padding: 0 0 0 0.85rem;
  list-style: none;
  font-size: clamp(0.75rem, 1vw, 0.8125rem);
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.55);
}

.pd-section .pd-card__creds li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--pd-accent);
}

.pd-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding: 0.55rem 0.9rem 0.65rem;
  border-top: 1px solid rgba(181, 169, 153, 0.16);
  font-family: "Archivo", sans-serif;
  font-size: clamp(0.6875rem, 1vw, 0.8125rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--pd-accent);
}

.pd-card__footer::after {
  content: "→";
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.pd-section .pd-more {
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  padding: 0;
  text-align: center;
}

.pd-more a {
  position: relative;
  padding-bottom: 0.35rem;
  font-family: "Archivo", "Noto Sans TC", sans-serif;
  font-size: clamp(0.75rem, 1.1vw, 0.875rem);
  font-weight: 500;
  letter-spacing: 0.24em;
  color: rgba(0, 0, 0, 0.5);
  text-decoration: none;
}

.pd-more a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--pd-accent);
  opacity: 0.4;
  transform: scaleX(0.5);
  transform-origin: left;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.pd-more a span {
  display: inline-block;
  transition: transform 0.25s ease;
}

.pd-card:focus-visible,
.pd-more a:focus-visible {
  outline: 2px solid var(--pd-accent);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .pd-card:hover {
    border-color: rgba(181, 169, 153, 0.55);
    box-shadow: 0 8px 32px rgba(181, 169, 153, 0.2);
    transform: translateY(-3px);
  }
  .pd-card:hover .pd-card__photo img {
    transform: scale(1.04);
  }
  .pd-card:hover .pd-card__footer::after {
    opacity: 1;
    transform: translateX(0);
  }
  .pd-more a:hover {
    color: var(--pd-accent);
  }
  .pd-more a:hover::after {
    transform: scaleX(1);
    opacity: 1;
  }
  .pd-more a:hover span {
    transform: translateX(5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pd-card,
  .pd-card__photo img,
  .pd-card__footer::after,
  .pd-more a::after,
  .pd-more a span {
    transition: none;
  }
}
