/* ====== 變數 & 基礎 ====== */
body {
  font-family: "Noto Serif TC", "Source Han Serif", serif !important;
}

.rtm-docsingle {
  --wrap: 1180px;
  --c-brand: #604C3E;
  --c-accent: #C49C69;
  --c-text: #604C3E;
  --c-muted: #9c8b7b;
  --c-brown: #5b4336;
  font-family: "Noto Serif TC", "Source Han Serif", serif;
  color: var(--c-text);
  line-height: 1.8;
}

.rtm-docsingle .sec {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 56px 16px;
}

.rtm-docsingle .sec-title {
  text-align: center;
  margin: 20px 0 28px;
  color: var(--c-brand);
  font-weight: 800;
  letter-spacing: .08em;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.rtm-docsingle .sec-title::before {
  content: "";
  display: block;
  margin: 0 auto 8px;
  width: 40px;
  height: 40px;
  background: url('/wp-content/uploads/title_icon.png') no-repeat center / contain;
}

/* ====== 1. 醫師照片 + 學經歷 ====== */
.rtm-hero {
  max-width: var(--wrap);
  margin: 28px auto 55px;
  padding: 24px 18px;
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 28px;
  align-items: center;
  position: relative;
  background: #fff;
  border-radius: 0px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .06);
  align-items: start;
}

.rtm-hero .ph {
  border-radius: 0px;
  overflow: hidden;
  background: #faf7f5;
}

.rtm-hero .ph img {
  display: block;
  width: 100%;
  height: auto;
}

.rtm-hero .bio {
  position: relative;
  padding: 8px 8px 24px 8px;
  min-height: 360px;
}

.rtm-hero .bio h2 {
  margin: 0 0 6px;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: .06em;
  color: var(--c-brand);
}

.rtm-hero .bio .sub {
  color: var(--c-accent);
  font-weight: 800;
  margin-bottom: 14px;
}

/* ==== 學經歷上下排列 ==== */
.rtm-hero .kv {
  display: block;
  /* 不要 grid，改直式 */
  margin: 14px 0 20px;
  font-size: 16px;
}

.rtm-hero .kv .k {
  color: var(--c-accent);
  font-weight: 800;
  margin-top: 14px;
  /* 每一段標題與上方段落拉開距離 */
  margin-bottom: 6px;
}

.rtm-hero .kv .v p {
  margin: .25rem 0;
  font-weight: 500;
}

.rtm-hero .leaf {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 140px;
  height: 140px;
  background: url("<?php echo esc_url($img_leaf); ?>") no-repeat right bottom/contain;
  opacity: .9;
  pointer-events: none;
}

/* ====== 2. 專長 ====== */
.rtm-specialty {
  background: #f7f5f3;
  padding-top: 40px;
  padding-bottom: 42px;
}

.rtm-specialty .cats {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 48px;
}

.rtm-specialty .cat .h {
  font-weight: 800;
  color: var(--c-text);
  margin-bottom: 6px;
  font-size: 20px;
}

.rtm-specialty .cat .items {
  color: var(--c-accent);
  font-size: 18px;
  column-gap: 10px;
  word-break: keep-all;
  font-weight: 700;
}

.rtm-specialty .dotlist span+span::before {
  content: "|";
  color: #cdbbaa;
  margin: 0 .45em;
  font-weight: 400;
}

/* ====== 3. 當月診表 ====== */
.rtm-schedule {
  position: relative;
  background: #fbfaf9;
  padding-top: 52px;
  padding-bottom: 60px;
}

.rtm-schedule .wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  /* 改成 flex 直向排版 */
  flex-direction: column;
  gap: 22px;
  /* 圖片與文字的距離 */
  align-items: center;
  /* 水平置中 */
  text-align: center;
  /* 內容置中 */
}

.rtm-schedule .pic {
  border-radius: 0px;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .06);
  background: #fff;
  width: 100%;
  max-width: 1000px;
  /* 限制圖片寬度，避免過大 */
}

.rtm-schedule .pic img {
  display: block;
  width: 100%;
  height: auto;
}

.rtm-schedule .info .h {
  font-weight: 800;
  color: var(--c-brand);
  letter-spacing: .08em;
  margin-bottom: 10px;
  text-align: center;
  display: none;
}

.rtm-schedule .time {
  color: var(--c-accent);
  line-height: 1.9;
  font-size: 18px;
  font-weight: 700;
}

.rtm-schedule .note {
  margin-top: 6px;
  color: var(--c-muted);
  font-size: 14px;
}


/* ====== 4. 醫師專欄 ====== */
.rtm-posts {
  padding-top: 46px;
  padding-bottom: 56px;
  background: #fff;
}

.rtm-posts .grid {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.rtm-posts .card {
  background: #fff;
  border-radius: 0px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .06);
  display: flex;
  flex-direction: column;
}

.rtm-posts .thumb {
  aspect-ratio: 353/225;
  background: #eee center/cover no-repeat;
}

.rtm-posts .body {
  padding: 14px 16px 16px;
}

.rtm-posts .date {
  font-size: 12px;
  color: #b8a99b;
  margin-bottom: 6px;
}

.rtm-posts .t {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: var(--c-brand);
  line-height: 1.45;
}

.rtm-posts .ex {
  margin: 0;
  color: #6e6056;
  font-size: 14px;
  line-height: 1.7;
}

/* ====== RWD ====== */
@media (max-width: 980px) {
  .rtm-hero {
    grid-template-columns: 1fr;
    padding: 22px 18px;
  }

  .rtm-schedule .time {
    font-size: 16px;
  }

  .rtm-hero .bio {
    min-height: unset;
  }

  .rtm-specialty .cats {
    grid-template-columns: 1fr;
  }

  .rtm-schedule .wrap {
    grid-template-columns: 1fr;
  }

  .rtm-posts .grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .rtm-posts .grid {
    grid-template-columns: 1fr;
  }
}

.rtm-hero .bio h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  /* 姓名和 icon 間距 */
}

.rtm-hero .bio .rtm-socials a {
  display: inline-flex;
}

.rtm-hero .bio .rtm-socials img {
  width: 25px;
  height: 25px;
  display: block;
}

/* ===================== ④ 兩顆 CTA 按鈕 ===================== */
.rtm-cta {
  background: #F4F4F4;
  padding: 47px 0 32px;
}

.rtm-cta-wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: center;
  align-items: center;
  column-gap: 18px;
}

.rtm-pill {
  --btn-bg: var(--c-brown);
  --btn-bg-hover: var(--c-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 36px;
  border-radius: 9999px;
  background: var(--btn-bg);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .06em;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(96, 76, 62, .16), inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: transform .15s ease, box-shadow .25s ease, background .25s ease;
}

.rtm-pill:hover {
  transform: translateY(-2px);
  background: var(--btn-bg-hover);
  box-shadow: 0 14px 30px rgba(96, 76, 62, .22), inset 0 1px 0 rgba(255, 255, 255, .06);
  color: #FFF;
}

.rtm-pill .ico {
  width: 28px;
  height: 28px;
  display: block;
}

@media (max-width: 980px) {
  .rtm-cta-wrap {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .rtm-pill {
    margin: 0 auto;
    font-size: 20px;
    padding: 12px 24px;
    gap: 10px;
    white-space: nowrap;
  }

  .rtm-pill .ico {
    width: 22px;
    height: 22px;
  }
}

/* 更小螢幕的額外調整 */
@media (max-width: 600px) {
  .rtm-pill {
    font-size: 18px;
    padding: 10px 20px;
    gap: 8px;
  }

  .rtm-pill .ico {
    width: 20px;
    height: 20px;
  }
}

/* ===================== 文章頁面窄版面專用 ===================== */
/* 文章頁面中的按鈕容器：桌機一排兩個按鈕 */
.entry-content .rtm-cta-wrap,
.post-content .rtm-cta-wrap,
.elementor-widget-container .rtm-cta-wrap,
.single-post .rtm-cta-wrap,
.rtm-docsingle.rtm-narrow-layout .rtm-cta-wrap,
.entry-content .rtm-docsingle .rtm-cta-wrap,
article .rtm-docsingle .rtm-cta-wrap {
  display: grid !important;
  grid-template-columns: repeat(2, auto) !important;
  justify-content: center !important;
  gap: 14px 20px !important;
}

.entry-content .rtm-pill,
.post-content .rtm-pill,
.elementor-widget-container .rtm-pill,
.single-post .rtm-pill,
.rtm-docsingle.rtm-narrow-layout .rtm-pill,
.entry-content .rtm-docsingle .rtm-pill,
article .rtm-docsingle .rtm-pill {
  font-size: 22px !important;
  padding: 12px 24px !important;
  gap: 10px !important;
  white-space: nowrap !important;
}

.entry-content .rtm-pill .ico,
.post-content .rtm-pill .ico,
.elementor-widget-container .rtm-pill .ico,
.single-post .rtm-pill .ico,
.rtm-docsingle.rtm-narrow-layout .rtm-pill .ico,
.entry-content .rtm-docsingle .rtm-pill .ico,
article .rtm-docsingle .rtm-pill .ico {
  width: 22px !important;
  height: 22px !important;
}

/* 平板與手機：一排一個按鈕，字體 20px */
@media (max-width: 980px) {

  .entry-content .rtm-cta-wrap,
  .post-content .rtm-cta-wrap,
  .elementor-widget-container .rtm-cta-wrap,
  .single-post .rtm-cta-wrap,
  .rtm-docsingle.rtm-narrow-layout .rtm-cta-wrap,
  .entry-content .rtm-docsingle .rtm-cta-wrap,
  article .rtm-docsingle .rtm-cta-wrap {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .entry-content .rtm-pill,
  .post-content .rtm-pill,
  .elementor-widget-container .rtm-pill,
  .single-post .rtm-pill,
  .rtm-docsingle.rtm-narrow-layout .rtm-pill,
  .entry-content .rtm-docsingle .rtm-pill,
  article .rtm-docsingle .rtm-pill {
    font-size: 20px !important;
    padding: 12px 20px !important;
    justify-content: center !important;
  }

  .entry-content .rtm-pill .ico,
  .post-content .rtm-pill .ico,
  .elementor-widget-container .rtm-pill .ico,
  .single-post .rtm-pill .ico,
  .rtm-docsingle.rtm-narrow-layout .rtm-pill .ico,
  .entry-content .rtm-docsingle .rtm-pill .ico,
  article .rtm-docsingle .rtm-pill .ico {
    width: 20px !important;
    height: 20px !important;
  }
}

/* ===================== 文章頁面醫師介紹標題 ===================== */
/* 「專欄文章醫師介紹」標題樣式，參照「專長」區塊設計 */
.rtm-related-doctor-section {
  text-align: center;
  margin-top: 50px;
  margin-bottom: 10px;
}

.rtm-related-doctor-title.sec-title {
  display: inline-block;
  text-align: center;
  margin: 0 auto 20px;
  color: #604C3E;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: .08em;
  position: relative;
}

.rtm-related-doctor-title.sec-title::before {
  content: "";
  display: block;
  margin: 0 auto 10px;
  width: 40px;
  height: 40px;
  background: url('/wp-content/uploads/title_icon.png') no-repeat center / contain;
}

@media (max-width: 768px) {
  .rtm-related-doctor-title.sec-title {
    font-size: 22px;
  }

  .rtm-related-doctor-title.sec-title::before {
    width: 35px;
    height: 35px;
  }
}

/* ===================== 醫師自媒體icon ===================== */
.rtm-hero .kv .rtm-socials a {
  display: inline-block;
  margin-right: 5px;
}

.rtm-hero .kv .rtm-socials img {
  width: 35px;
  height: 35px;
  vertical-align: middle;
}


/* 按鈕樣式：灰色細框、圓角、hover */
.exp-toggle {
  font-size: 12px;
  color: #777;
  border: 1px solid #d8d8d8;
  border-radius: 16px;
  background: #fff;
  padding: 2px 10px;
  line-height: 1.8;
  display: inline-block;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

/* Hover 視覺 */
.exp-toggle:hover {
  color: #333;
  border-color: #bfbfbf;
  background: #f6f6f6;
}

/* ===================== 醫師專欄文章 ===================== */
.rtm-featured-articles {
  padding: 46px 16px 56px;
  background: #f7f5f3;
}

.rtm-featured-articles .sec-title {
  text-align: center;
  margin-bottom: 28px;
}

.rtm-featured-articles-grid {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  justify-items: center;
}

.rtm-article-card {
  display: block;
  width: 100%;
  max-width: 280px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: var(--c-text);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rtm-article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.rtm-article-card .thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #eee;
}

.rtm-article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.rtm-article-card:hover .thumb img {
  transform: scale(1.05);
}

.rtm-article-card .body {
  padding: 14px 16px;
}

.rtm-article-card .article-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--c-brand);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* RWD - 平板版本 2 欄 */
@media (max-width: 980px) {
  .rtm-featured-articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* RWD - 手機版本 1 欄 */
@media (max-width: 620px) {
  .rtm-featured-articles-grid {
    grid-template-columns: 1fr;
  }

  .rtm-article-card {
    max-width: 100%;
  }
}

/* ===================== 5. 醫師專欄文章 ===================== */
.rtm-featured-articles {
  padding-top: 46px;
  padding-bottom: 56px;
  background: #f7f5f3;
}

.rtm-featured-articles .sec-title {
  text-align: center;
  margin: 0 0 28px;
  color: var(--c-brand);
  font-weight: 800;
  letter-spacing: .08em;
  position: relative;
  display: block;
}

.rtm-featured-articles .sec-title::before {
  content: "";
  display: block;
  margin: 0 auto 8px;
  width: 40px;
  height: 40px;
  background: url('/wp-content/uploads/title_icon.png') no-repeat center / contain;
}

.rtm-featured-articles-grid {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  justify-items: center;
}

.rtm-article-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .06);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  max-width: 280px;
}

.rtm-article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .1);
}

.rtm-article-card .thumb {
  aspect-ratio: 16/10;
  background: #eee center/cover no-repeat;
  position: relative;
}

.rtm-article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rtm-article-card .body {
  padding: 14px 16px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.rtm-article-card .article-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--c-brand);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* RWD: 平板以下改為 2 列 */
@media (max-width: 980px) {
  .rtm-featured-articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .rtm-article-card {
    max-width: 100%;
  }
}

/* RWD: 手機改為 1 列 */
@media (max-width: 620px) {
  .rtm-featured-articles-grid {
    grid-template-columns: 1fr;
  }

  .rtm-article-card {
    max-width: 400px;
  }
}