/* ============================================================
   Chiro Value Pipeline — premium themeable template
   Per-client theming: only the :root block is rewritten by
   build_chiro_site.py (colors). Structure + components stay put.
   ============================================================ */
:root {
  --brand: #7c34ab;
  --brand-deep: #54206f;
  --accent: #cf9b3f;
  --ink: #1c2733;
  --muted: #5d6b78;
  --bg: #ffffff;
  --bg-alt: #f4f7f9;
  --line: #e4ebf0;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 14px;
  --maxw: 1140px;
  --shadow: 0 18px 50px -22px rgba(20, 40, 60, .35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--ink); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--brand-deep); text-decoration: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.container--narrow { max-width: 760px; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; color: var(--ink); font-weight: 600; }
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--brand); margin-bottom: 10px; }
.section__title { font-size: clamp(1.7rem, 3.4vw, 2.6rem); margin-bottom: 34px; }
.lead { font-size: 1.12rem; margin-bottom: 14px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Buttons */
.btn { display: inline-block; background: var(--brand); color: #fff; padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: .98rem; border: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; box-shadow: 0 10px 24px -12px var(--brand); }
.btn:hover { transform: translateY(-2px); background: var(--brand-deep); }
.btn--lg { padding: 16px 32px; font-size: 1.05rem; }
.btn--sm { padding: 9px 18px; font-size: .9rem; }
.btn--ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.7); box-shadow: none; }
.btn--ghost:hover { background: rgba(255,255,255,.14); }
.btn--accent { background: var(--accent); box-shadow: 0 10px 24px -12px var(--accent); }
.btn--accent:hover { background: color-mix(in srgb, var(--accent) 84%, #000); }
.btn--outline { background: transparent; color: var(--brand-deep); border: 1.5px solid var(--brand); box-shadow: none; }
.btn--outline:hover { background: var(--brand); color: #fff; }

/* Topbar */
.topbar { background: var(--brand-deep); color: #fff; font-size: .86rem; }
.topbar__inner { display: flex; justify-content: space-between; align-items: center; padding: 7px 22px; }
.topbar__phone { color: #fff; font-weight: 600; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid transparent; transition: box-shadow .2s ease, border-color .2s ease; }
.nav.is-stuck { box-shadow: 0 6px 24px -16px rgba(0,0,0,.4); border-color: var(--line); }
.nav__inner { display: flex; align-items: center; gap: 14px; padding: 12px 22px; }
.nav__brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
/* Language toggle (flag + target language name; links to the sibling-language page) */
.lang-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; font-weight: 600; color: var(--ink); background: #fff; white-space: nowrap; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.lang-toggle:hover { border-color: var(--brand); color: var(--brand); background: var(--bg-alt); }
.lang-toggle__flag { border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); display: block; }
.nav__logo { height: 42px; width: auto; }
.nav__name { font-family: var(--font-display); font-weight: 700; font-size: 1.18rem; color: var(--ink); }
.nav__brand--has-logo .nav__name { display: none; } /* wordmark logos already include the name */
.nav__brand--has-logo .nav__logo { height: 50px; max-width: 300px; width: auto; object-fit: contain; }
@media (max-width: 860px) { .nav__brand--has-logo .nav__logo { height: 40px; max-width: 200px; } }
.nav__links { display: flex; align-items: center; gap: 24px; }
.nav__links a { color: var(--ink); font-weight: 500; font-size: .96rem; }
.nav__links a:hover { color: var(--brand); }
/* Keep the "Book Online" pill button text white (overrides the dark nav-link color) */
.nav__links a.btn, .nav__links a.btn:hover { color: #fff; }
.nav__toggle { display: none; font-size: 1.5rem; background: none; border: none; cursor: pointer; color: var(--ink); }

/* Hero — split: copy panel on a brand gradient + a framed real photo.
   (Replaces the old full-bleed background hero, which fought the photo and cropped faces.) */
.hero { position: relative; color: #fff; overflow: hidden;
  background: linear-gradient(135deg, var(--brand-deep), color-mix(in srgb, var(--brand-deep) 72%, #000));
  padding: clamp(54px, 8vw, 94px) 0; }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero__grid:has(.hero__copy:only-child) { grid-template-columns: 1fr; max-width: 760px; }
.hero__copy { max-width: 600px; }
.hero__eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .8rem; font-weight: 700; color: #ffd56b; margin-bottom: 14px; }
.hero__title { font-size: clamp(2.05rem, 4.4vw, 3.4rem); color: #fff; margin-bottom: 16px; }
.hero__sub { font-size: clamp(1.04rem, 1.7vw, 1.24rem); opacity: .94; margin-bottom: 22px; }
.hero__rating { display: inline-flex; align-items: center; gap: 9px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); padding: 9px 16px; border-radius: 999px; font-size: .95rem; margin-bottom: 24px; }
.hero__rating .hero__stars { color: #ffd56b; letter-spacing: 1px; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__trust { margin-top: 18px; font-size: .92rem; opacity: .82; }
.hero__media { margin: 0; }
.hero__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center; border-radius: 18px; box-shadow: 0 30px 70px -30px rgba(0,0,0,.6); }

/* Proof band — big-number social proof (the Williamsburg / SF Custom pattern) */
.proof { background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.proof__inner { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px 48px; padding: 26px 22px; text-align: center; }
.proof__stat { display: flex; flex-direction: column; gap: 3px; min-width: 108px; }
.proof__num { font-family: var(--font-display); font-size: clamp(1.55rem, 3vw, 2.15rem); font-weight: 700; color: var(--brand-deep); line-height: 1; }
.proof__label { font-size: .85rem; color: var(--muted); font-weight: 500; }

/* Trust bar (legacy component, kept for reuse) */
.trustbar { background: var(--brand-deep); color: #fff; }
.trustbar__inner { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: center; align-items: center; padding: 13px 22px; font-size: .92rem; }
.trustbar__item { opacity: .95; }
.trustbar__item strong { color: #ffd56b; }

/* Sections */
.section { padding: clamp(54px, 8vw, 92px) 0; }
.section--alt { background: var(--bg-alt); }

/* Grid + service cards */
.grid { display: grid; gap: 24px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; transition: transform .18s ease, box-shadow .18s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card__icon { width: 52px; height: 52px; border-radius: 12px; background: color-mix(in srgb, var(--brand) 12%, #fff); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.card__icon svg { width: 28px; height: 28px; stroke: var(--brand); fill: none; stroke-width: 1.7; }
.card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .98rem; }
/* Photo service cards (the top-site pattern) */
.card--photo { padding: 0; overflow: hidden; }
.card--photo:hover .card__img { transform: scale(1.04); }
.card__img { width: 100%; height: 200px; object-fit: cover; display: block; transition: transform .35s ease; }
.card__body { padding: 22px 24px 26px; }

/* Reviews */
.reviews__rating { font-size: 1.05rem; margin: -18px 0 26px; color: var(--ink); }
.reviews__rating .stars { color: #f5a623; letter-spacing: 2px; }
.reviews__rating strong { font-weight: 700; }
.review { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.review__stars { color: #f5a623; letter-spacing: 2px; margin-bottom: 10px; }
.review__text { font-size: 1rem; margin-bottom: 14px; }
.review__name { font-weight: 600; font-size: .92rem; }
.reviews__more { margin-top: 28px; text-align: center; }

/* Reviews carousel — scrolls through the live 5-star Google reviews */
.reviews-carousel { position: relative; }
.reviews-track { display: flex; gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 4px 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.reviews-track::-webkit-scrollbar { display: none; }
.reviews-track .review { flex: 0 0 clamp(258px, 31%, 380px); scroll-snap-align: start; }
.reviews-track .review__text { display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
/* 1–2 reviews: center instead of left-stranding */
.reviews-track:has(.review:nth-child(2):last-child),
.reviews-track:has(.review:only-child) { justify-content: center; }
.carousel__arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--brand-deep); font-size: 1.7rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; transition: background .15s ease, color .15s ease; }
.carousel__arrow:hover { background: var(--brand); color: #fff; }
.carousel__arrow--prev { left: -12px; }
.carousel__arrow--next { right: -12px; }
.carousel__arrow[hidden] { display: none; }

/* First-visit steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 26px; }
.step__num { width: 42px; height: 42px; border-radius: 999px; background: var(--brand); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.step h3 { font-size: 1.16rem; margin-bottom: 7px; }
.step p { color: var(--muted); font-size: .97rem; }

/* Split (doctor) */
.split__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split__media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }

/* Callout */
.callout { background: var(--accent); color: #fff; padding: clamp(48px, 7vw, 80px) 0; text-align: center; }
.callout h2 { color: #fff; font-size: clamp(1.6rem, 3.2vw, 2.4rem); margin-bottom: 12px; }
.callout p { opacity: .95; margin-bottom: 26px; font-size: 1.1rem; }
.callout__cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Visit */
.visit__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; margin-bottom: 28px; }
.visit__photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.hours { width: 100%; border-collapse: collapse; margin: 12px 0; }
.hours td { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .98rem; }
.hours td:last-child { text-align: right; color: var(--muted); }
/* Map = a real map photo, the whole thing links to Google directions (no empty iframe / white button) */
.map-photo { position: relative; display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.map-photo img { width: 100%; height: 340px; object-fit: cover; display: block; transition: transform .35s ease; }
.map-photo:hover img { transform: scale(1.03); }
.map-photo__btn { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--brand); color: #fff; padding: 13px 26px; border-radius: 999px; font-weight: 700; box-shadow: 0 12px 30px -12px rgba(0,0,0,.5); white-space: nowrap; }
.map-photo:hover .map-photo__btn { background: var(--brand-deep); }
/* Graceful fallback if the map image is missing — a styled card, never a blank white block */
.map-photo--noimg { min-height: 220px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bg-alt), color-mix(in srgb, var(--brand) 12%, #fff)); }
.map-photo--noimg .map-photo__btn { position: static; transform: none; }

/* Lead form */
.lead-form { display: flex; flex-direction: column; gap: 14px; }
.lead-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lead-form input, .lead-form textarea { width: 100%; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; font-family: var(--font-body); font-size: 1rem; }
.lead-form input:focus, .lead-form textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.lead-form .btn { align-self: flex-start; }

/* FAQ */
.faq__item { border-bottom: 1px solid var(--line); }
.faq__q { width: 100%; text-align: left; background: none; border: none; padding: 18px 0; font-size: 1.06rem; font-weight: 600; font-family: var(--font-body); cursor: pointer; display: flex; justify-content: space-between; gap: 14px; color: var(--ink); }
.faq__a { max-height: 0; overflow: hidden; transition: max-height .3s ease; color: var(--muted); }
.faq__a p { padding-bottom: 18px; }
.faq__item.is-open .faq__a { max-height: 320px; }
.faq__item.is-open .faq__q { color: var(--brand); }

/* Footer */
.footer { background: var(--ink); color: #cdd7e0; padding: 54px 0 26px; }
.footer__inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; align-items: center; }
.footer h3 { color: #fff; margin-bottom: 8px; }
.footer a { color: #eaf0f5; }
.footer__legal { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; color: #8da0b0; }

/* MedMasters demo band (demo only; stripped from handoff) */
.mm-band { background: #0e1b2a; color: #fff; text-align: center; padding: 11px 16px; font-size: .92rem; }
.mm-band a { color: #ffd56b; font-weight: 700; }

/* Sticky mobile CTA bar (phones only) */
.mobilebar { display: none; }

/* Reveal — only hidden when JS is active; no-JS (or failed-script) users see content immediately */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* Responsive */
@media (max-width: 860px) {
  .grid--3, .steps { grid-template-columns: 1fr; }
  .hero__grid { grid-template-columns: 1fr; gap: 26px; }
  .hero__media img { aspect-ratio: 16 / 10; }
  .split__inner, .visit__grid { grid-template-columns: 1fr; gap: 26px; }
  .lead-form__row { grid-template-columns: 1fr; }
  .trustbar__inner { font-size: .82rem; gap: 6px 16px; }
  .proof__inner { gap: 14px 28px; }
  .nav__links { position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px); background: #fff; flex-direction: column; align-items: flex-start; padding: 80px 28px; gap: 20px; transform: translateX(100%); transition: transform .25s ease; box-shadow: var(--shadow); }
  .nav__links.is-open { transform: none; }
  .nav__toggle { display: block; }

  .carousel__arrow { display: none; } /* phones swipe the carousel instead */
  .map-photo img { height: 240px; }
  .lang-toggle span { display: none; } /* flag-only on phones to save space */
  .lang-toggle { padding: 7px 9px; }

  /* Sticky thumb-reach call/book bar */
  body { padding-bottom: 74px; }
  .mobilebar { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97); backdrop-filter: blur(8px);
    border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -16px rgba(0,0,0,.4); }
  .mobilebar__btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-radius: 12px; font-weight: 700; font-size: 1rem; }
  .mobilebar__call { background: var(--bg-alt); color: var(--brand-deep); border: 1px solid var(--line); }
  .mobilebar__book { background: var(--accent); color: #fff; }
}
