/* Health Station website styles.
   Colors, fonts and shapes follow the app's design tokens
   (docs/design/DESIGN.md in the health-station app repo). */

@font-face {
  font-family: "Marmelad";
  src: url("/assets/fonts/marmelad-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --background: #f4f3e8;
  --surface: #ffffff;
  --text-primary: #1f2b20;
  --text-secondary: #5b685c;
  --brand: #24582a;
  --brand-soft: #d4e9cf;
  --action-fill: #24582a;
  --action-label: #ddf832;
  --tag-fill: #eceadc;
  --border: #e3e1d2;
  --photo-background: #ffffff;

  --font-display: "Marmelad", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "PingFang TC", "Noto Sans TC", sans-serif;

  --radius-tag: 6px;
  --radius-control: 14px;
  --radius-card: 18px;
  --radius-hero: 20px;
  --radius-pill: 999px;
  --gutter: 16px;
  --page-width: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0f1510;
    --surface: #172018;
    --text-primary: #f1f3ea;
    --text-secondary: #a8b3a4;
    --brand: #a9d3a4;
    --brand-soft: #223526;
    --tag-fill: #222b23;
    --border: #26332a;
  }
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--brand);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  color: var(--brand);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2rem, 1.6rem + 2vw, 2.75rem);
}

h2 {
  font-size: clamp(1.5rem, 1.35rem + 0.75vw, 1.875rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1em;
}

.wrap {
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -200px;
  left: var(--gutter);
  z-index: 10;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  background: var(--action-fill);
  color: var(--action-label);
  font-family: var(--font-display);
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 24px;
  border: 2px solid var(--action-fill);
  border-radius: var(--radius-pill);
  background: var(--action-fill);
  color: var(--action-label);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.15);
}

.button-quiet {
  border-color: currentColor;
  background: transparent;
  color: var(--brand);
}

.button-quiet:hover {
  filter: none;
  background: var(--brand-soft);
}

.button-small {
  min-height: 44px;
  padding: 6px 18px;
  font-size: 1rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-block: 10px;
}

.wordmark {
  padding-block: 6px;
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1.15;
  text-decoration: none;
}

.site-nav {
  flex-basis: 100%;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 -12px;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--brand-soft);
}

.site-nav a[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

@media (min-width: 900px) {
  .site-nav {
    flex-basis: auto;
    order: 1;
    margin-left: auto;
  }

  .site-nav ul {
    margin: 0;
  }

  .header-order {
    order: 2;
  }
}

/* ---------- Page sections ---------- */

main {
  display: block;
  padding-bottom: 16px;
}

.section {
  padding-block: 28px;
}

.page-intro {
  padding-top: 28px;
}

.lead {
  max-width: 62ch;
  font-size: 1.0625rem;
}

.note {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.panel {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.panel > :last-child {
  margin-bottom: 0;
}

.panel + .panel {
  margin-top: 16px;
}

.photo {
  width: 100%;
  border-radius: var(--radius-hero);
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (min-width: 760px) {
  .panel {
    padding: 20px;
  }

  .two-col {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 32px;
  }

  .two-col .photo {
    aspect-ratio: 1;
    object-fit: cover;
  }
}

/* ---------- Home ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding-block: 20px 8px;
}

.hero-photo {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-hero);
}

.hero-text {
  display: grid;
  gap: 14px;
  align-content: center;
  justify-items: center;
  padding: 28px 16px;
  border-radius: var(--radius-hero);
  background: var(--brand-soft);
  text-align: center;
}

.hero-text h1 {
  margin: 0;
  font-size: clamp(2.25rem, 1.75rem + 3vw, 4rem);
  line-height: 1.1;
}

.hero-tagline {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1.375rem;
}

.hero-text .button-row {
  justify-content: center;
}

@media (min-width: 760px) {
  .hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: stretch;
  }

  .hero-photo {
    height: 100%;
    min-height: 360px;
    aspect-ratio: auto;
  }
}

/* ---------- Cards (herbal medicine on Home) ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.5rem), 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 700px) {
  .card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

.card:hover {
  border-color: var(--brand);
}

.card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--photo-background);
}

.card-body {
  padding: 12px 14px 16px;
}

.card-title {
  display: block;
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.3;
}

.card-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ---------- Menu ---------- */

.menu-banner {
  width: 100%;
  margin-top: 20px;
  border-radius: var(--radius-hero);
}

.drink-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 700px) {
  .drink-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.drink-wide {
  grid-column: 1 / -1;
}

.drink {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.drink-name {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.35;
}

.drink-label {
  min-width: 0;
}

.drink p {
  margin: 8px 0 0;
  color: var(--text-secondary);
}

.drink ol {
  margin: 8px 0 0;
  padding-left: 1.5em;
}

.number-tag {
  flex: none;
  padding: 2px 7px;
  border-radius: var(--radius-tag);
  background: var(--tag-fill);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
}

/* ---------- Herbal medicine ---------- */

.formula {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  scroll-margin-top: 16px;
}

.formula + .formula {
  margin-top: 16px;
}

.formula img {
  width: 100%;
  max-width: 180px;
  border-radius: var(--radius-control);
  background: var(--photo-background);
}

.formula h2 {
  margin-bottom: 4px;
  font-size: 1.375rem;
}

.formula-zh-name {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

.formula-text > :last-child {
  margin-bottom: 0;
}

@media (min-width: 700px) {
  .formula {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
    padding: 20px;
  }

  .formula img {
    max-width: none;
  }
}

/* ---------- Hours and contact ---------- */

.hours {
  width: 100%;
  max-width: 28rem;
  border-collapse: collapse;
}

.hours th,
.hours td {
  padding: 8px 0;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.hours th {
  padding-right: 16px;
  font-weight: 600;
}

.hours + .note {
  margin-top: 12px;
}

.contact-list {
  margin: 0 0 1em;
  padding: 0;
  list-style: none;
}

.contact-list a {
  display: inline-block;
  padding-block: 10px;
}

/* ---------- Long-form text (privacy, support) ---------- */

.prose {
  max-width: 68ch;
}

.prose h2 {
  margin-top: 1.5em;
}

.prose > h2:first-child {
  margin-top: 0;
}

.prose ul {
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: 0.5em;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 24px;
  padding-block: 28px 36px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.footer-name {
  margin-bottom: 8px;
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

@media (min-width: 760px) {
  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
