/* Toronto Massage Guide - components (v2). Requires tokens.css. Class-only; no inline styles needed. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--site-header-h) + var(--s-4)); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: var(--fs-base)/var(--lh-body) var(--font-sans);
  font-optical-sizing: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}
:lang(zh), :lang(zh-Hans), :lang(zh-CN) { line-height: var(--lh-cjk); letter-spacing: 0; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: var(--lh-tight); margin: 0; text-wrap: balance; color: var(--ink); }
:lang(en) :is(h1, h2) { letter-spacing: var(--track-display); }
:lang(en) :is(h3, h4) { letter-spacing: -0.01em; }
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3 { line-height: 1.35; letter-spacing: 0; }
p { margin: 0 0 var(--s-4); }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--sage); color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--s-7); }
@media (min-width: 48em) { .section { padding-block: var(--s-8); } body { padding-bottom: 0; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-5); }
.section-head h2 { font-size: var(--fs-lg); }
.section-head a { font-size: var(--fs-sm); font-weight: 600; min-height: var(--tap); display: inline-flex; align-items: center; white-space: nowrap; }
.skip-link { position: absolute; left: var(--s-4); top: -100px; background: var(--ink); color: var(--bg); padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); z-index: 100; }
.skip-link:focus { top: var(--s-2); }
.meta { font-size: var(--fs-xs); color: var(--ink-3); }

/* Partner type = transit line. Apply to any card/chip to set --line-c / --line-s. */
.line-care { --line-c: var(--line-care); --line-s: var(--line-care-soft); }
.line-faith { --line-c: var(--line-faith); --line-s: var(--line-faith-soft); }
.line-community { --line-c: var(--line-community); --line-s: var(--line-community-soft); }
.line-guide { --line-c: var(--primary); --line-s: var(--sage); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--tap); padding: 0 var(--s-5); border-radius: var(--r-pill);
  font: 600 var(--fs-sm)/1.2 var(--font-sans); text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .1s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); background: var(--surface); color: var(--ink); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: var(--s-4); min-height: var(--site-header-h); }
.brand { display: inline-flex; align-items: center; gap: var(--s-3); text-decoration: none; color: var(--ink); min-height: var(--tap); }
.brand__mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: var(--on-primary);
  display: grid; place-items: center; flex: none;
}
.brand__mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.brand__mark svg circle { fill: currentColor; stroke: none; }
.brand__mark svg .brand__stop { fill: var(--primary); stroke: currentColor; stroke-width: 1.8; }
.site-footer .brand__mark svg .brand__stop { fill: var(--footer-ink); stroke: var(--footer-bg); }
.brand__name { font: 600 1.0625rem/1.15 var(--font-display); }
:lang(en) .brand__name { letter-spacing: -0.015em; }
.brand__name small { display: block; font: 500 0.75rem/1.3 var(--font-sans); color: var(--ink-3); letter-spacing: 0; }
.site-nav { display: none; margin-left: auto; gap: var(--s-1); }
.site-nav a {
  position: relative; display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s-3);
  color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: var(--fs-sm); transition: color .2s var(--ease);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.site-nav a[aria-current="page"]::after { content: ""; position: absolute; left: var(--s-3); right: var(--s-3); bottom: 6px; height: 2px; border-radius: 2px; background: var(--primary); }
/* Language switch: segmented control */
.lang-switch { margin-left: auto; display: inline-flex; gap: 2px; padding: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); }
.lang-switch a { min-width: var(--tap); min-height: var(--tap); display: grid; place-items: center; padding: 0 var(--s-3); border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); text-decoration: none; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
@media (min-width: 48em) { .site-nav { display: flex; } .lang-switch { margin-left: var(--s-3); } }

/* ---------- Hero ---------- */
.hero { padding-block: var(--s-7) var(--s-6); }
.hero__eyebrow { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); margin-bottom: var(--s-4); }
.hero__eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.hero h1 { font-size: var(--fs-hero); line-height: 1.04; max-width: 16ch; }
:lang(en) .hero h1 { letter-spacing: -0.032em; }
.hero h1:lang(zh) { max-width: 13em; letter-spacing: 0; line-height: 1.3; }
.hero__lede { max-width: 34rem; color: var(--ink-2); font-size: 1.125rem; margin: var(--s-5) 0 var(--s-6); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* Route card: towns we cover, drawn as stops on a vertical line (the signature). */
.route-card {
  position: relative; overflow: hidden; padding: var(--s-5) var(--s-5) var(--s-4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.route-card::after { /* faint contour rings, like a map: decoration only */
  content: ""; position: absolute; right: -90px; top: -90px; width: 260px; height: 260px; border-radius: 50%; pointer-events: none;
  background: repeating-radial-gradient(circle, transparent 0 17px, var(--line) 17px 18px);
  opacity: .7; -webkit-mask-image: radial-gradient(circle, #000 35%, transparent 70%); mask-image: radial-gradient(circle, #000 35%, transparent 70%);
}
.route-card__title { position: relative; margin: 0 0 var(--s-4); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.route { position: relative; list-style: none; margin: 0; padding: 0; display: grid; }
.route li { position: relative; padding: 0 0 var(--s-4) var(--s-6); font-weight: 600; font-size: var(--fs-base); line-height: 1.35; }
.route li::before { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); z-index: 1; }
.route li::after { content: ""; position: absolute; left: 9px; top: 12px; bottom: -4px; width: 2px; background: var(--primary); }
.route li:last-child { padding-bottom: 0; }
.route li:last-child::after { display: none; }
.route li:nth-last-child(2)::after { background: repeating-linear-gradient(var(--primary) 0 4px, transparent 4px 8px); }
.route li.is-soon { color: var(--ink-3); font-weight: 500; }
.route li.is-soon::before { border-style: dashed; border-color: var(--line-strong); }
.route small { display: block; margin-top: 2px; font-weight: 400; font-size: var(--fs-sm); color: var(--ink-3); line-height: 1.45; }
:lang(zh) .route small { line-height: 1.7; }
@media (min-width: 64em) {
  .hero { padding-block: var(--s-8) var(--s-7); }
  .route-card { padding: var(--s-6); }
}

/* ---------- Category chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.category-chip {
  --line-c: var(--primary);
  display: inline-flex; align-items: center; gap: var(--s-2); flex: none;
  min-height: var(--tap); padding: 0 var(--s-4) 0 var(--s-3); border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  font-size: var(--fs-sm); font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.category-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-c); flex: none; }
.category-chip:hover { border-color: var(--line-strong); }
.category-chip[aria-current="true"], .category-chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.category-chip[aria-current="true"]::before, .category-chip.is-active::before { background: currentColor; }
.category-chip small { font-weight: 500; color: var(--ink-3); font-size: var(--fs-xs); }
.category-chip.is-active small, .category-chip[aria-current="true"] small { color: inherit; opacity: .8; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: var(--s-4); align-items: stretch; }
/* Auto columns: 1 card = one tidy column, 2 = two, 3+ fill the row. Cards never span, so heights stay balanced. */
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
@media (min-width: 64em) { .grid-auto { gap: var(--s-5); } }
@media (min-width: 40em) { .grid-2, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64em) { .grid-2 { gap: var(--s-5); } .grid-3 { grid-template-columns: repeat(3, 1fr); gap: var(--s-5); } }

/* ---------- Post card (question-led) ---------- */
.post-card {
  --line-c: var(--primary); --line-s: var(--sage);
  position: relative; display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.post-card:hover { box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--line) 50%, var(--line-strong)); }
.post-card:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.post-card__media { aspect-ratio: 16/9; background: var(--line-s); overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); flex: 1; }
.post-card__kicker { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.post-card__kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-c); flex: none; }
.post-card__title { font-size: var(--fs-md); }
.post-card__title a { color: var(--ink); text-decoration: none; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; } /* whole card is the tap target */
.post-card__title a:focus-visible { outline: none; }
.post-card__short { font-size: var(--fs-sm); color: var(--ink-2); margin: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.post-card__short b { color: var(--ink); font-weight: 600; }
.post-card__meta { margin: auto 0 0; padding-top: var(--s-3); font-size: var(--fs-xs); color: var(--ink-3); border-top: 1px solid var(--line); }

/* ---------- Biz card (partner) ---------- */
.biz-card {
  --line-c: var(--line-care); --line-s: var(--line-care-soft);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3);
}
.biz-card__head { display: flex; gap: var(--s-4); align-items: center; }
.biz-card__logo { width: 52px; height: 52px; border-radius: 14px; background: var(--line-s); color: var(--line-c); display: grid; place-items: center; font: 600 1.25rem/1 var(--font-display); flex: none; overflow: hidden; }
.biz-card__logo img { width: 100%; height: 100%; object-fit: cover; }
.biz-card__name { font-size: var(--fs-md); }
.biz-card__type { display: inline-block; align-self: flex-start; background: var(--line-s); color: var(--line-c); font-size: var(--fs-xs); font-weight: 600; padding: 2px var(--s-3); border-radius: var(--r-pill); }
.biz-card__where { margin: 0; font-size: var(--fs-sm); color: var(--ink-3); }
.biz-card__why { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }
.biz-card__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: auto; padding-top: var(--s-3); }
.biz-card__actions .btn { flex: 1 1 auto; padding: 0 var(--s-4); }

/* Disclosure: always visible near the recommendation, never buried in the footer. Clear, not loud. */
.disclosure {
  position: relative; display: flex; gap: var(--s-3); align-items: flex-start; margin: var(--s-4) 0;
  padding: var(--s-4) var(--s-4) var(--s-4) calc(var(--s-4) + 30px); background: var(--surface-2); border-radius: var(--r-md);
  border: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-2);
}
.disclosure::before {
  content: "i"; position: absolute; left: var(--s-4); top: calc(var(--s-4) + 2px); width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--ink-3); color: var(--ink-3); display: grid; place-items: center; font: 700 12px/1 var(--font-sans);
}
.disclosure p { margin: 0; }
.disclosure strong { color: var(--ink); font-weight: 600; }

/* ---------- Subscribe box ---------- */
.subscribe-box {
  background: var(--sage); color: var(--ink); border-radius: var(--r-lg);
  padding: var(--s-6) var(--s-5); margin-block: var(--s-7);
}
.subscribe-box h2, .subscribe-box h3 { font-size: var(--fs-lg); }
.subscribe-box > p { margin: var(--s-3) 0 var(--s-5); max-width: 34rem; color: var(--ink-2); }
.subscribe-box form { display: flex; flex-direction: column; gap: var(--s-3); max-width: 34rem; }
.subscribe-box label { font-size: var(--fs-sm); font-weight: 600; }
.subscribe-box input[type="email"] { min-height: 48px; padding: 0 var(--s-4); border-radius: var(--r-pill); border: 1px solid var(--line-strong); font: inherit; background: var(--surface); color: var(--ink); width: 100%; }
.subscribe-box .btn { background: var(--primary); color: var(--on-primary); min-height: 48px; }
.subscribe-box .btn:hover { background: var(--primary-hover); }
.subscribe-box .meta { color: var(--ink-3); margin: var(--s-3) 0 0; }

/* ---------- Flash ---------- */
.flash { display: flex; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 500; background: var(--info-bg); color: var(--info-ink); border: 1px solid currentColor; margin-block: var(--s-4); }
.flash::before { font-weight: 800; flex: none; content: "i"; width: 22px; height: 22px; border-radius: 50%; border: 2px solid currentColor; display: grid; place-items: center; font-size: 13px; line-height: 1; }
.flash.is-success { background: var(--ok-bg); color: var(--ok-ink); }
.flash.is-success::before { content: "\2713"; }
.flash.is-warning { background: var(--warn-bg); color: var(--warn-ink); }
.flash.is-warning::before { content: "!"; }
.flash.is-error { background: var(--err-bg); color: var(--err-ink); }
.flash.is-error::before { content: "\00d7"; font-size: 18px; }

/* ---------- Article ---------- */
.article-head { padding-block: var(--s-6) var(--s-5); max-width: var(--measure); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-2); font-size: var(--fs-xs); color: var(--ink-3); margin-bottom: var(--s-4); }
.crumbs a { color: var(--ink-2); display: inline-flex; min-height: 32px; align-items: center; }
.article-head h1 { font-size: var(--fs-xl); line-height: 1.08; margin-bottom: var(--s-4); }
.article-head h1:lang(zh) { line-height: 1.35; }
.short-answer {
  position: relative; background: var(--sage); border-radius: var(--r-md); padding: var(--s-5) var(--s-5) var(--s-5) calc(var(--s-5) + 4px);
  margin: var(--s-5) 0 0; color: var(--ink); font-size: 1.0625rem;
}
.short-answer::before { content: ""; position: absolute; left: 0; top: var(--s-5); bottom: var(--s-5); width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.short-answer b { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-xs); font-weight: 700; color: var(--primary); margin-bottom: var(--s-2); }
.short-answer__icon { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.short-answer__icon .icon { width: 16px; height: 16px; }
.byline { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); font-size: var(--fs-sm); color: var(--ink-3); }
.article-cover { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 21/9; margin: var(--s-5) 0 0; background: var(--sage); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.prose { max-width: var(--measure); font-size: var(--fs-base); }
@media (min-width: 48em) { .prose { font-size: 1.125rem; line-height: 1.7; } .prose:lang(zh) { line-height: 1.9; } }
.prose h2 { font-size: var(--fs-lg); margin: var(--s-7) 0 var(--s-4); }
.prose h3 { font-size: var(--fs-md); margin: var(--s-6) 0 var(--s-3); }
.prose ul, .prose ol { padding-left: var(--s-5); margin: 0 0 var(--s-5); }
.prose li { margin-bottom: var(--s-2); padding-left: var(--s-1); }
.prose li::marker { color: var(--accent); font-weight: 600; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-7) 0; }
.prose blockquote { margin: var(--s-6) 0; padding: var(--s-1) 0 var(--s-1) var(--s-5); border-left: 2px solid var(--primary); font: 500 1.25rem/1.5 var(--font-display); color: var(--ink); }
.prose blockquote:lang(zh) { line-height: 1.8; }
.prose blockquote cite { display: block; margin-top: var(--s-2); font: normal var(--fs-xs)/1.4 var(--font-sans); color: var(--ink-3); }
.prose table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin: var(--s-2) 0 var(--s-5); }
.prose th, .prose td { text-align: left; padding: var(--s-3); border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; border-bottom-color: var(--line-strong); }
.prose th, .prose td { min-width: 7.5rem; }
@media (min-width: 48em) { .prose table { display: table; } .prose th, .prose td { min-width: 0; } }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { min-height: var(--tap); padding: var(--s-4) var(--s-7) var(--s-4) 0; cursor: pointer; font-weight: 600; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: var(--s-2); top: 50%; translate: 0 -50%; font-size: 1.5rem; font-weight: 400; color: var(--primary); }
.faq details[open] summary::after { content: "\2212"; }
.faq details > :not(summary) { margin: 0 0 var(--s-4); color: var(--ink-2); }
.faq { margin: 0 0 var(--s-5); border-top: 1px solid var(--line); }
.faq summary:hover { color: var(--primary); }
.faq summary:focus-visible { outline-offset: -3px; }
.faq__a > p { margin-bottom: var(--s-3); }
.faq__a > :last-child { margin-bottom: 0; }
.recs { max-width: var(--measure); margin-block: var(--s-7); }
.recs > h2 { font-size: var(--fs-lg); margin-bottom: var(--s-2); }

/* ---------- Comments ---------- */
.comments { max-width: var(--measure); margin-block: var(--s-7); }
.comments > h2 { font-size: var(--fs-lg); margin-bottom: var(--s-4); }
.comment-list { list-style: none; margin: 0 0 var(--s-6); padding: 0; }
.comment { display: grid; grid-template-columns: 40px 1fr; gap: var(--s-3); padding: var(--s-4) 0; border-top: 1px solid var(--line); }
.comment__avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--sage); color: var(--primary); display: grid; place-items: center; font-weight: 600; font-size: var(--fs-sm); }
.comment__who { font-size: var(--fs-sm); font-weight: 600; }
.comment__who time { font-weight: 400; color: var(--ink-3); margin-left: var(--s-2); font-size: var(--fs-xs); }
.comment__badge { display: inline-block; margin-left: var(--s-2); background: var(--accent-soft); color: var(--accent); font-size: 0.75rem; font-weight: 700; padding: 1px var(--s-2); border-radius: var(--r-pill); }
.comment p { margin: var(--s-1) 0 0; }
.comment.is-pending { opacity: .8; }
.comment-empty { padding: var(--s-6) var(--s-5); border: 1px dashed var(--line-strong); border-radius: var(--r-md); color: var(--ink-2); text-align: center; }
.comment-form { display: grid; gap: var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); }
.comment-form h3 { font-size: var(--fs-md); }
.field { display: grid; gap: var(--s-2); }
.field label { font-size: var(--fs-sm); font-weight: 600; }
.field input, .field textarea {
  width: 100%; min-height: var(--tap); padding: var(--s-3) var(--s-4); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: inherit;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.field .hint { font-size: var(--fs-xs); color: var(--ink-3); }
.field.has-error input, .field.has-error textarea { border-color: var(--err-ink); }
.field .error { font-size: var(--fs-xs); font-weight: 600; color: var(--err-ink); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; } /* honeypot wrapper */

/* ---------- Footer ---------- */
/* Deep evergreen band that closes every page. Mobile: brand on top, the two link groups side by side, legal under a hairline.
   768+: brand | explore | about. All text pairs on --footer-bg are AA. */
.site-footer {
  position: relative; overflow: hidden;
  background: var(--footer-bg); color: var(--footer-ink-2);
  padding-block: var(--s-7) var(--s-5); font-size: var(--fs-sm);
}
.site-footer::before { /* the route card's contour rings, very faint: decoration only */
  content: ""; position: absolute; right: -140px; top: -140px; width: 420px; height: 420px; border-radius: 50%; pointer-events: none;
  background: repeating-radial-gradient(circle, transparent 0 23px, var(--footer-line) 23px 24px);
  -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 70%); mask-image: radial-gradient(circle, #000 30%, transparent 70%);
}
.site-footer .wrap { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6) var(--s-5); }
.site-footer p { margin: 0; }
.site-footer__brand { grid-column: 1 / -1; }
.site-footer__name { display: flex; align-items: center; gap: var(--s-3); font: 600 1.25rem/1.2 var(--font-display); color: var(--footer-ink); }
:lang(en) .site-footer__name { letter-spacing: -0.015em; }
.site-footer__name .brand__mark { background: var(--footer-ink); color: var(--footer-bg); }
.site-footer .site-footer__blurb { margin-top: var(--s-4); max-width: 26rem; text-wrap: pretty; color: var(--footer-ink-2); }
.site-footer h2 { font: 500 var(--fs-xs)/1.3 var(--font-sans); color: var(--footer-ink-2); margin: 0 0 var(--s-2); letter-spacing: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li a { display: flex; min-height: var(--tap); align-items: center; color: var(--footer-ink); font-weight: 500; text-decoration: none; line-height: 1.35; }
.site-footer li a:hover { color: #fff; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.site-footer :focus-visible { outline-color: var(--footer-ink); }
.site-footer .legal { grid-column: 1 / -1; padding-top: var(--s-5); border-top: 1px solid var(--footer-line); font-size: var(--fs-xs); line-height: 1.6; color: var(--footer-ink-2); max-width: none; text-wrap: pretty; }
:lang(zh) .site-footer .legal { line-height: 1.8; }
@media (min-width: 48em) {
  .site-footer { padding-block: var(--s-8) var(--s-6); }
  .site-footer .wrap { grid-template-columns: 1.7fr 1fr 1fr; gap: var(--s-7) var(--s-7); }
  .site-footer__brand { grid-column: auto; }
  .site-footer li a { min-height: 36px; }
}

/* ---------- Mobile bottom tab bar ---------- */
.tab-bar {
  position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab-bar a { min-height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink-3); text-decoration: none; font-size: 0.75rem; font-weight: 500; }
.tab-bar svg { width: 44px; height: 28px; padding: 2px 10px; border-radius: var(--r-pill); fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: background-color .2s var(--ease); }
.tab-bar a[aria-current="page"] { color: var(--primary); font-weight: 600; }
.tab-bar a[aria-current="page"] svg { background: var(--sage); stroke-width: 2; }
@media (min-width: 48em) { .tab-bar { display: none; } }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media (prefers-reduced-motion: no-preference) { .post-card:hover { transform: translateY(-2px); } }

/* Post card cover slot: with a cover it is the photo (16:9); without one it is a line-coloured icon on the ring motif, so cards line up and never look half-built. */
.post-card__media { position: relative; }
.post-card__media--ph { display: grid; place-items: center; background: radial-gradient(120% 90% at 85% 0%, var(--surface) 0 18%, transparent 60%), repeating-radial-gradient(circle at 85% 0%, transparent 0 22px, color-mix(in srgb, var(--line-c) 14%, transparent) 22px 23px), var(--line-s); }
.post-card__ph-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--line-c); box-shadow: 0 0 0 1px color-mix(in srgb, var(--line-c) 22%, transparent); }
.post-card__ph-icon .icon { width: 30px; height: 30px; }
@media (max-width: 39.99em) { .post-card__media--ph { aspect-ratio: 5/2; } .post-card__ph-icon { width: 52px; height: 52px; } }

/* Feature grid: the first card is wide (cover left, text right at 768+). Other cards fill 2 columns; if the count leaves one card alone in the last row, it goes full width as a wide card too, so no row is ever half empty. */
.grid-feature { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40em) {
  .grid-feature { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-feature > .post-card--featured, .grid-feature > .post-card:last-child:nth-child(even) { grid-column: 1 / -1; }
}
@media (min-width: 64em) { .grid-feature { gap: var(--s-5); } }
.post-card--featured .post-card__short { -webkit-line-clamp: 5; line-clamp: 5; }
@media (min-width: 48em) {
  .post-card--featured .post-card__title { font-size: var(--fs-lg); }
  .grid-feature > :is(.post-card--featured, .post-card:last-child:nth-child(even)) { flex-direction: row; }
  .grid-feature > :is(.post-card--featured, .post-card:last-child:nth-child(even)) .post-card__media { flex: 0 0 46%; aspect-ratio: auto; min-height: 15rem; }
  .grid-feature > :is(.post-card--featured, .post-card:last-child:nth-child(even)) .post-card__media img { position: absolute; inset: 0; }
  .grid-feature > :is(.post-card--featured, .post-card:last-child:nth-child(even)) .post-card__body { justify-content: center; padding: var(--s-6); }
  .grid-feature > :is(.post-card--featured, .post-card:last-child:nth-child(even)) .post-card__meta { margin-top: var(--s-2); }
}

/* Hero media: photo slot (16:9 banner on phones, 4:5 at 1024+). No photo configured = a sage panel with the concentric-ring motif and the little route. */
.hero__media { position: relative; overflow: hidden; border-radius: var(--r-lg); aspect-ratio: 16/9; background: var(--sage); }
.hero__media picture, .hero__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero__media--art { aspect-ratio: 5/2; background: linear-gradient(160deg, var(--sage), var(--surface-2)); color: var(--primary); }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-art__rings { opacity: .22; stroke-width: 1.2; }
.hero-art__sun { fill: var(--accent-soft); }
.hero-art__route path { stroke: var(--primary); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.hero-art__route circle { fill: var(--surface); stroke: var(--primary); stroke-width: 5; }
.hero-art__route .hero-art__stop { fill: var(--primary); stroke: var(--primary); }
@media (max-width: 63.99em) { .hero-art__route { display: none; } }
@media (min-width: 64em) { .hero__media, .hero__media--art { aspect-ratio: 4/5; } }

/* Trust band: three plain statements, no claim that every clinic is verified. */
.trust-band__list { list-style: none; margin: 0; padding: var(--s-4) var(--s-5); display: grid; gap: var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.trust-band__item { display: flex; align-items: flex-start; gap: var(--s-3); min-width: 0; }
.trust-band__icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--sage); color: var(--primary); }
.trust-band__icon .icon { width: 22px; height: 22px; }
.trust-band__text { display: grid; gap: 2px; min-width: 0; font-size: var(--fs-sm); line-height: 1.45; color: var(--ink-2); }
.trust-band__text strong { color: var(--ink); font-weight: 600; font-size: var(--fs-base); line-height: 1.3; }
@media (min-width: 64em) {
  .trust-band__list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: var(--s-5) var(--s-6); }
  .trust-band__item { padding-inline: var(--s-5); }
  .trust-band__item:first-child { padding-left: 0; }
  .trust-band__item:last-child { padding-right: 0; }
  .trust-band__item + .trust-band__item { border-left: 1px solid var(--line); }
}

/* Topic tiles: big category cards with a line icon on a soft background (sage / accent-soft / mist). */
.topic-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
.topic-tiles__li { display: flex; min-width: 0; }
@media (min-width: 48em) { .topic-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); } .topic-tile { min-height: 11rem; } }
.topic-tile {
  --tile-bg: var(--sage); --tile-ink: var(--primary);
  position: relative; overflow: hidden; flex: 1; display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-5);
  border-radius: var(--r-lg); background: var(--tile-bg); border: 1px solid transparent; color: var(--ink); text-decoration: none;
  transition: border-color .2s var(--ease), box-shadow .25s var(--ease);
}
.topic-tile--b { --tile-bg: var(--accent-soft); --tile-ink: var(--accent); }
.topic-tile--c { --tile-bg: var(--surface-2); --tile-ink: var(--line-c); }
.topic-tile::after { content: ""; position: absolute; right: -64px; bottom: -64px; width: 190px; height: 190px; border-radius: 50%; pointer-events: none; background: repeating-radial-gradient(circle, transparent 0 14px, color-mix(in srgb, var(--tile-ink) 16%, transparent) 14px 15px); }
.topic-tile:hover { border-color: color-mix(in srgb, var(--tile-ink) 40%, transparent); box-shadow: var(--shadow-2); }
.topic-tile:focus-visible { border-radius: var(--r-lg); }
.topic-tile > * { position: relative; z-index: 1; }
.topic-tile__icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); color: var(--tile-ink); margin-bottom: var(--s-2); }
.topic-tile__icon .icon { width: 26px; height: 26px; }
.topic-tile__name { font: 600 var(--fs-md)/1.25 var(--font-display); }
.topic-tile__text { font-size: var(--fs-sm); color: var(--ink-2); max-width: 26rem; }
.topic-tile__cta { margin-top: auto; padding-top: var(--s-2); display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); font-size: var(--fs-sm); font-weight: 600; color: var(--tile-ink); }
.topic-tile__cta .icon { width: 18px; height: 18px; }
/* 有配图的大卡：照片放在卡片顶部、铺满卡片宽度（抵消卡片的内边距），取代图标；没有配图的分类仍是图标。 */
.topic-tile__media { display: block; margin: calc(var(--s-5) * -1) calc(var(--s-5) * -1) var(--s-2); aspect-ratio: 5/2; overflow: hidden; background: var(--surface-2); }
.topic-tile__media picture, .topic-tile__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 48em) { .topic-tile__media { aspect-ratio: 16/9; } }
.topic-tile--photo::after { display: none; }

/* Partner monogram: no logo uploaded = initials on a soft tile with the ring motif (Chinese names: first character). */
.biz-card__logo--mono { position: relative; isolation: isolate; background: linear-gradient(150deg, var(--line-s), color-mix(in srgb, var(--line-s) 55%, var(--surface))); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line-c) 24%, transparent); }
.biz-card__logo--mono::before { content: ""; position: absolute; z-index: -1; right: -45%; top: -45%; width: 140%; aspect-ratio: 1; border-radius: 50%; background: repeating-radial-gradient(circle, transparent 0 7px, color-mix(in srgb, var(--line-c) 20%, transparent) 7px 8px); }
.monogram { font: inherit; color: var(--line-c); }
.monogram--two { font-size: .85em; letter-spacing: .04em; }

/* Article table of contents: server-rendered from the h2s, shown beside the article at 1024+ only, sticky. */
.toc { display: none; }
.toc__title { margin: 0 0 var(--s-2); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); }
.toc__list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc__list a { display: flex; align-items: center; min-height: var(--tap); padding: var(--s-1) 0 var(--s-1) var(--s-4); margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.4; text-decoration: none; }
.toc__list a:hover { color: var(--ink); border-left-color: var(--line-strong); }
.toc__list a[aria-current="location"] { color: var(--ink); font-weight: 600; border-left-color: var(--primary); }
@media (min-width: 64em) {
  .article.article--toc { width: 100%; max-width: calc(var(--measure) + 15rem + var(--s-7)); }
  .article--toc > .subscribe-box { max-width: var(--measure); }
  .article--toc .post__layout { display: grid; grid-template-columns: minmax(0, var(--measure)) 15rem; column-gap: var(--s-7); align-items: start; }
  .article--toc .toc { display: block; position: sticky; top: calc(var(--site-header-h) + var(--s-5)); margin-top: var(--s-7); max-height: calc(100vh - var(--site-header-h) - var(--s-7)); overflow-y: auto; }
}
