:root {
  --cream: #f5efe3;
  --cream-2: #fbf7ee;
  --paper: #fffdf8;
  --ink: #2b2b2b;
  --indigo: #2a3e5c;
  --indigo-2: #4a5a7a;
  --dusty: #5b6e8c;
  --terra: #c0563a;
  --sage: #7a8e6e;
  --mustard: #c4a535;
  --line: #e6dcc8;
  --max: 72rem;
  --measure: 46rem;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(43, 43, 43, .06), 0 8px 24px rgba(43, 43, 43, .06);
  --font: "Noto Sans TC", -apple-system, "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; }
.article-body { overflow-wrap: break-word; word-break: break-word; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--dusty); text-underline-offset: 3px; }
a:hover { color: var(--terra); }

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
/* Centered reading column for article pages */
.prose { max-width: var(--measure); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(245, 239, 227, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar { display: flex; align-items: center; gap: 1rem; padding: .75rem 0; }
.site-header .brand { margin-right: auto; }
.bar-right { display: flex; align-items: center; gap: .6rem; order: 3; }
nav.main { order: 2; }
/* Prominent 掛號 button — patient acquisition */
.btn-book { display: inline-block; background: transparent; color: var(--indigo); border: 1px solid var(--indigo); text-decoration: none; font-weight: 600; padding: .45rem .9rem; border-radius: 10px; font-size: .92rem; white-space: nowrap; }
.btn-book:hover { border-color: var(--terra); color: var(--terra); }
.btn.btn-book-lg { background: var(--terra); box-shadow: 0 4px 14px rgba(192,86,58,.35); font-size: 1.05rem; }
.btn.btn-book-lg:hover { background: #a8482f; color: #fff; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--indigo); }
.brand img.logo { height: 30px; width: auto; max-width: 150px; object-fit: contain; display: block; }
.brand b { font-size: 1.12rem; letter-spacing: .5px; }
.brand span { display: block; font-size: .72rem; color: var(--indigo-2); font-weight: 400; }
nav.main a { color: var(--indigo); text-decoration: none; font-size: .95rem; padding: .35rem .55rem; border-radius: 8px; }
nav.main a:hover, nav.main a[aria-current="page"] { background: var(--cream-2); color: var(--terra); }

/* Hero */
.hero { padding: 3.5rem 0 2rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.9rem); line-height: 1.25; color: var(--indigo); margin: 0 0 .6rem; }
.hero p.lead { font-size: 1.15rem; color: var(--indigo-2); max-width: 40rem; }
.pill { display: inline-block; background: var(--cream-2); border: 1px solid var(--line); color: var(--indigo-2); border-radius: 999px; padding: .25rem .8rem; font-size: .82rem; }
/* Home hero: text + portrait, two columns on desktop */
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 2.5rem; align-items: center; }
.hero-photo { justify-self: end; width: 100%; }
.hero-photo img { width: 100%; max-width: 360px; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 16%; border-radius: 18px; box-shadow: var(--shadow); border: 1px solid var(--line); margin-left: auto; }
.hero-cta { margin-top: 1.3rem; display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }
.hero-note { margin-top: .55rem; font-size: .85rem; color: var(--indigo-2); }
@media (max-width: 640px) {
  .hero-grid { grid-template-columns: 1fr; gap: .9rem; text-align: center; }
  .hero-photo { justify-self: center; order: -1; width: auto; }
  .hero-photo img { max-width: 132px; aspect-ratio: 1 / 1; object-position: 50% 12%; margin: 0 auto; }
  .hero-cta { justify-content: center; }
}

/* Buttons */
.btn { display: inline-block; background: var(--indigo); color: #fff; text-decoration: none; padding: .6rem 1.1rem; border-radius: 10px; font-weight: 600; }
.btn:hover { background: var(--terra); color: #fff; }
.btn.ghost { background: transparent; color: var(--indigo); border: 1px solid var(--indigo); }
.btn.ghost:hover { border-color: var(--terra); color: var(--terra); }

/* Cards grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1.25rem; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(43,43,43,.1), 0 18px 40px rgba(43,43,43,.1); }
.card .thumb { aspect-ratio: 1 / 1; background: var(--cream-2); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: .9rem 1rem 1.1rem; }
.card .cat { font-size: .74rem; color: var(--terra); font-weight: 600; }
.card h3 { margin: .25rem 0 0; font-size: 1.02rem; line-height: 1.45; color: var(--indigo); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { font-size: .82rem; text-decoration: none; color: var(--indigo-2); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; }
.chip:hover, .chip[aria-current="true"] { background: var(--indigo); color: #fff; border-color: var(--indigo); }

/* Section */
section.block { padding: 2.25rem 0; }
h2.section { color: var(--indigo); font-size: 1.5rem; border-left: 5px solid var(--mustard); padding-left: .6rem; margin: 0 0 1.1rem; }

/* Article */
.article { padding: 2rem 0 1rem; }
.article header h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); color: var(--indigo); line-height: 1.3; margin: .4rem 0 .5rem; }
.article .meta { font-size: .85rem; color: var(--indigo-2); }
.article-body h2 { color: var(--indigo); font-size: 1.3rem; border-left: 4px solid var(--sage); padding-left: .55rem; margin-top: 2rem; }
.article-body h3 { color: var(--dusty); font-size: 1.08rem; }
.article-body { font-size: 1.06rem; }
.article-body ul, .article-body ol { padding-left: 1.3rem; }
.article-body a { word-break: break-word; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .8rem; margin: 1.5rem 0; }
.gallery img { border-radius: var(--radius); border: 1px solid var(--line); }
.refs { font-size: .9rem; color: #444; }
.disclaimer { margin-top: 2rem; padding: 1rem 1.1rem; background: var(--cream-2); border: 1px solid var(--line); border-radius: 12px; font-size: .9rem; color: var(--indigo-2); }

/* Footer */
.site-footer { margin-top: 3rem; background: var(--indigo); color: #dfe6f0; }
.site-footer a { color: #fff; }
.site-footer .in { padding-block: 2rem; display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.5rem; }
.site-footer small { color: #b8c4d6; }
@media (max-width: 640px) {
  .site-footer .in { grid-template-columns: 1fr; gap: 1.2rem; }
  nav.main a { padding: .35rem .4rem; font-size: .9rem; }
  /* keep the copyright clear of the floating LINE button */
  .foot-copy { padding-bottom: 4.5rem !important; }
}

/* About / publications */
.profile { display: grid; grid-template-columns: 240px 1fr; gap: 1.75rem; align-items: start; }
.profile img { width: 240px; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); }
@media (max-width: 640px) { .profile { grid-template-columns: 1fr; } .profile img { max-width: 220px; } }
.timeline li { margin-bottom: .4rem; }
.pubs li { margin-bottom: .8rem; font-size: .96rem; }
.badge { display:inline-block; background: var(--mustard); color:#3a2f00; font-size:.72rem; font-weight:700; border-radius:6px; padding:.1rem .4rem; margin-left:.3rem; }

/* Skip link */
.skip-link { position:absolute; left:-9999px; top:0; background:var(--indigo); color:#fff; padding:.5rem .9rem; border-radius:0 0 8px 0; z-index:100; }
.skip-link:focus { left:0; }
a:focus-visible, button:focus-visible { outline:3px solid var(--mustard); outline-offset:2px; }

/* Header brand text + hamburger + search */
.brand-txt { line-height:1.15; }
.nav-toggle { display:none; background:none; border:0; cursor:pointer; padding:.4rem; }
.nav-toggle span { display:block; width:24px; height:2px; background:var(--indigo); margin:5px 0; border-radius:2px; transition:.2s; }
.nav-search { font-size:.9rem; }
@media (max-width: 760px) {
  .nav-toggle { display:block; }
  nav.main { display:none; position:absolute; top:100%; left:0; right:0; background:var(--cream-2); border-bottom:1px solid var(--line); flex-direction:column; padding:.5rem 1rem 1rem; }
  nav.main.open { display:flex; }
  nav.main a { padding:.6rem .4rem; border-bottom:1px solid var(--line); }
  .site-header .bar { position:relative; }
  .brand-txt b { font-size:1rem; }
  .brand-txt { font-size:.66rem; }
}

/* Floating LINE button */
.line-float { position:fixed; right:16px; bottom:16px; z-index:40; display:flex; align-items:center; gap:.4rem; background:#06C755; color:#fff; text-decoration:none; padding:.6rem .9rem; border-radius:999px; font-weight:700; font-size:.92rem; box-shadow:0 6px 18px rgba(6,199,85,.4); }
.line-float:hover { background:#05b34c; color:#fff; }
.line-float svg { display:block; }
@media (max-width:520px){ .line-float span { display:none; } .line-float { padding:.7rem; } }

/* Share bar */
.sharebar { display:flex; align-items:center; flex-wrap:wrap; gap:.5rem; margin-top:1.75rem; padding-top:1.25rem; border-top:1px solid var(--line); }
.share-label { font-size:.9rem; color:var(--indigo-2); }
.share-btn { font-size:.85rem; text-decoration:none; border:1px solid var(--line); background:var(--paper); color:var(--indigo); border-radius:8px; padding:.35rem .75rem; cursor:pointer; font-family:inherit; }
.share-btn.line { background:#06C755; color:#fff; border-color:#06C755; }
.share-btn.fb { background:#1877F2; color:#fff; border-color:#1877F2; }
.share-btn:hover { filter:brightness(1.05); }

/* Footer social */
.foot-social { display:flex; flex-wrap:wrap; gap:1rem; margin-top:.8rem; }
.foot-social a { font-size:.9rem; }
/* Footer nav — wrap horizontally instead of a tall column */
.foot-nav { display:flex; flex-flow:row wrap; gap:.55rem 1.2rem; font-size:.92rem; }
.foot-nav a { padding:.15rem 0; }

/* LINE CTA block (home) */
.line-cta { background:#06C755; color:#fff; border-radius:var(--radius); padding:1.5rem 1.5rem; display:flex; align-items:center; gap:1.5rem; flex-wrap:wrap; }
.line-cta img { width:120px; height:120px; border-radius:12px; background:#fff; padding:6px; }
.line-cta h3 { margin:0 0 .3rem; font-size:1.25rem; }
.line-cta p { margin:0; opacity:.95; }
.line-cta .btn { background:#fff; color:#05a344; }
.line-cta .btn:hover { background:#eafff2; color:#05a344; }

/* Media "logo wall" — text-based press bar (trust) */
.mediawall { background: var(--cream-2); border-top:1px solid var(--line); border-bottom:1px solid var(--line); padding: 1.4rem 0; }
.mw-label { text-align:center; font-size:.78rem; letter-spacing:3px; color:var(--indigo-2); margin:0 0 .85rem; }
.mw-list { list-style:none; display:flex; flex-wrap:wrap; justify-content:center; gap:.55rem 1.6rem; padding:0; margin:0; }
.mw-list li { color:#7c869a; font-weight:700; font-size:1.02rem; }
.mw-link { display:block; text-align:center; margin-top:.9rem; font-size:.88rem; }
@media (max-width:600px){ .mw-list li { font-size:.9rem; } .mw-list { gap:.45rem 1rem; } }

/* Contact LINE + media kit */
.qr-card { display:flex; gap:1.25rem; align-items:center; flex-wrap:wrap; background:var(--paper); border:1px solid var(--line); border-radius:var(--radius); padding:1.25rem; }
.qr-card img { width:150px; height:150px; }
.mediakit { background:var(--cream-2); border:1px solid var(--line); border-radius:var(--radius); padding:1.25rem 1.4rem; }

/* Search */
.pf-wrap { max-width:44rem; }
:root { --pagefind-ui-primary:#2a3e5c; --pagefind-ui-text:#2b2b2b; --pagefind-ui-background:#fffdf8; --pagefind-ui-border:#e6dcc8; --pagefind-ui-tag:#f5efe3; --pagefind-ui-border-radius:12px; --pagefind-ui-font:var(--font); }

/* 404 */
.err { text-align:center; padding:4rem 0; }
.err h1 { font-size:3rem; color:var(--indigo); margin:.2rem 0; }

/* Stronger display weight for page titles */
.hero h1, .article-body > h1, .err h1 { font-weight: 900; letter-spacing: .3px; }
h2.section { font-weight: 700; }

/* Mobile typography — keep it comfortable, not oversized */
@media (max-width: 600px) {
  .container { padding: 0 1.15rem; }
  .hero { padding: 2.25rem 0 1.5rem; }
  .hero h1 { font-size: 1.65rem; line-height: 1.35; }
  .hero p.lead { font-size: 1rem; line-height: 1.7; }
  .article header h1, .article-body > h1 { font-size: 1.4rem; }
  .article-body { font-size: 1rem; line-height: 1.8; }
  .article-body h2 { font-size: 1.15rem; }
  .article-body h3 { font-size: 1.02rem; }
  h2.section { font-size: 1.2rem; }
  .card h3 { font-size: .98rem; }
  .chip { font-size: .8rem; }
  .btn { padding: .55rem .95rem; }
}
@media (max-width: 380px) {
  .hero h1 { font-size: 1.5rem; }
  .article-body { font-size: .97rem; }
}
