/* ==========================================================================
   君禾診所 Harmonia Clinic
   設計基調：溫潤米白 + 松綠 + 淡金，圓潤、留白多、不刺眼
   手機優先；所有區塊都有防破框保護
   ========================================================================== */

/* ---------------------------------------------------------------------------
   全站配色以 logo 為基準。
   --brand 就是 assets/img/logo-banner.jpg 背景的那個橄欖綠（實際取色 #9cab80），
   首頁 banner 兩側的留白靠它跟圖片無縫接在一起，改色前請先確認圖檔也一起換。
   其餘綠色是同一個色相（黃綠）的深淺版本，深色供文字使用以確保對比度。
--------------------------------------------------------------------------- */
:root {
  --brand:     #9cab80;      /* logo 橄欖綠：banner 底色、品牌識別 */

  --green-900: #2e3a22;      /* 深橄欖：標題、頁尾 */
  --green-700: #5a6d42;      /* 中橄欖：按鈕、連結、選中的頁籤 */
  --green-500: #8da06e;      /* 淺橄欖：邊框、hover */
  --green-100: #e3e9d7;      /* 圖示底色 */
  --green-050: #f2f5eb;      /* 區塊淡底 */

  /* 琥珀橘。原則：只做「裝飾」——短線、邊框、hover，
     絕對不拿來當小字的顏色（放白底只有 2.72），也不要貼在 --brand 上
     （兩者亮度幾乎相同，對比僅 1.11，會糊在一起）。
     需要文字用的暖色，一律用下面深一階的 --gold-600。 */
  --accent:   #d18f40;

  --gold-600: #8a6a2f;
  --gold-500: #b08a46;
  --gold-100: #f5eedf;

  --ink-900: #23261f;
  --ink-700: #3d443b;
  --ink-500: #6b7268;
  --ink-300: #9aa196;

  --paper: #faf7f2;
  --paper-card: #ffffff;
  --line: #e6e1d8;

  --wrap: 1120px;
  --measure: 720px;          /* 內容文字區寬度：HERO 圖片不得超過這個寬度 */
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 2px 4px rgba(35, 38, 31, .04), 0 12px 28px rgba(35, 38, 31, .06);
  --shadow-lift: 0 4px 10px rgba(35, 38, 31, .06), 0 18px 40px rgba(35, 38, 31, .10);

  --sans: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI",
          "PingFang TC", "Microsoft JhengHei", sans-serif;
  --serif: "Noto Serif TC", "Songti TC", Georgia, serif;
}

/* ---------- Reset / 防破框基礎 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;          /* 保險：任何情況都不出現橫向捲軸 */
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-900);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.85;
  letter-spacing: .01em;
  overflow-x: hidden;
  overflow-wrap: break-word;   /* 長字串、長網址一律折行，不撐破容器 */
  word-break: break-word;
  -webkit-font-smoothing: antialiased;
}

img, svg, video, iframe { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding-left: 1.25em; }
a { color: var(--green-700); text-decoration-color: rgba(90, 109, 66, .35); text-underline-offset: .22em; }
a:hover { color: var(--green-900); text-decoration-color: currentColor; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--green-700); color: #fff; padding: .7em 1.2em; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ---------- 版心 ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(18px, 5vw, 32px);
}
.measure { max-width: var(--measure); margin-inline: auto; }

/* ==========================================================================
   頁首 / 頁籤
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(250, 247, 242, .92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 66px;
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; min-width: 0; }
/* 頁首標誌：logo-mark.png 是正方形，圖案只佔中間（上下各留白 28%），
   所以用一個比較扁的視窗框住、圖片放大置中，等於把多餘留白裁掉，
   圖案本身仍是等比例縮放，不會變形。 */
.brand-mark {
  flex: 0 0 auto;
  width: 58px; height: 38px;
  background: url("../img/logo-mark.png") no-repeat center / 80px 80px;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-zh { font-family: var(--serif); font-size: 19px; font-weight: 700; line-height: 1.25; color: var(--green-900); white-space: nowrap; }
.brand-en { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-500); line-height: 1.4; white-space: nowrap; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px; margin-right: -8px;
  background: none; border: 0; padding: 10px; cursor: pointer;
  flex-direction: column; justify-content: space-between;
}
.nav-toggle-bar { display: block; height: 2px; width: 100%; background: var(--green-900); border-radius: 2px; transition: transform .25s, opacity .2s; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

.site-nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 9px 14px; border-radius: 999px;
  font-size: 15.5px; font-weight: 500; color: var(--ink-700);
  text-decoration: none; white-space: nowrap; transition: background .2s, color .2s;
}
.site-nav a:hover { background: var(--green-050); color: var(--green-900); }
.site-nav a.is-active { background: var(--green-700); color: #fff; }

/* 筆電寬度：頁籤稍微收窄，才容得下較長的頁籤名稱 */
@media (max-width: 1180px) {
  .site-nav ul { gap: 2px; }
  .site-nav a { padding: 9px 10px; font-size: 15px; }
}

/* 頁籤總長度超過一列時就改用漢堡選單（頁籤變多或變長時要一起調整） */
@media (max-width: 1000px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: grid; grid-template-rows: 0fr;
    transition: grid-template-rows .28s ease;
  }
  .site-nav > ul { overflow: hidden; flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav.is-open { grid-template-rows: 1fr; }
  .site-nav li { border-top: 1px solid var(--line); }
  .site-nav li:first-child { border-top: 0; }
  .site-nav a {
    border-radius: 0; padding: 15px clamp(18px, 5vw, 32px); font-size: 16.5px;
  }
  .site-nav a.is-active { background: var(--green-050); color: var(--green-900); box-shadow: inset 3px 0 0 var(--green-700); }
}

/* ==========================================================================
   共用區塊
   ========================================================================== */
.section { padding: clamp(52px, 9vw, 92px) 0; }
.section--tint { background: var(--green-050); }
.section--paper { background: #fff; }

/* 品牌綠整片底色。目前沒有頁面在用，留著備用：想讓哪一區呼應 banner 的綠，
   把該 <section> 的 section--paper／section--tint 換成 section--brand 即可。
   文字一律用深橄欖（實測對比度 4.9，通過無障礙標準）；
   千萬不要在這個底色上放白字或淺色字，會看不清楚。 */
.section--brand { background: var(--brand); }
.section--brand .eyebrow { color: var(--green-900); }
.section--brand .section-title,
.section--brand .section-lead { color: var(--green-900); }
/* 這一區的線框按鈕要加深，原本的中橄欖放在品牌綠上只有 2.3 */
.section--brand .btn--ghost { color: var(--green-900); border-color: var(--green-900); }
.section--brand .btn--ghost:hover { background: var(--green-900); color: #fff; }

/* 小標籤：字本身維持深金（白底上要讀得清楚），
   前面那截短橫線用亮橘 --accent，是全站唯一固定出現的橘色點綴。 */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .2em;
  color: var(--gold-600); text-transform: uppercase; margin-bottom: 14px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 2px; border-radius: 2px;
  background: var(--accent); flex: 0 0 auto;
}
/* 置中的小標籤：左右各一截，才不會偏一邊 */
.section-head--center .eyebrow::after {
  content: ""; width: 22px; height: 2px; border-radius: 2px;
  background: var(--accent); flex: 0 0 auto;
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(25px, 5.2vw, 36px);
  line-height: 1.4; font-weight: 700; color: var(--green-900);
  letter-spacing: .01em;
}
.section-lead {
  margin-top: 14px; color: var(--ink-700); font-size: clamp(15.5px, 3.6vw, 17px);
  max-width: var(--measure);
}
.section-head { margin-bottom: clamp(30px, 5vw, 46px); }
.section-head--center { text-align: center; }
.section-head--center .section-lead { margin-inline: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: 13px 26px; border-radius: 999px;
  font-size: 15.5px; font-weight: 500; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .2s, color .2s;
  max-width: 100%;
  white-space: nowrap;          /* 電話號碼不要被拆成兩行 */
  line-height: 1.4;
}
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--green-700); color: #fff; box-shadow: 0 8px 20px rgba(44, 95, 85, .22); }
.btn--primary:hover { background: var(--green-900); color: #fff; }
.btn--ghost { border-color: var(--green-700); color: var(--green-700); background: transparent; }
.btn--ghost:hover { background: var(--green-050); color: var(--green-900); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ==========================================================================
   首頁 HERO
   ========================================================================== */
.hero { background: var(--paper); }

/* Banner：logo 圖片原尺寸等比顯示（正方形，絕不裁切、絕不拉伸），
   兩側留白用 --brand 補滿，跟圖片自身的底色相同，看起來就是一整條橫幅。
   要換圖時，新圖的底色若不是 #9cab80，記得一起改 --brand。 */
.hero-banner { background: var(--brand); }
.hero-banner img {
  display: block;
  width: min(100%, clamp(280px, 34vw, 420px));
  height: auto;                 /* 高度跟著寬度走 → 比例永遠不變 */
  margin-inline: auto;
}

.hero-body { background: var(--paper); padding-block: clamp(30px, 5vw, 52px); }
.hero-inner { max-width: 680px; margin-inline: auto; text-align: center; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 6.6vw, 50px);
  line-height: 1.32; font-weight: 700; color: var(--green-900);
}
/* 品牌標語：拉開字距讓它讀起來像標語。
   字級沿用 .hero h1 —— 實測 320px～1280px 都剛好單行不斷，
   刻意不再放大，否則小螢幕會斷成「君之健康，禾你／同行」。 */
.hero h1.hero-slogan {
  letter-spacing: .04em;
  text-wrap: balance;   /* 萬一真的換行，讓兩行長度平均 */
}
.hero-lead {
  margin-top: 20px;
  font-size: clamp(15px, 3.8vw, 18.5px);
  line-height: 1.95; color: var(--ink-700);
}
.hero .btn-row { margin-top: 30px; justify-content: center; }

/* 只在寬螢幕生效的斷行；窄螢幕交給瀏覽器自動折行，避免奇怪的斷句 */
@media (max-width: 640px) { br.only-wide { display: none; } }

/* 首頁那段話（獨立的心意區塊） */
.creed { background: var(--green-050); }
.creed-card {
  max-width: var(--measure); margin-inline: auto; text-align: center;
  padding: clamp(30px, 6vw, 52px) clamp(22px, 5vw, 48px);
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.creed-lead {
  font-family: var(--serif);
  font-size: clamp(21px, 5vw, 30px); line-height: 1.6;
  font-weight: 700; color: var(--green-900);
}
.creed-body { margin-top: 18px; font-size: clamp(15px, 3.6vw, 17px); line-height: 2; color: var(--ink-700); }

/* ==========================================================================
   卡片 / 格線
   ========================================================================== */
.grid { display: grid; gap: clamp(16px, 3vw, 26px); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }

.card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 32px);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-icon {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--green-100); color: var(--green-700);
  display: grid; place-items: center; margin-bottom: 18px;
}
.card-icon svg { width: 24px; height: 24px; }
.card h3 { font-family: var(--serif); font-size: 19.5px; font-weight: 700; color: var(--green-900); line-height: 1.5; }
.card p { margin-top: 10px; color: var(--ink-700); font-size: 15.5px; line-height: 1.9; }
.card ul { margin-top: 14px; color: var(--ink-700); font-size: 15px; }
.card li { margin-top: 6px; }

/* 整張可點擊的卡片（例如首頁的再生注射治療） */
a.card--link {
  display: block; text-decoration: none; color: inherit;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
a.card--link:hover, a.card--link:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);      /* 滑過時亮起琥珀橘 */
  box-shadow: var(--shadow-lift);
}
/* 卡片與區塊底部的「看說明 →」 */
.card-more, .service-block-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px;
  color: var(--green-700); font-size: 15px; font-weight: 500;
  text-decoration: none;
}
.card-more span, .service-block-link span { transition: transform .2s; }
a.card--link:hover .card-more span,
.service-block-link:hover span { transform: translateX(4px); }
.service-block-link { margin-top: 16px; }
.service-block-link:hover { color: var(--green-900); }

/* ---------- 治療項目：分類區塊 + 項目膠囊 ---------- */
.service-grid {
  display: grid; gap: clamp(16px, 3vw, 24px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
}
.service-block--wide { grid-column: 1 / -1; }

.service-block-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.service-block-head .card-icon { margin-bottom: 0; flex: 0 0 auto; }
.service-block .service-block-note {
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line);
  font-size: 14px; line-height: 1.8; color: var(--ink-500);
}

ul.chip-list, .card ul.chip-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 18px; padding: 0; list-style: none;
}
.chip {
  display: inline-block; max-width: 100%;
  padding: 7px 14px; border-radius: 999px;
  background: var(--green-050); border: 1px solid var(--green-100);
  color: var(--ink-700); font-size: 14.5px; line-height: 1.5;
}

/* ---------- 實拍照片：空間、外觀 ---------- */
.photo-grid {
  display: grid; gap: clamp(14px, 2.5vw, 22px);
  margin-top: clamp(24px, 4vw, 36px);
}
/* 一張時放大置中，兩三張時並排 */
.photo-grid--1 { grid-template-columns: 1fr; max-width: 860px; margin-inline: auto; }
.photo-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.photo-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

.photo { margin: 0; min-width: 0; }
.photo img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--green-050);
  box-shadow: var(--shadow);
}
.photo figcaption {
  margin-top: 10px; font-size: 13.5px; line-height: 1.7;
  color: var(--ink-500); text-align: center;
}

/* 設備卡片改放實拍照時，取代原本的線條圖示 */
.card-photo {
  margin: calc(clamp(24px, 4vw, 32px) * -1) calc(clamp(24px, 4vw, 32px) * -1) 20px;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden; background: var(--green-050);
}
.card-photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

/* ---------- 診療設備與服務 ---------- */
.facility-grid {
  display: grid; gap: clamp(14px, 2.5vw, 20px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
.facility {
  display: flex; align-items: center; gap: 14px; min-width: 0;
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 18px clamp(16px, 3vw, 22px);
}
.facility .card-icon { margin-bottom: 0; flex: 0 0 auto; width: 44px; height: 44px; }
.facility h3 {
  font-family: var(--serif); font-size: 16.5px; font-weight: 700;
  color: var(--green-900); line-height: 1.5; min-width: 0;
}

/* ---------- 醫師介紹 ---------- */
.doctor {
  display: grid; gap: clamp(24px, 4vw, 44px);
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  align-items: start;
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(26px, 4vw, 44px);
}
.doctor + .doctor { margin-top: clamp(16px, 3vw, 24px); }

.doctor-id { text-align: center; min-width: 0; }
.doctor-avatar {
  width: 92px; height: 92px; border-radius: 50%;
  background: linear-gradient(145deg, var(--green-500), var(--green-700));
  color: #fff; font-family: var(--serif); font-size: 40px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
  margin: 0 auto 18px;
}
/* 插畫肖像：方形照片 */
.doctor-photo {
  width: 100%; max-width: 210px; margin: 0 auto 18px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--green-050);
  overflow: hidden;
}
.doctor-photo img { width: 100%; height: 100%; object-fit: cover; }

.doctor-name { font-family: var(--serif); font-size: clamp(21px, 4.4vw, 25px); font-weight: 700; color: var(--green-900); line-height: 1.4; }
.doctor-role { margin-top: 8px; color: var(--gold-600); font-weight: 500; font-size: 15px; line-height: 1.6; }

.doctor-groups { display: grid; gap: clamp(20px, 3vw, 26px); min-width: 0; }
.doctor-group { min-width: 0; }
.doctor-group-title {
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  letter-spacing: .14em; color: var(--gold-600); margin-bottom: 12px;
}
.doctor-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.doctor-list li {
  position: relative; padding-left: 20px; min-width: 0;
  color: var(--ink-700); font-size: 15.5px; line-height: 1.75;
}
.doctor-list li::before {
  content: ""; position: absolute; left: 3px; top: .68em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--green-500);
}

@media (max-width: 760px) {
  .doctor { grid-template-columns: 1fr; }
  .doctor-id { text-align: left; display: flex; align-items: center; gap: 16px; }
  .doctor-avatar { width: 66px; height: 66px; font-size: 29px; margin: 0; flex: 0 0 auto; }
  .doctor-photo { width: 96px; max-width: 96px; margin: 0; flex: 0 0 auto; }
}

.card--num { position: relative; }
.card--num .card-num {
  font-family: var(--serif); font-size: 15px; font-weight: 700;
  color: var(--gold-600); letter-spacing: .1em; display: block; margin-bottom: 10px;
}

/* ==========================================================================
   文章卡片索引（首頁 + 文章頁共用）
   ========================================================================== */
.post-grid { display: grid; gap: clamp(18px, 3vw, 26px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

.post-card {
  display: flex; flex-direction: column;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden; min-width: 0;
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--green-100); }

.post-card-media { position: relative; aspect-ratio: 16 / 9; background: var(--green-100); }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; }
.post-card-tag {
  position: absolute; left: 12px; top: 12px;
  background: rgba(255, 255, 255, .94); color: var(--green-700);
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  padding: 5px 11px; border-radius: 999px;
  max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.post-card-body { padding: 20px clamp(18px, 3.5vw, 24px) 22px; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.post-card h3 { font-family: var(--serif); font-size: 19px; line-height: 1.55; font-weight: 700; }
.post-card h3 a { color: var(--green-900); text-decoration: none; }
.post-card h3 a:hover { color: var(--green-700); text-decoration: underline; }
.post-card-excerpt {
  margin-top: 10px; color: var(--ink-700); font-size: 15px; line-height: 1.85;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-foot {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  font-size: 13px; color: var(--ink-500);
}

/* 中繼資料列（日期、作者、瀏覽數） */
.meta-item { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.meta-item svg { width: 14px; height: 14px; flex: 0 0 auto; opacity: .75; }
.meta-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-sep { color: var(--ink-300); }
.meta-updated { color: var(--gold-600); font-weight: 500; }

/* 瀏覽數：數字還沒回來（或沒接 Supabase）時整塊隱藏，不留空的「瀏覽」標籤 */
[data-view-wrap][data-empty="1"] { display: none; }

/* ==========================================================================
   文章頁
   ========================================================================== */
/* 只設上下內距；左右要留給 .wrap，否則 HERO 圖片會撐到整個螢幕寬 */
.article-head { padding-block: clamp(34px, 6vw, 58px) 0; }
.breadcrumb { font-size: 13.5px; color: var(--ink-500); margin-bottom: 18px; }
.breadcrumb a { color: var(--ink-500); text-decoration: none; }
.breadcrumb a:hover { color: var(--green-700); text-decoration: underline; }
.breadcrumb span { margin: 0 .45em; color: var(--ink-300); }

.article-tag {
  display: inline-block; background: var(--green-100); color: var(--green-700);
  font-size: 12.5px; font-weight: 700; padding: 5px 13px; border-radius: 999px; margin-bottom: 16px;
}
.article-title {
  font-family: var(--serif);
  font-size: clamp(26px, 5.8vw, 42px);
  line-height: 1.42; font-weight: 700; color: var(--green-900);
}
.article-meta {
  margin-top: 20px; padding-bottom: 22px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  font-size: 14px; color: var(--ink-500);
  border-bottom: 1px solid var(--line);
}
.article-author { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.article-author-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(145deg, var(--green-500), var(--green-700));
  color: #fff; display: grid; place-items: center;
  font-family: var(--serif); font-size: 15px; font-weight: 700; line-height: 1;
}
.article-author-name { color: var(--ink-900); font-weight: 500; }
.article-author-role { display: block; font-size: 12.5px; color: var(--ink-500); line-height: 1.4; }

/* HERO 圖片：等比例縮放，寬度不超過內容文字區 */
.article-hero { margin: clamp(24px, 4vw, 34px) auto 0; max-width: var(--measure); }
.article-hero img {
  width: 100%; max-width: 100%; height: auto;   /* 等比例，永不超出文字區寬度 */
  border-radius: var(--radius); box-shadow: var(--shadow);
  background: var(--green-100);
}
.article-hero figcaption { margin-top: 10px; font-size: 13.5px; color: var(--ink-500); text-align: center; }

.article-body { max-width: var(--measure); margin: clamp(30px, 5vw, 44px) auto 0; font-size: 17px; }
.article-body > * + * { margin-top: 1.2em; }
.article-body h2 {
  font-family: var(--serif); font-size: clamp(20px, 4.4vw, 26px); line-height: 1.5;
  font-weight: 700; color: var(--green-900);
  margin-top: 1.9em; padding-top: .1em;
}
.article-body h3 { font-family: var(--serif); font-size: clamp(18px, 3.9vw, 21px); font-weight: 700; color: var(--green-700); margin-top: 1.6em; }
.article-body p { color: var(--ink-700); line-height: 2.02; }
.article-body ul, .article-body ol { color: var(--ink-700); padding-left: 1.35em; }
.article-body li { margin-top: .55em; line-height: 1.95; }
.article-body li::marker { color: var(--green-500); }
.article-body img { border-radius: var(--radius-sm); margin-inline: auto; }
.article-body a { font-weight: 500; }
.article-body blockquote {
  border-left: 3px solid var(--gold-500);
  background: var(--gold-100);
  padding: 4px clamp(16px, 4vw, 26px);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-body blockquote p { color: var(--ink-700); }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.article-body code {
  background: var(--green-050); border: 1px solid var(--line);
  padding: .1em .4em; border-radius: 6px; font-size: .9em;
}
.article-body pre {
  background: var(--green-900); color: #e9ecdf;
  padding: 18px; border-radius: var(--radius-sm);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.article-body pre code { background: none; border: 0; color: inherit; padding: 0; }

/* 表格一律包在可橫捲容器裡，不撐破頁面 */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.table-scroll table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: 15px; }
.table-scroll th, .table-scroll td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.table-scroll th { background: var(--green-050); color: var(--green-900); font-weight: 700; white-space: nowrap; }
.table-scroll tr:last-child td { border-bottom: 0; }

.article-foot {
  max-width: var(--measure); margin: clamp(36px, 6vw, 56px) auto 0;
  padding-top: 26px; border-top: 1px solid var(--line);
}
.article-notice {
  background: var(--green-050); border: 1px solid var(--green-100);
  border-radius: var(--radius-sm); padding: 18px 20px;
  font-size: 14.5px; line-height: 1.85; color: var(--ink-700);
}
.article-notice strong { color: var(--green-900); }

.article-nav { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin-top: 26px; }
.article-nav a {
  display: block; padding: 16px 20px; border-radius: var(--radius-sm);
  background: #fff; border: 1px solid var(--line); text-decoration: none; min-width: 0;
}
.article-nav a:hover { border-color: var(--green-500); box-shadow: var(--shadow); }
.article-nav small { display: block; font-size: 12.5px; color: var(--ink-500); margin-bottom: 4px; }
.article-nav strong { display: block; color: var(--green-900); font-size: 15.5px; font-weight: 500; line-height: 1.5; }
.article-nav .is-next { text-align: right; }

/* ==========================================================================
   內頁通用（治療項目 / 本院特色 / 地理位置 / 文章列表）
   ========================================================================== */
.page-head {
  background: linear-gradient(160deg, var(--green-900), var(--green-700));
  color: #fff; padding: clamp(46px, 8vw, 80px) 0;
}
.page-head .eyebrow { color: var(--gold-100); }
.page-head h1 { font-family: var(--serif); font-size: clamp(27px, 6vw, 42px); line-height: 1.35; font-weight: 700; }
.page-head p { margin-top: 16px; max-width: var(--measure); color: rgba(255, 255, 255, .88); font-size: clamp(15px, 3.6vw, 17px); line-height: 1.95; }

.info-list { display: grid; gap: 14px; }
.info-row {
  display: grid; gap: 4px 20px; grid-template-columns: 128px 1fr;
  padding: 16px 0; border-bottom: 1px solid var(--line); min-width: 0;
}
.info-row:last-child { border-bottom: 0; }
.info-row dt { font-weight: 700; color: var(--green-900); font-size: 15.5px; }
.info-row dd { margin: 0; color: var(--ink-700); font-size: 15.5px; line-height: 1.9; min-width: 0; }
@media (max-width: 560px) { .info-row { grid-template-columns: 1fr; } }

.map-frame {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--green-100);
}
.map-frame iframe { width: 100%; height: clamp(280px, 46vw, 420px); border: 0; display: block; }

.transport { display: grid; gap: 18px; }
.transport-item { display: flex; gap: 14px; min-width: 0; }
.transport-item .card-icon { margin-bottom: 0; flex: 0 0 auto; width: 42px; height: 42px; }
.transport-item h3 { font-size: 16.5px; font-family: var(--serif); font-weight: 700; color: var(--green-900); }
.transport-item p { margin-top: 4px; font-size: 15px; color: var(--ink-700); line-height: 1.85; }

/* 統計條（首頁瀏覽數等） */
.stat-bar {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 34px;
  margin-top: 30px; font-size: 14px; color: var(--ink-500);
}
/* 裡面的項目都還沒有資料時整條收起來，不留一段空白 */
.stat-bar:not(:has([data-empty="0"])) { display: none; }

/* CTA */
.cta { background: linear-gradient(160deg, var(--green-900), var(--green-700)); color: #fff; text-align: center; }
.cta h2 { font-family: var(--serif); font-size: clamp(23px, 5vw, 34px); line-height: 1.45; font-weight: 700; }
.cta p { margin-top: 14px; color: rgba(255, 255, 255, .88); font-size: clamp(15px, 3.6vw, 17px); }
.cta .btn-row { justify-content: center; }
.cta .btn--primary { background: #fff; color: var(--green-900); }
.cta .btn--primary:hover { background: var(--gold-100); color: var(--green-900); }
.cta .btn--ghost { border-color: rgba(255, 255, 255, .7); color: #fff; }
.cta .btn--ghost:hover { background: rgba(255, 255, 255, .14); color: #fff; }

/* ==========================================================================
   頁尾
   ========================================================================== */
.site-footer { background: var(--green-900); color: rgba(255, 255, 255, .8); padding: clamp(42px, 7vw, 66px) 0 0; margin-top: 0; }
.footer-grid { display: grid; gap: clamp(26px, 4vw, 44px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.footer-col { min-width: 0; }
.footer-brand { font-family: var(--serif); font-size: 21px; font-weight: 700; color: #fff; }
.footer-brand span { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 255, 255, .6); margin-top: 4px; }
.footer-tagline { margin-top: 12px; font-size: 15px; line-height: 1.9; }
/* 標題改用暖白（原本的金色放在深橄欖上只有 3.77，小字讀起來吃力），
   暖色的角色交給下面那條橘線 */
.footer-title {
  font-size: 14px; font-weight: 700; color: var(--gold-100);
  letter-spacing: .08em; margin-bottom: 12px;
  padding-bottom: 10px; border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.footer-col p { font-size: 15px; line-height: 1.85; }
.footer-col a { color: #fff; text-decoration: none; }
.footer-col a:hover { text-decoration: underline; }
.footer-addr { margin-top: 4px; }
.footer-hours span { display: block; color: rgba(255, 255, 255, .58); font-size: 13px; }
.footer-hours + .footer-hours { margin-top: 10px; }
.footer-bottom { margin-top: clamp(30px, 5vw, 46px); padding-top: 20px; padding-bottom: 26px; border-top: 1px solid rgba(255, 255, 255, .14); }
.footer-bottom p { font-size: 13px; color: rgba(255, 255, 255, .55); line-height: 1.8; }

/* ---------- 動態偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
