/*
Theme Name: Almond Medical 杏康醫療
Author: Almond Medical
Description: Bilingual (繁體中文 / English) one-page clinic theme for Almond Medical 杏康醫療, converted from the Figma Make design. Includes an online booking form that emails the clinic. All text is editable in Appearance > Customize > 杏康醫療 Website Text; clinics, doctors, services and testimonials have their own dashboard screens.
Version: 2.2.9
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: almond-medical
*/

:root {
  --background: #F7F4EE;
  --foreground: #2A2018;
  --card: #FDFAF4;
  --primary: #00726C;
  --primary-foreground: #F7F4EE;
  --muted: #EDE8DC;
  --muted-foreground: #7A6E5A;
  --accent: #B5843A;
  --border: #D8CEB8;
  --radius: 4px;
  --serif: 'Noto Serif TC', 'Songti TC', serif;
  --sans: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, blockquote { margin: 0; }
button { font: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
section[id] { scroll-margin-top: 4rem; }

/* Language switching: both languages are in the markup, CSS shows one. */
html:not(.am-lang-en) .am-l-en,
html.am-lang-en .am-l-zh { display: none !important; }

.am-skip {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  padding: .5rem 1rem; background: var(--primary); color: var(--primary-foreground);
  border-radius: var(--radius); font-size: .875rem;
}
.am-skip:focus { top: 1rem; }

.am-container { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
.am-container--narrow { max-width: 56rem; }
.am-center { text-align: center; }

/* ── Buttons ── */
.am-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .5rem 1.25rem; font-size: .875rem; font-family: var(--sans);
  border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer; transition: opacity .2s; text-align: center;
}
.am-btn:hover { opacity: .9; }
.am-btn--primary { background: var(--primary); color: var(--primary-foreground); }
.am-btn--ghost { border-color: rgba(255,255,255,.4); color: #F7F4EE; background: transparent; }
.am-btn--lg { padding: .875rem 2rem; font-weight: 500; }
.am-btn--block { width: 100%; padding: .875rem; font-weight: 500; }

/* ── Header ── */
.am-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  /* Solid creamy bar over the landing; turns into see-through frosted glass once you scroll (is-solid). */
  background: rgba(var(--am-bar),.97); border-bottom: 1px solid rgba(120,96,60,.2);
  transition: background .4s, border-color .4s;
}
.admin-bar .am-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .am-header { top: 46px; } }
.am-header.is-solid {
  background: rgba(var(--am-bar),.66);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: transparent;
}
/* The open phone menu needs a solid background to stay readable. */
.am-header.is-open { background: rgba(var(--am-bar),.98); }
/* Header bar colour: creamy sand, a shade stronger than the landing filter. */
:root { --am-bar: 223,211,188; }
.am-header__inner { display: flex; align-items: center; justify-content: space-between; height: 4rem; }

.am-brand { display: flex; align-items: center; gap: .625rem; }
.am-brand img { height: 2rem; width: auto; transition: filter .3s; }
.am-brand__name, .am-brand__sub { display: block; line-height: 1; white-space: nowrap; transition: color .3s; }
.am-brand__name { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; color: #F7F4EE; }
.am-brand__sub { margin-top: .2rem; font-size: .65rem; letter-spacing: .08em; color: rgba(255,255,255,.65); }
.is-solid .am-brand img { filter: none; }
/* Header Book button: hidden over the landing section (which has its own Book button), fades in after it.
   While hidden it takes no space, so the language switch sits at the far right. */
.am-header__book {
  max-width: 12rem; overflow: hidden; white-space: nowrap;
  transition: opacity .3s, visibility .3s, max-width .35s ease, padding .35s ease, margin .35s ease, border-width .35s ease;
}
.am-header.has-hero:not(.is-past-hero) .am-header__book {
  opacity: 0; visibility: hidden; pointer-events: none;
  max-width: 0; padding-inline: 0; margin-left: -.75rem; border-width: 0;
}
/* Home page logo intro: the almond rolls in from the left (half a turn over about its own
   half-circumference, so it reads as rolling rather than sliding) and fades in as it settles. */
.am-brand__mark { position: relative; display: inline-flex; flex-shrink: 0; }
.am-header:not([data-solid]) .am-brand__mark { animation: am-logo-roll 1.6s cubic-bezier(.22,.75,.3,1) .3s both; }
@keyframes am-logo-roll {
  0%   { opacity: 0; transform: translateX(-4rem) rotate(-180deg); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .am-header:not([data-solid]) .am-brand__mark { animation: none; }
}
.is-solid .am-brand__name { color: var(--primary); }
.is-solid .am-brand__sub { color: var(--muted-foreground); }

.am-nav { display: none; align-items: center; gap: 1.75rem; }
.am-nav a { font-size: .875rem; letter-spacing: .04em; color: rgba(247,244,238,.9); transition: opacity .2s, color .3s; }
.am-nav a:hover { opacity: .7; }
.is-solid .am-nav a { color: var(--primary); }

.am-header__actions { display: none; align-items: center; gap: .75rem; }

.am-lang-toggle {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .375rem .75rem; font-size: .75rem; font-weight: 500; letter-spacing: .05em;
  background: transparent; border: 1px solid rgba(255,255,255,.35); color: rgba(247,244,238,.85);
  border-radius: var(--radius); cursor: pointer; transition: border-color .3s, color .3s;
}
.is-solid .am-lang-toggle { border-color: var(--primary); color: var(--muted-foreground); }
.am-lang-toggle .zh, .am-lang-toggle .en { opacity: .45; }
.am-lang-toggle .sep { opacity: .4; }
html:not(.am-lang-en) .am-lang-toggle .zh,
html.am-lang-en .am-lang-toggle .en { opacity: 1; }

.am-menu-btn { display: block; padding: .5rem; background: none; border: 0; cursor: pointer; }
.am-menu-btn span { display: block; width: 1.5rem; height: 2px; background: #F7F4EE; transition: all .2s; }
.am-menu-btn span + span { margin-top: .375rem; }
.is-solid .am-menu-btn span { background: var(--foreground); }
.is-open .am-menu-btn span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.is-open .am-menu-btn span:nth-child(2) { opacity: 0; }
.is-open .am-menu-btn span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.am-mobile-menu { display: none; padding: .5rem 1.5rem 1.5rem; }
.is-open .am-mobile-menu { display: block; }
.am-mobile-menu__link { display: block; padding: .625rem 0; font-size: .875rem; color: var(--primary); }
.am-mobile-menu__actions { display: flex; gap: .75rem; margin-top: 1rem; }
.am-mobile-menu .am-lang-toggle { padding: .5rem 1rem; border-color: var(--primary); color: var(--muted-foreground); }
.am-mobile-menu__actions .am-btn { flex: 1; }

@media (min-width: 768px) {
  .am-header__inner { height: 5.5rem; }
  .am-nav, .am-header__actions { display: flex; }
  /* Menu centred on its own, so it stays put when the Book button appears or hides. */
  .am-header__inner { display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); column-gap: 1rem; }
  .am-header__actions { justify-self: end; }
  .am-menu-btn, .am-mobile-menu, .is-open .am-mobile-menu { display: none; }
  section[id] { scroll-margin-top: 5.5rem; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .am-nav { gap: 1.25rem; }
}

/* ── Hero ── */
.am-hero {
  position: relative; display: flex; align-items: center; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  background: linear-gradient(160deg, #004C48 0%, #00726C 60%, #1F8780 100%);
}
.am-hero__bg { position: absolute; inset: 0; }
.am-hero__bg { overflow: hidden; }
/* Landing photo, sharp (no blur); the translucent cream filter sits over it. */
.am-hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 60% center; }
/* The photo starts just below the header bar (solid on the landing), so the whole plant, tip included, is visible.
*/
.am-hero__bg { top: 4rem; }
@media (min-width: 768px) { .am-hero__bg { top: 5.5rem; } }
/* Sand filter (the About section's colour) over the landing photo, with dark text on top. */
.am-hero { background: rgb(var(--am-hero-sand)); }
/* Landing filter colour: a deeper, warmer sand than the page background, so the landing is less glaring. */
:root { --am-hero-sand: 232,223,206; }
#about.am-section { position: relative; }
.am-hero__tint {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(var(--am-hero-sand),.95) 0%, rgba(var(--am-hero-sand),.93) 40%, rgba(var(--am-hero-sand),.75) 60%, rgba(var(--am-hero-sand),.55) 100%);
}
@media (max-width: 767px) {
  .am-hero__tint { background: linear-gradient(180deg, rgba(var(--am-hero-sand),.92) 0%, rgba(var(--am-hero-sand),.9) 60%, rgba(var(--am-hero-sand),.94) 100%); }
}
.am-hero .am-hero__eyebrow { color: var(--foreground); opacity: 1; font-weight: 500; }
.am-hero .am-hero__inner h1 { color: var(--primary); }
.am-hero .am-hero__body { color: #3E3428; opacity: 1; font-weight: 400; }
.am-hero .am-btn--ghost { background: transparent; border-color: var(--primary); color: var(--primary); }
.am-hero .am-btn--primary { border-color: transparent; }
/* Scroll cue kept quiet, like the original: muted colour, low strength, hairline. */
.am-hero .am-scroll-cue { opacity: .55; }
.am-hero .am-scroll-cue span { color: var(--muted-foreground); }
/* Scroll cue: a faint track with a dark highlight sliding down it. */
.am-hero .am-scroll-cue i {
  position: relative; overflow: hidden; width: 1px; height: 2rem;
  background: rgba(122,110,90,.25); border-radius: 0; animation: none;
}
.am-hero .am-scroll-cue i::after {
  content: ""; position: absolute; left: 0; top: -45%; width: 100%; height: 45%;
  background: var(--muted-foreground); border-radius: 0;
  animation: am-scroll-slide 1.8s cubic-bezier(.45,0,.55,1) infinite;
}
@keyframes am-scroll-slide { 0% { top: -45%; } 75%, 100% { top: 100%; } }
.am-hero__leaves span { border-color: rgba(0,114,108,.7); }
/* Top bar over the light landing: dark text and the full-colour logo from the start. */
.am-header:not(.is-solid) .am-nav a { color: var(--primary); }
.am-header:not(.is-solid) .am-brand__name { color: var(--primary); }
.am-header:not(.is-solid) .am-brand__sub { color: var(--muted-foreground); }
.am-header:not(.is-solid) .am-lang-toggle { border-color: var(--primary); color: var(--muted-foreground); }
.am-header:not(.is-solid) .am-menu-btn span { background: var(--foreground); }
.am-hero__leaves { position: absolute; top: 0; right: 0; bottom: 0; width: 50%; overflow: hidden; opacity: .1; pointer-events: none; }
.am-hero__leaves span {
  position: absolute; border: 1.5px solid rgba(255,255,255,.8);
  border-radius: 60% 40% 60% 40% / 50% 50% 50% 50%;
}
.am-hero__inner { position: relative; width: 100%; display: grid; gap: 3rem; align-items: center; padding-top: 6rem; padding-bottom: 4rem; }
.am-hero__eyebrow { margin-bottom: 1.5rem; font-size: .75rem; letter-spacing: .3em; color: #C2E0DD; opacity: .75; }
.am-hero h1 { margin-bottom: 1.5rem; font-family: var(--serif); font-weight: 600; font-size: 2.25rem; line-height: 1.3; color: #F7F4EE; }
.am-hero__body { margin-bottom: 2.5rem; font-size: 1rem; line-height: 2; font-weight: 300; color: #E0DAD0; opacity: .8; }
.am-hero__ctas { display: flex; flex-wrap: wrap; gap: 1rem; }
.am-hero__ctas .am-btn--primary { border-color: rgba(255,255,255,.15); }

.am-scroll-cue {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .5rem; opacity: .6;
}
.am-scroll-cue span { font-size: .75rem; letter-spacing: .1em; color: #E0DAD0; white-space: nowrap; }
.am-scroll-cue i { width: 1px; height: 2rem; background: var(--border); animation: am-pulse 2s cubic-bezier(.4,0,.6,1) infinite; }
@keyframes am-pulse { 50% { opacity: .5; } }

@media (max-width: 767px) {
  .am-hero__inner { padding-bottom: 7rem; }
}
@media (min-width: 768px) {
  /* Text column wide enough for 「守護您與家人的健康」 on one line; the seedling shows on the right. */
  .am-hero__inner { grid-template-columns: minmax(0, 42rem); }
  .am-hero h1 { font-size: 3rem; }
  .am-hero__body { font-size: 1.125rem; }
}
@media (min-width: 1024px) {
  .am-hero h1 { font-size: 3.75rem; }
}
/* English landing heading and intro are 2px smaller than the Chinese. */
html.am-lang-en .am-hero h1 { font-size: calc(2.25rem - 2px); }
/* Each English line wraps evenly on narrow screens (no lone "Care," on its own line). */
html.am-lang-en .am-hero h1 .am-l-en { display: block; text-wrap: balance; }
html.am-lang-en .am-hero h1 br { display: none; }
html.am-lang-en .am-hero__body { font-size: calc(1rem - 2px); }
@media (min-width: 768px) {
  html.am-lang-en .am-hero h1 { font-size: calc(3rem - 2px); }
  html.am-lang-en .am-hero__body { font-size: calc(1.125rem - 2px); }
}
@media (min-width: 1024px) {
  html.am-lang-en .am-hero h1 { font-size: calc(3.75rem - 2px); }
}

/* ── Sections ── */
.am-section { padding: 6rem 0; }
.am-section--muted { background: var(--muted); }
.am-section--primary { background: var(--primary); }
.am-eyebrow { margin-bottom: 1rem; font-size: 1.125rem; font-weight: 500; letter-spacing: .2em; color: var(--accent); }
.am-h2 { font-family: var(--serif); font-weight: 600; font-size: 1.875rem; line-height: 1.375; }
.am-lead { line-height: 2; font-weight: 300; color: var(--muted-foreground); }
.am-pre { white-space: pre-line; }
@media (min-width: 768px) {
  .am-section { padding: 8rem 0; }
  .am-h2 { font-size: 2.25rem; }
}

/* ── About ── */
.am-about { display: grid; gap: 4rem; align-items: center; }
.am-about__media { position: relative; }
/* The photo starts flush against the bottom of the teal landing section. */
#about.am-section { padding-top: 0; }
.am-about__media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 0 0 calc(var(--radius) + 8px) calc(var(--radius) + 8px); }
.am-about__badge {
  position: absolute; bottom: -1.5rem; right: -.75rem; max-width: 220px; padding: 1.5rem;
  background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
}
.am-about__year { font-family: var(--serif); font-weight: 600; font-size: 1.75rem; color: var(--primary); }
.am-about__founded { margin-top: .25rem; font-size: .875rem; color: var(--muted-foreground); }
.am-about .am-h2 { margin-bottom: 1.5rem; }
.am-mv { display: grid; gap: 1.75rem; margin-bottom: 2.5rem; }
/* Same treatment as the section labels (weight 500, which the font actually provides), a little larger and airier. */
.am-mv__label { margin-bottom: .625rem; font-size: 1rem; font-weight: 500; letter-spacing: .25em; color: var(--accent); }
/* 使命 / 願景 icons: thin gold line drawings (a hand holding a heart; a sprout), coloured by the label colour. */
.am-mv__label { display: flex; align-items: center; gap: .5rem; }
.am-mv__label::before {
  content: ""; flex-shrink: 0; width: 1.375rem; height: 1.375rem; background: currentColor;
  -webkit-mask: var(--am-mv-icon) center / contain no-repeat; mask: var(--am-mv-icon) center / contain no-repeat;
}
.am-mv > div:nth-child(1) .am-mv__label { --am-mv-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M12 12.5C9.5 10.8 7 9.2 7 6.9 7 5.2 8.3 4 9.8 4c1 0 1.8.5 2.2 1.3C12.4 4.5 13.2 4 14.2 4 15.7 4 17 5.2 17 6.9c0 2.3-2.5 3.9-5 5.6z'/><path d='M2.5 15h3l3 2h4a1.4 1.4 0 0 1 0 2.8H9'/><path d='M12.6 19.3l5.2-2.5a1.5 1.5 0 0 1 1.6 2.5L13.6 22H7.5l-2-1h-3'/></svg>"); }
.am-mv > div:nth-child(2) .am-mv__label { --am-mv-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M12 21V11'/><path d='M12 14.5c0-3.5-2.5-5.5-6.5-5.5 0 3.5 2.5 5.5 6.5 5.5z'/><path d='M12 11.5c0-4 2.5-6.5 6.5-6.5 0 4-2.5 6.5-6.5 6.5z'/><path d='M7.5 21h9'/></svg>"); }
.am-features { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.am-feature__title { margin-bottom: .25rem; font-size: .875rem; font-weight: 500; color: var(--primary); }
/* Point icons (same thin line style as 使命 / 願景), coloured by the title colour: stethoscope, calendar, home. */
.am-feature__title { display: flex; align-items: center; gap: .4rem; }
.am-feature__title::before {
  content: ""; flex-shrink: 0; width: 1.125rem; height: 1.125rem; background: currentColor;
  -webkit-mask: var(--am-ft-icon) center / contain no-repeat; mask: var(--am-ft-icon) center / contain no-repeat;
}
.am-features > div:nth-child(1) .am-feature__title { --am-ft-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M5 3h1v5a4 4 0 0 0 8 0V3h1'/><path d='M10 12v3a5 5 0 0 0 10 0v-2'/><path d='M22 11a2 2 0 1 1-4 0 2 2 0 0 1 4 0z'/></svg>"); }
.am-features > div:nth-child(2) .am-feature__title { --am-ft-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6.5A1.5 1.5 0 0 1 5.5 5h13A1.5 1.5 0 0 1 20 6.5v12a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 4 18.5z'/><path d='M4 10h16M8 3v4M16 3v4'/><path d='M9 15l2 2 4-4'/></svg>"); }
.am-features > div:nth-child(3) .am-feature__title { --am-ft-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M3.5 11 12 4l8.5 7'/><path d='M5.5 9.5V20h13V9.5'/><path d='M12 17.2c-1.5-1-2.8-1.9-2.8-3.2 0-.9.7-1.6 1.6-1.6.5 0 1 .3 1.2.7.2-.4.7-.7 1.2-.7.9 0 1.6.7 1.6 1.6 0 1.3-1.3 2.2-2.8 3.2z'/></svg>"); }
.am-feature__desc { font-size: .875rem; line-height: 1.625; font-weight: 300; color: var(--muted-foreground); }
@media (min-width: 768px) {
  /* Photo column stretches to the full height of the text column. */
  .am-about { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .am-about__media { min-width: 0; width: 100%; }
  /* Space above/below so longer (English) text never touches the teal edge. */
  .am-about > div:last-child { align-self: center; padding-block: 4rem; }
  /* Fills the screen below the menu bar; at least a 4:5 portrait; taller still if the text needs it. */
  .am-about__media { aspect-ratio: 4 / 5; min-height: calc(100vh - 5rem); min-height: calc(100svh - 5rem); }
  .am-about__media img { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
  .am-about__badge { right: -1.5rem; }
}
/* About section on the same deep teal as Services, with light text. */
/* About on a cream background with dark text (teal is used for Contact). */
#about.am-section { background: var(--background); }
/* The plant photo's white background takes on the section's cream (multiply blend), so the plant sits on the page. */
#about .am-about__media { background: var(--background); isolation: isolate; }
#about .am-about__media img,
#about .am-about__media .am-about__grow {
  mix-blend-mode: multiply;
  /* Bottom of the plant fades softly into the cream. */
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 68%, rgba(0,0,0,.5) 84%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 68%, rgba(0,0,0,.5) 84%, transparent 100%);
}

/* ── Plant time-lapse ──
   Hidden unless main.js adds .am-grow; then the video shows the sprout, plays once in view, and when it
   ends the sharper photo replaces its last frame (.is-grown). No JS / reduced motion: photo only.
   The video is cropped to the plant (narrower than the photo); main.js sizes and places it inside this
   frame so it lines up exactly with the plant in the photo. Its side edges fade so the crop never shows. */
.am-about__grow {
  position: absolute; inset: 0; overflow: hidden;
  border-radius: 0 0 calc(var(--radius) + 8px) calc(var(--radius) + 8px);
  opacity: 0; pointer-events: none;
}
.am-about__grow video {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: fill; display: block;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 1.2%, #000 98.8%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 1.2%, #000 98.8%, transparent 100%);
}
/* Theme plant: shown whole (not cropped at the sides) and standing on the bottom edge, so the leaves,
   which sway wider while growing, are never cut off. main.js places the video to the same scale. */
#about .am-about__media--plant img { object-fit: contain; object-position: 50% 100%; }
/* The switch from the video's last frame to the photo is instant (they line up), not a crossfade. */
#about .am-about__media.am-grow img { opacity: 0; }
.am-about__media.am-grow .am-about__grow { opacity: 1; }
#about .am-about__media.am-grow.is-grown img { opacity: 1; }
.am-about__media.am-grow.is-grown .am-about__grow { opacity: 0; }
/* Blend band between the landing and About: its own strip that runs from sand into the About teal. */
/* Eased (smoothstep) stops so it starts and finishes gently, with no visible edge at either end. */
/* Sharp edge between the landing and About (no fade band). */
#about .am-eyebrow { color: var(--accent); }
#about .am-h2 { color: var(--foreground); }
#about .am-lead { color: var(--muted-foreground); }
#about .am-mv__label { color: var(--accent); }
#about .am-feature__title { color: var(--primary); }
#about .am-feature__desc { color: var(--muted-foreground); }

/* ── Services ── */
.am-services__head { display: grid; gap: 2rem; align-items: end; margin-bottom: 4rem; }
.am-cards { display: grid; gap: 1.5rem; }
.am-card {
  padding: 2rem; background: var(--card); border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px); transition: transform .3s, box-shadow .3s;
}
.am-card:hover { transform: translateY(-4px); box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1); }
.am-card__icon { margin-bottom: 1.25rem; font-size: 1.875rem; line-height: 1; }
.am-card h3 { margin-bottom: .75rem; font-family: var(--serif); font-weight: 600; font-size: 1.125rem; }
.am-card p { font-size: .875rem; line-height: 2; font-weight: 300; color: var(--muted-foreground); }
@media (min-width: 640px) { .am-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .am-services__head { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .am-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.am-services__closing { margin-top: 3rem; max-width: 40rem; }
.am-services__intro { margin-top: 1rem; }
.am-services__head:has(> :only-child) { grid-template-columns: 1fr; }
.am-card h3:last-child { margin-bottom: 0; }
/* Service card text centred both ways, so title-only cards sit in the middle too. */
.am-card { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

/* ── Services as three boxes  ── */
.am-svc-grid { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
.am-svc {
  display: flex; flex-direction: column; gap: 1.125rem; min-width: 0; padding: 2rem;
  background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 6px);
}
.am-svc__title { font-family: var(--serif); font-weight: 600; font-size: 1.375rem; line-height: 1.4; color: var(--primary); text-wrap: balance; }
.am-svc p { font-size: .9375rem; line-height: 1.9; font-weight: 300; color: var(--muted-foreground); }
.am-svc__list { display: grid; gap: .625rem; margin: 0; padding: 0; list-style: none; }
.am-svc__list li { position: relative; padding-left: 1.125rem; font-size: .9375rem; line-height: 1.7; font-weight: 300; color: var(--muted-foreground); }
.am-svc__list li::before { content: ""; position: absolute; left: 0; top: .7em; width: .375rem; height: .375rem; border-radius: 50%; background: var(--primary); }
.am-svc__list strong { font-weight: 500; color: var(--foreground); }
@media (min-width: 768px) { .am-svc { padding: 2.5rem; } }
@media (min-width: 1024px) { .am-svc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .am-svc { padding: 2rem; } }

/* Services section: the landing photo under the same teal filter, white boxes on top. */
.am-section--photo { position: relative; overflow: hidden; background: #004C48; }
.am-section__bg { position: absolute; inset: 0; }
.am-section__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 60% center; }
.am-section__tint { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,60,57,.9) 0%, rgba(0,76,72,.82) 45%, rgba(0,96,90,.72) 100%); }
.am-section--photo > .am-container { position: relative; }
.am-section--photo .am-eyebrow { color: #C2E0DD; }
@media (max-width: 767px) {
  .am-section__tint { background: linear-gradient(180deg, rgba(0,60,57,.88) 0%, rgba(0,76,72,.82) 60%, rgba(0,76,72,.9) 100%); }
}
/* ── Doctors ── */
.am-doctors__head { margin-bottom: 4rem; }
/* Cards at 0.75x their earlier size (about 327px each on desktop), centred under the heading. */
.am-doctors { display: grid; gap: 2rem; max-width: 42.375rem; margin: 0 auto; }
/* Wider screens: same card size, more breathing room between the two cards. */
@media (min-width: 768px) { .am-doctors { column-gap: 6rem; max-width: 46.875rem; } }
.am-doctor {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 6px);
}
.am-doctor__photo { aspect-ratio: 4 / 5; overflow: hidden; background: var(--muted); }
.am-doctor__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.am-doctor__body { display: flex; flex-direction: column; gap: 1rem; padding: 1.5rem; }
.am-doctor__head { display: flex; align-items: center; gap: 1.25rem; }
.am-doctor__avatar {
  flex-shrink: 0; display: grid; place-items: center; width: 5rem; height: 5rem; overflow: hidden;
  border-radius: 50%; background: var(--primary); color: var(--primary-foreground);
  font-family: var(--serif); font-weight: 600; font-size: 2rem;
}
.am-doctor__avatar img { width: 100%; height: 100%; object-fit: cover; }
.am-doctor h3 { font-family: var(--serif); font-weight: 600; font-size: 1.375rem; line-height: 1.3; }
.am-doctor__alt { margin-top: .25rem; font-size: .875rem; color: var(--muted-foreground); }
.am-doctor__quals-label { padding-top: 1.25rem; border-top: 1px solid var(--border); font-size: .75rem; letter-spacing: .1em; color: var(--accent); }
.am-doctor__quals { display: flex; flex-direction: column; gap: .875rem; margin: 0; padding: 0; list-style: none; }
.am-doctor__quals li { display: flex; flex-direction: column; gap: .125rem; }
.am-doctor__abbr { font-size: .875rem; font-weight: 500; color: var(--primary); }
.am-doctor__full { font-size: .875rem; line-height: 1.6; font-weight: 300; color: var(--muted-foreground); }
@media (min-width: 768px) { .am-doctors { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Testimonials ── */
.am-testimonials .am-eyebrow { color: rgba(194,224,221,.8); }
.am-testimonials .am-h2 { margin-bottom: 4rem; color: #F7F4EE; }
.am-quote-mark { margin-bottom: 2rem; font-size: 3rem; line-height: 1; color: rgba(194,224,221,.3); }
.am-quote { display: none; }
.am-quote.is-active { display: block; }
.am-quote p { min-height: 96px; margin-bottom: 2.5rem; font-size: 1.125rem; line-height: 2; font-weight: 300; color: #E8E2D8; }
.am-quote__name { font-family: var(--serif); font-weight: 500; color: #F7F4EE; }
.am-quote__meta { margin-top: .25rem; font-size: .875rem; color: rgba(194,224,221,.7); }
.am-dots { display: flex; justify-content: center; gap: .75rem; margin-top: 3rem; }
.am-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 4px; background: rgba(194,224,221,.3); cursor: pointer; transition: all .2s; }
.am-dot.is-active { width: 32px; background: #C2E0DD; }
@media (min-width: 768px) { .am-quote p { font-size: 1.25rem; } }

/* ── Contact ── */
.am-contact { display: grid; gap: 4rem; }
.am-contact .am-h2 { margin-bottom: 1.5rem; }
.am-contact .am-lead { margin-bottom: 2.5rem; }
.am-info__row { display: flex; gap: 1rem; }
.am-info__row + .am-info__row { margin-top: 1.5rem; }
.am-info__label { flex-shrink: 0; width: 5rem; margin-top: .125rem; font-size: .75rem; font-weight: 500; color: var(--primary); }
.am-info__value { font-size: .875rem; line-height: 1.625; font-weight: 300; }
.am-info__value a:hover { color: var(--primary); }
.am-clinics { display: grid; gap: 2rem; }
.am-clinic { display: grid; gap: .75rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.am-clinic .am-info__row + .am-info__row { margin-top: 0; }
.am-clinic__name { font-family: var(--serif); font-weight: 600; font-size: 1.125rem; color: var(--primary); }
/* Google map per clinic: below the details on phones, beside them (top to bottom of the text) on wider screens. */
.am-clinic__map { order: 1; overflow: hidden; height: 13rem; border: 1px solid var(--border); border-radius: calc(var(--radius) + 6px); background: var(--muted); }
.am-clinic__map iframe { display: block; width: 100%; height: 100%; border: 0; }
@media (min-width: 640px) {
  .am-clinic:has(> .am-clinic__map) { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); column-gap: 1.5rem; }
  .am-clinic > .am-clinic__map { order: 0; grid-column: 2; grid-row: 1 / span 4; height: auto; min-height: 11rem; }
  .am-clinic:has(> .am-clinic__map) > :not(.am-clinic__map) { grid-column: 1; }
  .am-clinic:has(> .am-clinic__map) .am-info__label { width: 4.5rem; }
}
.am-clinics > .am-info__row { padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* Clinic photo slideshow: every photo fills the same frame (cropped to fit), with rounded corners. */
.am-slides {
  position: relative; overflow: hidden; width: 100%; max-width: 100%; aspect-ratio: 4 / 3; margin-bottom: .5rem;
  border-radius: calc(var(--radius) + 6px); background: var(--muted); touch-action: pan-y;
}
.am-slides__track { position: absolute; inset: 0; }
.am-slides__track img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .35s ease; user-select: none; -webkit-user-drag: none;
}
.am-slides__track img.is-active { opacity: 1; }
.am-slides__dots { position: absolute; left: 0; right: 0; bottom: .5rem; display: flex; justify-content: center; gap: .3rem; }
.am-slides__dot {
  display: grid; place-items: center; width: 1.375rem; height: 1.375rem; padding: 0;
  font-family: var(--sans); font-size: .6875rem; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums;
  color: #fff; background: rgba(0,40,38,.55); border: 1px solid rgba(255,255,255,.6); border-radius: 50%;
  cursor: pointer; transition: background .2s, color .2s;
}
.am-slides__dot:hover { background: rgba(0,40,38,.8); }
.am-slides__dot.is-active { color: var(--primary); background: #fff; border-color: #fff; }
.am-slides__dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Clinic photos: their own section straight after the landing, on the light page background,
   so it reads as a separate band between the sand landing and the teal About. */
.am-gallery { padding-block: 2.5rem; background: var(--background); }
/* Contact on the same deep teal as About, with light text; the booking form stays a cream card on top. */
#contact.am-section { background: linear-gradient(90deg, #003C39 0%, #004C48 50%, #00605A 100%); padding-block: 4rem; }
@media (min-width: 768px) { #contact.am-section { padding-block: 5rem; } }
#doctors.am-section:has(+ #contact) { padding-bottom: 4rem; }
@media (min-width: 768px) { #doctors.am-section:has(+ #contact) { padding-bottom: 5rem; } }
#contact .am-eyebrow { color: #C2E0DD; }
#contact .am-h2 { color: #F7F4EE; }
#contact .am-lead { color: rgba(247,244,238,.82); }
#contact .am-clinic, #contact .am-clinics > .am-info__row { border-top-color: rgba(247,244,238,.2); }
#contact .am-clinic__name { color: #F7F4EE; }
#contact .am-info__label { color: #C2E0DD; }
#contact .am-info__value { color: rgba(247,244,238,.88); }
#contact .am-info__value a { color: #F7F4EE; }
#contact .am-info__value a:hover { color: #F7F4EE; text-decoration: underline; }
#contact .am-clinic__map { border-color: rgba(247,244,238,.25); }
#contact .am-form-card { box-shadow: 0 24px 48px -24px rgba(0,20,18,.5); }
.am-gallery__head { margin-bottom: 1.25rem; }
.am-gallery__head .am-eyebrow { margin-bottom: .75rem; }
@media (min-width: 768px) { .am-gallery__head { margin-bottom: 1.5rem; } }
.am-gallery .am-slides { box-shadow: 0 18px 36px -20px rgba(42,32,24,.35); }
.am-gallery__grid { display: grid; gap: 1.5rem; }
.am-gallery__item { margin: 0; min-width: 0; }
.am-gallery__item .am-slides { margin-bottom: .625rem; }
.am-gallery__item .am-slides__dots { bottom: .75rem; gap: .375rem; }
.am-gallery__name { font-family: var(--serif); font-weight: 600; font-size: 1.125rem; text-align: center; color: var(--primary); }
@media (min-width: 768px) {
  .am-gallery { padding-block: 3rem; }
  /* Photos at 0.7x their full-width size (about 372px each), centred with a generous gap; the label stays on the left edge. */
  .am-gallery__grid { grid-template-columns: repeat(2, minmax(0, 23.25rem)); justify-content: center; column-gap: 4.5rem; }
}

.am-form-card { padding: 2rem; background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 6px); }
.am-form-card h3 { margin-bottom: 2rem; font-family: var(--serif); font-weight: 600; font-size: 1.25rem; }
.am-form { display: flex; flex-direction: column; gap: 1.25rem; position: relative; }
.am-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.am-field label { display: block; margin-bottom: .5rem; font-size: .75rem; color: var(--muted-foreground); }
.am-field input, .am-field select, .am-field textarea {
  width: 100%; padding: .75rem 1rem; font-size: .875rem; font-family: var(--sans); color: var(--foreground);
  background: var(--background); border: 1px solid var(--border); border-radius: var(--radius);
  outline: none; -webkit-appearance: none; appearance: none; transition: border-color .2s, box-shadow .2s;
}
.am-field input:focus, .am-field select:focus, .am-field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,114,108,.12);
}
.am-field select {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237A6E5A' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center;
}
.am-field input[type="date"] { min-height: 2.875rem; }
.am-field textarea { resize: none; }
.am-req { color: var(--accent); }
.am-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.am-notice { margin-bottom: 1.5rem; padding: .875rem 1rem; font-size: .875rem; line-height: 1.6; border-radius: var(--radius); }
.am-notice--success { background: #DDEFED; color: #00554F; border: 1px solid #B3D9D5; }
.am-notice--error { background: #F6E6E0; color: #8A3A22; border: 1px solid #E3C2B6; }

@media (max-width: 479px) { .am-form__row { grid-template-columns: 1fr; } }
@media (min-width: 768px) {
  .am-contact { grid-template-columns: 1fr 1fr; }
  .am-form-card { padding: 2.5rem; }
}

/* ── Footer ── */
.am-footer { padding: 3rem 0; border-top: 1px solid var(--border); }
.am-footer__grid { display: grid; gap: 2.5rem; margin-bottom: 3rem; }
.am-footer__brand { display: flex; align-items: center; gap: .625rem; margin-bottom: .75rem; }
.am-footer__brand img { height: 2rem; width: auto; }
.am-footer__brand span { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; color: var(--primary); }
.am-footer__tagline { max-width: 300px; font-size: .875rem; line-height: 2; font-weight: 300; color: var(--muted-foreground); }
.am-footer__heading { margin-bottom: 1rem; font-size: .75rem; font-weight: 500; letter-spacing: .1em; }
.am-footer ul { margin: 0; padding: 0; list-style: none; }
.am-footer li + li { margin-top: .75rem; }
.am-footer li a { font-size: .875rem; font-weight: 300; color: var(--muted-foreground); transition: opacity .2s; }
.am-footer li a:hover { opacity: .7; }
.am-hours { font-size: .875rem; font-weight: 300; color: var(--muted-foreground); }
.am-hours { display: grid; gap: 1.25rem; line-height: 1.8; }
.am-hours__name { font-weight: 500; color: var(--foreground); }
.am-footer__bottom {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 1rem;
  padding-top: 2rem; border-top: 1px solid var(--border); font-size: .75rem; color: var(--muted-foreground); text-align: center;
}
@media (min-width: 640px) { .am-footer__bottom { flex-direction: row; text-align: left; } }
@media (min-width: 768px) {
  .am-footer__grid { grid-template-columns: repeat(4, 1fr); }
  .am-footer__about { grid-column: span 2; }
}

/* ── Regular pages (index.php / 404.php) ── */
.am-page { padding: 8rem 0 6rem; min-height: 60vh; }
.am-page h1 { margin-bottom: 2rem; font-family: var(--serif); font-weight: 600; font-size: 2rem; line-height: 1.3; }
.am-page .am-lead { margin-bottom: 2rem; }
.am-entry { line-height: 1.9; }
.am-entry p, .am-entry ul, .am-entry ol { margin: 0 0 1.25em; }
.am-entry h2, .am-entry h3 { margin: 2em 0 .75em; font-family: var(--serif); font-weight: 600; }
.am-entry a { color: var(--primary); text-decoration: underline; }

/* WordPress core alignment classes */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  /* Without the sliding animation, show the scroll cue's highlight as a still line. */
  .am-hero .am-scroll-cue i::after { top: 0; height: 100%; }
}

/* 診所環境 label and the three service titles: thin line icons in the same style, coloured by their text. */
.am-gallery__head .am-eyebrow, .am-ccard .am-eyebrow { display: flex; align-items: center; gap: .5rem; }
.am-gallery__head .am-eyebrow::before, .am-ccard .am-eyebrow::before {
  content: ""; flex-shrink: 0; width: 1.25em; height: 1.25em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M4 20V9.5L12 4l8 5.5V20'/><path d='M3 20h18'/><path d='M12 9.5v5M9.5 12h5'/><path d='M10 20v-3h4v3'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M4 20V9.5L12 4l8 5.5V20'/><path d='M3 20h18'/><path d='M12 9.5v5M9.5 12h5'/><path d='M10 20v-3h4v3'/></svg>") center / contain no-repeat;
}
.am-svc__title { display: flex; align-items: center; gap: .5rem; }
.am-svc__title::before {
  content: ""; flex-shrink: 0; width: 1.5rem; height: 1.5rem; background: currentColor;
  -webkit-mask: var(--am-svc-icon) center / contain no-repeat; mask: var(--am-svc-icon) center / contain no-repeat;
}
.am-svc-grid > :nth-child(1) .am-svc__title { --am-svc-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M5.5 8h13A1.5 1.5 0 0 1 20 9.5v9a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 4 18.5v-9A1.5 1.5 0 0 1 5.5 8z'/><path d='M9 8V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2'/><path d='M12 11v5.5M9.25 13.75h5.5'/></svg>"); }
.am-svc-grid > :nth-child(2) .am-svc__title { --am-svc-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M12 21s-6.5-5.7-6.5-10.8a6.5 6.5 0 0 1 13 0C18.5 15.3 12 21 12 21z'/><path d='M12 7.2v5.6M9.2 10h5.6'/></svg>"); }
/* 外展疫苗接種: a shield with a heart (protection and care) rather than a needle. */
.am-svc-grid > :nth-child(3) .am-svc__title { --am-svc-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3l7 2.8v5.4c0 4.6-3 8.1-7 9.8-4-1.7-7-5.2-7-9.8V5.8z'/><path d='M12 15.6c-1.7-1.1-3.1-2.2-3.1-3.6 0-1 .8-1.8 1.8-1.8.6 0 1.1.3 1.3.8.2-.5.7-.8 1.3-.8 1 0 1.8.8 1.8 1.8 0 1.4-1.4 2.5-3.1 3.6z'/></svg>"); }

/* 預約掛號 heading in the booking section: calendar-with-plus icon in the margin, centred on the whole two-line heading. */
#contact .am-h2 { position: relative; padding-left: 1.45em; }
#contact .am-h2::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: .95em; height: .95em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6.5A1.5 1.5 0 0 1 5.5 5h13A1.5 1.5 0 0 1 20 6.5v12a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 4 18.5z'/><path d='M4 10h16M8 3v4M16 3v4'/><path d='M12 12.5v5M9.5 15h5'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6.5A1.5 1.5 0 0 1 5.5 5h13A1.5 1.5 0 0 1 20 6.5v12a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 4 18.5z'/><path d='M4 10h16M8 3v4M16 3v4'/><path d='M12 12.5v5M9.5 15h5'/></svg>") center / contain no-repeat;
}

/* ── Header presence: larger logo and name, firmer menu, underline on hover and on the section in view ── */
.am-brand img { height: 2.25rem; }
.am-brand__name { font-size: 1.1875rem; }
.am-brand__sub { font-size: .6875rem; }
.am-nav a { position: relative; padding-block: .375rem; font-weight: 500; letter-spacing: .06em; }
.am-nav a:hover { opacity: 1; }
.am-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: currentColor;
  transform: scaleX(0); transform-origin: left center; transition: transform .3s ease;
}
.am-nav a:hover::after, .am-nav a.is-current::after { transform: scaleX(1); }
@media (min-width: 768px) {
  .am-brand img { height: 2.5rem; }
  .am-brand__name { font-size: 1.25rem; }
  .am-brand { gap: .75rem; }
}
@media (min-width: 1024px) {
  .am-nav { gap: 2.25rem; }
  .am-nav a { font-size: .9375rem; }
}

/* ── Icon system: two sizes only, identical line weight ──
   Label tier 20px (使命, 願景, the three points, 診所環境), softened slightly so they read as quiet accents.
   Heading tier 26px (the three service titles, 預約掛號). */
.am-mv__label::before, .am-feature__title::before,
.am-gallery__head .am-eyebrow::before, .am-ccard .am-eyebrow::before { width: 1.25rem; height: 1.25rem; opacity: .8; }
.am-svc__title::before { width: 1.625rem; height: 1.625rem; }
#contact .am-h2 { padding-left: 2.375rem; }
#contact .am-h2::before { width: 1.625rem; height: 1.625rem; }

/* ── English typography: the spacing and weights above suit Chinese; English gets its own ──
   Latin font (DM Sans: friendly, geometric; close to Canva Sans), regular weight instead of light, normal tracking on labels,
   and 1.7 line spacing instead of the airy 2.0 used for Chinese. Chinese text is unaffected. */
html.am-lang-en body { font-family: 'DM Sans', var(--sans); }
html.am-lang-en .am-eyebrow { letter-spacing: .06em; }
html.am-lang-en .am-hero__eyebrow { letter-spacing: .12em; }
html.am-lang-en .am-mv__label { letter-spacing: .06em; }
html.am-lang-en .am-hero__body, html.am-lang-en .am-lead, html.am-lang-en .am-feature__desc,
html.am-lang-en .am-svc p, html.am-lang-en .am-svc__list li, html.am-lang-en .am-doctor__full,
html.am-lang-en .am-info__value, html.am-lang-en .am-footer__tagline, html.am-lang-en .am-footer li a,
html.am-lang-en .am-hours, html.am-lang-en .am-quote p, html.am-lang-en .am-card p { font-weight: 400; }
html.am-lang-en .am-lead, html.am-lang-en .am-hero__body, html.am-lang-en .am-svc p,
html.am-lang-en .am-footer__tagline, html.am-lang-en .am-quote p, html.am-lang-en .am-card p { line-height: 1.7; }
html.am-lang-en .am-svc__list li { line-height: 1.6; }
html.am-lang-en .am-svc__title { font-size: 1.25rem; line-height: 1.35; }
/* English clinic details: label above its value, so long English labels and opening hours get the full width
   instead of wrapping mid-range ("15:00–" / "19:00"). */
html.am-lang-en .am-clinic .am-info__row, html.am-lang-en .am-ccard__info .am-info__row { flex-direction: column; gap: .125rem; }
html.am-lang-en .am-clinic .am-info__label, html.am-lang-en .am-ccard__info .am-info__label { width: auto; margin-top: 0; }
html.am-lang-en .am-clinic { row-gap: .875rem; }
/* English: buttons and form fields set their own font, so give them the English font too,
   and use normal letter-spacing on the menu (the extra tracking suits Chinese only). */
html.am-lang-en .am-btn, html.am-lang-en button, html.am-lang-en input,
html.am-lang-en select, html.am-lang-en textarea, html.am-lang-en .am-slides__dot { font-family: 'DM Sans', var(--sans); }
html.am-lang-en .am-nav a { letter-spacing: .01em; }
html.am-lang-en .am-lang-toggle { letter-spacing: .02em; }

/* ── Services as full-width rows (title left, content right) and the Family Clinic list as a two-column table ── */
.am-svc__term { display: block; font-weight: 500; color: var(--foreground); }
.am-svc__desc { display: block; }
.am-svc__list { gap: 0; border-top: 1px solid var(--border); }
.am-svc__list li { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.am-svc__list li::before { content: none; }
@media (min-width: 640px) {
  .am-svc__list li > .am-l { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); column-gap: 1.5rem; align-items: baseline; }
}
/* Large screens: Family Clinic as a full-width row (title left, table right); the two outreach boxes side by side below it. */
@media (min-width: 1024px) {
  .am-svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .am-svc-grid > .am-svc:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: 15rem minmax(0, 1fr); column-gap: 3rem; row-gap: 0; align-items: start; padding: 2.5rem 3rem; }
  .am-svc-grid > .am-svc:first-child > .am-svc__title { grid-column: 1; grid-row: 1 / span 6; }
  .am-svc-grid > .am-svc:first-child > :not(.am-svc__title) { grid-column: 2; }
  .am-svc-grid > .am-svc:first-child > p + .am-svc__list { margin-top: 1.25rem; }
  .am-svc-grid > .am-svc:not(:first-child) { padding: 2.5rem 3rem; }
}

/* Vital Booking form card: tighter padding, since the embedded form has its own inner spacing. */
.am-form-card--vital { padding: 1.75rem .5rem .5rem; }
.am-form-card--vital h3 { margin: 0 .625rem 1rem; }
/* English mode: the embedded form is Chinese only, so show a button to Vital's English page instead. */
.am-vital-en { display: none; margin: 0 .625rem .625rem; }
.am-vital-en p { margin: 0 0 1.5rem; font-size: .9375rem; line-height: 1.7; color: var(--foreground); }
html.am-lang-en .am-vital-en { display: block; }
html.am-lang-en .am-form-card--vital:has(.am-vital-en) { align-self: start; }
html.am-lang-en .am-vital--zh-only { display: none; }
.am-vital { min-height: 720px; border-radius: var(--radius); overflow: hidden; background: #fff; }
.am-vital iframe { display: block; max-width: 100%; }
.am-vital__fail { display: none; margin: 0; padding: 1.5rem .625rem; font-size: .9375rem; line-height: 1.6; }
.am-vital.is-failed { min-height: 0; }
.am-vital.is-failed .am-vital__fail, .am-vital__fail--show { display: block; }
@media (min-width: 768px) {
  .am-form-card--vital { padding: 2rem 1.5rem 1.5rem; }
}

/* ── 診所環境 card: straddles About and Services on the right, using their empty space ── */
.am-ccard-anchor { position: relative; background: var(--background); padding: 0 0 2.5rem; overflow-x: clip; }
/* The slide-in start position must not widen the page (no sideways scrolling on phones). */
.am-ccard {
  padding: 1.25rem; background: var(--card); border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 8px); box-shadow: 0 24px 48px -28px rgba(42,32,24,.4);
}
.am-ccard .am-eyebrow { font-size: 1rem; }
.am-ccard__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.am-ccard figure { margin: 0; min-width: 0; }
.am-ccard .am-slides { margin-bottom: .5rem; }
.am-ccard .am-slides__dots { bottom: .375rem; gap: .25rem; }
.am-ccard .am-slides__dot { width: 1.25rem; height: 1.25rem; font-size: .625rem; }
.am-ccard figcaption { font-family: var(--serif); font-weight: 600; font-size: .9375rem; text-align: center; color: var(--primary); }

@media (min-width: 768px) {
  /* Zero-height anchor on the About/Services boundary; the card is centred on that line, right column. */
  .am-ccard-anchor { height: 0; padding: 0; background: none; z-index: 5; }
  .am-ccard-anchor > .am-container { position: relative; height: 0; }
  .am-ccard {
    position: absolute; right: 1.5rem; top: 0; width: calc((100% - 3rem - 4rem) / 2);
    transform: translate(0, -50%);
  }
}

/* Slide-in from the right, once, when it scrolls into view (JS adds .is-in). */
.am-ccard.am-ccard--anim { opacity: 0; transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.am-ccard.am-ccard--anim { transform: translate(48px, 0); }
.am-ccard.am-ccard--anim.is-in { opacity: 1; transform: translate(0, 0); }
@media (min-width: 768px) {
  .am-ccard.am-ccard--anim { transform: translate(48px, -50%); }
  .am-ccard.am-ccard--anim.is-in { transform: translate(0, -50%); }
}
@media (prefers-reduced-motion: reduce) {
  .am-ccard.am-ccard--anim { opacity: 1; transform: none; }
  @media (min-width: 768px) { .am-ccard.am-ccard--anim { transform: translate(0, -50%); } }
}

/* ── Minimise / expand ── */
.am-ccard, .am-ccard.am-ccard--anim { transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1), width .5s cubic-bezier(.2,.7,.2,1), right .5s cubic-bezier(.2,.7,.2,1), padding .45s ease, box-shadow .5s ease; }
.am-ccard__head { display: flex; align-items: center; gap: .5rem; }
.am-ccard__head .am-eyebrow { margin-right: auto; }
.am-ccard__head .am-eyebrow { margin-bottom: 0; }
.am-ccard__toggle {
  display: grid; place-items: center; flex-shrink: 0; width: 2rem; height: 2rem; padding: 0;
  color: var(--primary); background: transparent; border: 1px solid var(--primary); border-radius: 50%;
  cursor: pointer; transition: background .2s, color .2s;
}
.am-ccard__toggle:hover { background: var(--primary); color: #F7F4EE; }
.am-ccard__toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.am-ccard__toggle svg { width: .875rem; height: .875rem; }
.am-ccard__toggle .am-ccard__plus-v { transition: transform .3s ease; transform-origin: center; }
.am-ccard:not(.is-collapsed) .am-ccard__plus-v { transform: scaleY(0); }
/* Body folds smoothly (0fr ↔ 1fr). */
.am-ccard__body { display: grid; grid-template-rows: 1fr; margin-top: .875rem; transition: grid-template-rows .45s cubic-bezier(.2,.7,.2,1), margin-top .45s ease, opacity .3s ease; }
.am-ccard__body > div { min-height: 0; overflow: hidden; }
.am-ccard.is-collapsed .am-ccard__body { grid-template-rows: 0fr; margin-top: 0; opacity: 0; }
.am-ccard.is-collapsed { width: 13rem; padding: .75rem 1rem; margin-left: auto; }
@media (min-width: 768px) {
  .am-ccard.is-collapsed { width: 13rem; }
}
@media (prefers-reduced-motion: reduce) { .am-ccard, .am-ccard__body { transition: none !important; } }
/* ── Enlarge (about 3x, up to the screen width), centred on the page and allowed to cover nearby sections ── */
.am-ccard__enlarge { display: none; }
.am-ccard__enlarge .am-ccard__shrink-i { display: none; }
.am-ccard.is-large .am-ccard__enlarge .am-ccard__grow-i { display: none; }
.am-ccard.is-large .am-ccard__enlarge .am-ccard__shrink-i { display: inline; }
@media (min-width: 768px) {
  .am-ccard__enlarge { display: grid; }
  .am-ccard.is-large {
    --am-ccard-w: min(97.5rem, 100vw - 3rem);
    width: var(--am-ccard-w); right: calc(50% - var(--am-ccard-w) / 2);
    z-index: 20; padding: 1.75rem; box-shadow: 0 40px 80px -30px rgba(42,32,24,.55);
  }
  .am-ccard.is-large .am-eyebrow { font-size: 1.125rem; }
  .am-ccard.is-large .am-ccard__grid { gap: 1.5rem; }
  /* Wider photo shape when enlarged, so photos plus clinic details fit on screen under the top bar. */
  .am-ccard.is-large .am-slides { aspect-ratio: 16 / 10; }
  .am-ccard.is-large figcaption { font-size: 1.125rem; }
  .am-ccard.is-large .am-slides__dots { bottom: .75rem; gap: .375rem; }
  .am-ccard.is-large .am-slides__dot { width: 1.625rem; height: 1.625rem; font-size: .75rem; }
}
.am-ccard-anchor:has(.is-large) { z-index: 45; }
/* ── Teal card (same deep teal as Contact) with white text and buttons for contrast ── */
.am-ccard { background: linear-gradient(90deg, #003C39 0%, #004C48 50%, #00605A 100%); border-color: #004C48; box-shadow: 0 24px 48px -26px rgba(0,30,28,.55); }
.am-ccard .am-eyebrow { color: #FFFFFF; }
.am-ccard figcaption { color: #FFFFFF; }
.am-ccard .am-ccard__toggle { color: #FFFFFF; border-color: rgba(255,255,255,.85); }
.am-ccard .am-ccard__toggle:hover { background: #FFFFFF; color: #004C48; }
.am-ccard .am-ccard__toggle:focus-visible { outline-color: #FFFFFF; }
/* ── While enlarged: the rest of the page softly blurs and dims behind the card (click it to close) ── */
.am-ccard-backdrop {
  position: fixed; inset: 0; z-index: 40; cursor: zoom-out;
  background: rgba(42,32,24,.16); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility .45s ease;
}
.am-ccard-backdrop.is-on { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .am-ccard-backdrop { transition: none; } }
/* ── Clinic details: only when enlarged, under each clinic's photos ── */
.am-ccard__info { display: none; }
@media (min-width: 768px) {
  .am-ccard.is-large .am-ccard__info { display: grid; gap: .5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.25); animation: am-ccard-info .5s ease .2s both; }
  .am-ccard__info .am-info__row { display: flex; gap: 1rem; margin: 0; }
  .am-ccard__info .am-info__label { width: 5rem; color: #FFFFFF; }
  .am-ccard__info .am-info__value { color: #FFFFFF; }
  .am-ccard__info .am-info__value a { color: #FFFFFF; }
  .am-ccard__map { justify-self: start; margin-top: .25rem; font-size: .875rem; color: #FFFFFF; text-decoration: underline; text-underline-offset: 3px; }
  .am-ccard__map:hover { color: #C2E0DD; }
}
@keyframes am-ccard-info { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Safeguard: if the card would cover the About text or the Services boxes (e.g. longer text added later),
   main.js adds .is-inline and the card sits in the normal flow between the two sections instead. */
@media (min-width: 768px) {
  .am-ccard-anchor.is-inline { height: auto; padding: 0 0 2.5rem; background: var(--background); }
  .am-ccard-anchor.is-inline > .am-container { height: auto; }
  .am-ccard-anchor.is-inline .am-ccard { position: relative; right: auto; margin-left: auto; }
  .am-ccard-anchor.is-inline .am-ccard.am-ccard--anim { transform: translate(48px, 0); }
  .am-ccard-anchor.is-inline .am-ccard.am-ccard--anim.is-in { transform: none; }
  .am-ccard-anchor.is-inline .am-ccard.is-large { margin-left: calc(50% - var(--am-ccard-w) / 2); }
}
@media (min-width: 768px) and (prefers-reduced-motion: reduce) {
  .am-ccard-anchor.is-inline .am-ccard.am-ccard--anim { transform: none; }
}
