/* ============================================================
   M-CARE MEDICAL CLINIC — Design System
   Palette grounded in Saint Lucian landscape: deep palm green,
   warm sand paper, hibiscus coral as the sole "human" accent.
   ============================================================ */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-bold-var.woff2") format("woff2");
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 400 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("../fonts/publicsans-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("../fonts/publicsans-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Palette — light (default) */
  --palm: #1e4d3d;
  --palm-light: #3a7259;
  --palm-pale: #e4ebe4;
  --ink: #17211c;
  --ink-soft: #4c584f;
  --shell: #f1efe5;
  --shell-raised: #fffdf8;
  --hibiscus: #c94a3f;
  --hibiscus-dark: #a53a31;
  --stone: #d8d3c2;
  --focus-ring: #1863dc;

  /* Type */
  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-body: "Public Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --step-caption: 0.8125rem;
  --step-body: 1.0625rem;
  --step-lead: 1.25rem;
  --step-h4: 1.375rem;
  --step-h3: 1.75rem;
  --step-h2: 2.375rem;
  --step-h1: clamp(2.5rem, 5vw + 1rem, 4rem);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6.5rem;

  --radius: 14px;
  --radius-sm: 8px;
  --container: 1180px;
  --shadow: 0 1px 2px rgba(23, 33, 28, 0.06), 0 12px 28px -12px rgba(23, 33, 28, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --palm: #5ba084;
    --palm-light: #7cbb9f;
    --palm-pale: #1c2b23;
    --ink: #eceee6;
    --ink-soft: #aab5ac;
    --shell: #121a15;
    --shell-raised: #1a251e;
    --hibiscus: #e9776b;
    --hibiscus-dark: #f3958b;
    --stone: #2d3a32;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px -12px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  --palm: #5ba084;
  --palm-light: #7cbb9f;
  --palm-pale: #1c2b23;
  --ink: #eceee6;
  --ink-soft: #aab5ac;
  --shell: #121a15;
  --shell-raised: #1a251e;
  --hibiscus: #e9776b;
  --hibiscus-dark: #f3958b;
  --stone: #2d3a32;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px -12px rgba(0, 0, 0, 0.5);
}
:root[data-theme="light"] {
  --palm: #1e4d3d;
  --palm-light: #3a7259;
  --palm-pale: #e4ebe4;
  --ink: #17211c;
  --ink-soft: #4c584f;
  --shell: #f1efe5;
  --shell-raised: #fffdf8;
  --hibiscus: #c94a3f;
  --hibiscus-dark: #a53a31;
  --stone: #d8d3c2;
  --shadow: 0 1px 2px rgba(23, 33, 28, 0.06), 0 12px 28px -12px rgba(23, 33, 28, 0.18);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--shell);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
  color: var(--ink);
}
h1 { font-size: var(--step-h1); letter-spacing: -0.01em; }
h2 { font-size: var(--step-h2); letter-spacing: -0.005em; }
h3 { font-size: var(--step-h3); }
h4 { font-size: var(--step-h4); }

p { margin: 0; }
.lead { font-size: var(--step-lead); color: var(--ink-soft); max-width: 62ch; }

.eyebrow {
  font-size: var(--step-caption);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--palm-light);
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

/* Wider than the content container — used for the header row, which
   needs more breathing room for the nav than a reading-width column. */
.container-wide {
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: var(--space-3);
}

a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.975rem;
  padding: 0.85em 1.5em;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--hibiscus); color: #fff8f5; }
.btn-primary:hover { background: var(--hibiscus-dark); }
.btn-outline { background: transparent; color: #fffdf8; border-color: rgba(255,255,255,0.4); }
.btn-outline:hover { border-color: #fff; background: rgba(255,255,255,0.08); }
.btn-quiet { background: transparent; color: var(--palm); border-color: var(--stone); }
.btn-quiet:hover { border-color: var(--palm); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--shell) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stone);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: 0.85rem;
}
.brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; flex-shrink: 0; max-width: 160px; }
.brand img { height: 52px; width: auto; border-radius: 12px; flex-shrink: 0; }
.brand > span { min-width: 0; overflow: hidden; }
.brand-word, .brand-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-word { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--ink); line-height: 1; }
.brand-sub { font-family: var(--font-body); font-weight: 600; font-size: 0.625rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); margin-top: 2px; }

.main-nav { display: flex; align-items: center; gap: var(--space-3); justify-content: flex-end; min-width: 0; }
.nav-links { display: flex; align-items: center; gap: 1.15rem; list-style: none; margin: 0; padding: 0; flex-wrap: nowrap; }
.nav-links a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding: 0.4rem 0.1rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--palm); border-color: var(--hibiscus); }

.header-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.tel-link { display: flex; align-items: center; gap: 0.4em; font-weight: 700; font-size: 0.875rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.tel-link svg { flex-shrink: 0; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--stone);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { color: var(--ink); }

@media (max-width: 1200px) {
  .main-nav { position: fixed; z-index: 60; top: 82px; left: 0; right: 0; height: calc(100vh - 82px); height: calc(100dvh - 82px); background: var(--shell); flex-direction: column; align-items: stretch; justify-content: flex-start; padding: var(--space-3); gap: var(--space-3); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s; overflow-y: auto; }
  .main-nav.is-open { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; border-top: 1px solid var(--stone); }
  .nav-links a { display: block; padding: 0.9rem 0.2rem; border-bottom: 1px solid var(--stone); }
  .header-actions { flex-direction: column; align-items: stretch; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: #1e4d3d;
  color: #fffdf8;
  overflow: hidden;
}
.hero-frond {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-5);
  align-items: center;
  padding-block: var(--space-6) var(--space-5);
}
.hero h1 { color: #fffdf8; }
.hero .eyebrow { color: #cfe3d7; }
.hero .lead { color: #dbe9e0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.hero-copy > * + * { margin-top: var(--space-3); }

.hero-card {
  background: #fffdf8;
  color: #17211c;
  border-radius: var(--radius);
  padding: var(--space-3);
  box-shadow: var(--shadow);
  display: grid;
  gap: var(--space-2);
}
.hero-card-row { display: flex; align-items: flex-start; gap: 0.85rem; }
.hero-card-row svg { flex-shrink: 0; color: #1e4d3d; margin-top: 3px; }
.hero-card-row h4 { color: #17211c; font-size: 1rem; margin-bottom: 0.15rem; }
.hero-card-row p { color: #4c584f; font-size: 0.9rem; }

/* Same layout as hero-card-row, but for use on adaptive (theme-following)
   card backgrounds like --palm-pale, rather than the always-white hero card. */
.info-row { display: flex; align-items: flex-start; gap: 0.85rem; }
.info-row svg { flex-shrink: 0; color: var(--palm); margin-top: 3px; }
.info-row h4 { font-size: 1rem; margin-bottom: 0.15rem; }
.info-row p { color: var(--ink-soft); font-size: 0.9rem; }
.hero-card hr { border: none; border-top: 1px solid #d8d3c2; margin: 0; }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; padding-block: var(--space-5) var(--space-4); }
}

/* ---------- Sections ---------- */
section { padding-block: var(--space-6); }
section.tight { padding-block: var(--space-5); }
.section-head { max-width: 44rem; margin-bottom: var(--space-4); }
.section-head > * + * { margin-top: var(--space-2); }
.alt-bg { background: var(--palm-pale); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: var(--space-3); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.split { grid-template-columns: 1fr 1fr; align-items: center; gap: var(--space-5); }
.split-wide { grid-template-columns: 1.1fr 0.9fr; align-items: start; gap: var(--space-5); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) { .split, .split-wide { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--shell-raised);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: var(--space-3);
}
.service-card { display: grid; gap: 0.85rem; }
.service-card .icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  background: var(--palm-pale);
  color: var(--palm);
  border-radius: 12px;
}
.service-card h3 { font-size: 1.1rem; }
.service-card p { color: var(--ink-soft); font-size: 0.95rem; }

/* Team */
.team-card { text-align: left; overflow: hidden; padding: 0; }
.team-photo { aspect-ratio: 3/4; overflow: hidden; background: var(--palm-pale); }
.team-photo img { width: 100%; height: 100%; object-fit: cover; }
.team-body { padding: var(--space-2) var(--space-3) var(--space-3); }
.team-body h3 { font-size: 1.05rem; }
.team-role { color: var(--palm); font-weight: 700; font-size: 0.85rem; margin-top: 0.2rem; }
.team-cred { color: var(--ink-soft); font-size: 0.85rem; margin-top: 0.35rem; }

/* Steps (genuine sequence — telemed how-it-works) */
.steps { counter-reset: step; display: grid; gap: var(--space-3); }
.step { display: flex; gap: var(--space-3); align-items: flex-start; }
.step-num {
  counter-increment: step;
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--palm);
  color: var(--shell-raised);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
}
.step-num::before { content: counter(step); }

/* Testimonial */
.quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: var(--step-h3);
  line-height: 1.35;
  max-width: 46rem;
  text-wrap: balance;
}
.quote-attr { margin-top: var(--space-2); font-family: var(--font-body); font-style: normal; font-weight: 700; color: var(--ink-soft); font-size: 0.95rem; }

/* Hours table */
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table td { padding: 0.55rem 0; border-bottom: 1px solid var(--stone); font-variant-numeric: tabular-nums; }
.hours-table td:first-child { color: var(--ink-soft); font-weight: 600; }
.hours-table td:last-child { text-align: right; font-weight: 700; }
.hours-table tr:last-child td { border-bottom: none; }

/* FAQ accordion */
.faq-group + .faq-group { margin-top: var(--space-5); }
.faq-item { border-bottom: 1px solid var(--stone); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: var(--space-2) 0.1rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  font-size: 1.02rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .chev { transition: transform 0.2s ease; flex-shrink: 0; color: var(--palm); }
.faq-item[open] summary .chev { transform: rotate(45deg); }
.faq-item .a { padding: 0 0.1rem var(--space-3); color: var(--ink-soft); max-width: 62ch; }

/* Blog */
.post-card { overflow: hidden; padding: 0; }
.post-thumb { aspect-ratio: 16/10; background: var(--palm-pale); overflow: hidden; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-thumb-icon { aspect-ratio: 16/10; background: #1e4d3d; display: grid; place-items: center; }
.post-thumb-icon svg { color: #fffdf8; opacity: 0.85; }
.post-body { padding: var(--space-3); }
.post-cat { color: var(--hibiscus); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }
.post-body h3 { font-size: 1.1rem; margin-top: 0.5rem; }
.post-body a.read { display: inline-block; margin-top: 0.75rem; font-weight: 700; font-size: 0.9rem; color: var(--palm); text-decoration: none; border-bottom: 1px solid var(--palm); }

/* CTA band */
.cta-band {
  background: #1e4d3d;
  color: #fffdf8;
  border-radius: var(--radius);
  padding: var(--space-5) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.cta-band h2 { color: #fffdf8; font-size: var(--step-h2); }

/* Page header (interior pages) */
.page-hero { background: var(--palm-pale); padding-block: var(--space-5); overflow: visible; }
.page-hero .eyebrow { color: var(--palm); }

/* Membership card presentation */
.card-mockup { display: flex; align-items: center; justify-content: center; }
.card-mockup img {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(23,33,28,0.12), 0 24px 48px -18px rgba(23,33,28,0.35);
  transform: rotate(-3deg);
  transition: transform 0.3s ease;
}
.card-mockup:hover img { transform: rotate(-1deg) scale(1.02); }
@media (max-width: 820px) {
  .card-mockup { margin-top: var(--space-3); }
  .card-mockup img { max-width: 340px; }
}

/* Storefront photo */
.photo-frame img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Footer ---------- */
/* Always a dark closing band, regardless of site theme — colors below are
   intentionally fixed rather than tokenized so they never flip with theme. */
.site-footer { background: #17211c; color: #f1efe5; padding-block: var(--space-5) var(--space-4); margin-top: var(--space-6); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: var(--space-4); }
.footer-brand .brand-word { color: #f1efe5; }
.footer-brand p { color: #969f98; margin-top: var(--space-2); max-width: 32ch; }
.footer-col h4 { color: #f1efe5; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-body); font-weight: 700; margin-bottom: var(--space-2); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.footer-col a { color: #a9b1ab; text-decoration: none; font-size: 0.92rem; }
.footer-col a:hover { color: #fff; }
.footer-social { display: flex; gap: 0.75rem; margin-top: var(--space-2); }
.footer-social a { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #3a463e; border-radius: 50%; color: #a9b1ab; }
.footer-social a:hover { border-color: var(--hibiscus); color: #fff; }
.footer-bottom { margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px solid #2b3730; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; color: #7e8882; font-size: 0.85rem; }

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .cta-band { flex-direction: column; align-items: flex-start; }
}

/* Contact form */
.contact-form { display: grid; gap: var(--space-3); }
.form-row { display: grid; gap: 0.4rem; }
.form-row label { font-weight: 600; font-size: var(--step-caption); color: var(--ink-soft); }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--shell-raised);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}
.contact-form .btn { justify-self: start; }
.form-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-notice { padding: 0.9rem 1.1rem; border-radius: var(--radius); margin-bottom: var(--space-3); }
.form-notice-success { background: var(--palm-pale); color: var(--palm); }
.form-notice-error { background: #fbe6e3; color: var(--hibiscus-dark); }

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0; background: #1e4d3d; color: #fff;
  padding: 0.75rem 1.25rem; z-index: 100; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
