/*
Theme Name: Westside Chiropractic
Theme URI: https://westsidechiro.ca
Author: Andrew Cross
Description: Custom theme for Westside Chiropractic, a Burlington, Ontario clinic offering chiropractic, massage therapy, acupuncture, and custom orthotics for all ages.
Version: 0.1.0
Requires at least: 6.5
Tested up to: 6.7
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: westside
*/

:root {
  --forest:          #2a3b27;
  --forest-dark:     #1c281a;
  --terracotta:      #4b6056;   /* clinic sage green, from the logo ribbon */
  --terracotta-ink:  #4b6056;   /* sage for text + buttons: 6.4:1 on cream, 6.8:1 white-on-sage, meets WCAG AA */
  --terracotta-soft: #8fb3a1;   /* light sage for accents on dark backgrounds */
  --sand:            #ead9c0;
  --cream:           #faf8f3;
  --paper:           #ffffff;
  --ink:             #1f1f1f;
  --ink-soft:        #404040;
  --muted:           #6b7075;
  --line:            #e3ddd1;
  --success:         #2f7a4a;
  --content-width:   1180px;
  --radius-card:     14px;
  --radius-pill:     999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; color-scheme: light dark; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--forest-dark);
  line-height: 1.15;
}

h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom: 0.5em; }
h3 { font-size: 1.25rem; margin-bottom: 0.4em; }

a { color: var(--forest); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 243, 0.92);
  backdrop-filter: saturate(1.1) blur(8px);
  -webkit-backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Only pad vertically: the element also has .container (padding: 0 24px), and a
     `padding: 16px 0` shorthand here would reset that horizontal padding to 0,
     pushing the logo flush to the screen edge on full-width mobile. */
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--forest-dark);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo { height: 42px; width: auto; display: block; }
.footer-brand .brand-logo { height: 38px; filter: brightness(0) invert(1); }
@media (max-width: 480px) { .brand-logo { height: 36px; } }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
}
/* The header CTA is an <a> inside .nav-links, so `.nav-links a` (specificity
   0,1,1) would otherwise beat `.btn-primary` (0,1,0) and paint the label dark.
   Keep the button label white on both desktop and mobile. */
.nav-links a.btn-primary,
.nav-links a.btn-primary:hover { color: #fff; }
.nav-links a.btn-ghost { color: var(--forest-dark); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
  max-width: 100%;            /* never exceed the container / viewport on small screens */
  text-align: center;         /* keep a wrapped label centred rather than ragged */
}

.btn-primary {
  background: var(--terracotta-ink);
  color: #fff;
}
.btn-primary:hover {
  background: #3c4e45;
  text-decoration: none;
  transform: translateY(-1px);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--forest-dark);
  border: 1.5px solid var(--forest);
}
.btn-secondary:hover {
  background: var(--forest);
  color: white;
  text-decoration: none;
}

.btn-ghost {
  color: var(--forest-dark);
  background: transparent;
  padding: 8px 14px;
}
.btn-ghost:hover {
  background: rgba(42, 59, 39, 0.08);
  text-decoration: none;
}

/* Mobile menu toggle, hidden on desktop */
.nav-main { position: static; }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--forest-dark);
    border-radius: 8px;
    cursor: pointer;
  }
  .nav-toggle svg { width: 24px; height: 24px; }
  .nav-toggle:hover { background: rgba(42, 59, 39, 0.08); }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.10);
    padding: 8px 24px 18px;
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links > li > a {
    display: block;
    padding: 13px 2px;
    font-size: 1rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink-soft);
  }
  .nav-links > li > a:hover { text-decoration: none; }
  .nav-links .btn-ghost { color: var(--forest); font-weight: 600; }
  .nav-links .nav-cta { margin-top: 14px; }
  .nav-links .nav-cta a {
    border-bottom: none;
    justify-content: center;
    padding: 13px 20px;
    color: #fff;
  }
}

/* ---------- Section helpers ---------- */
section { padding: 80px 0; }

.section-eyebrow {
  display: block;
  color: var(--terracotta-ink);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}

.section-intro {
  max-width: 720px;
  margin-bottom: 48px;
}
.section-intro p {
  color: var(--ink-soft);
  font-size: 1.08rem;
  margin-top: 14px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #111a0d;
  color: rgba(250, 248, 243, 0.6);
  padding: 48px 0 32px;
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

.footer-brand { max-width: 320px; }
.footer-brand .brand { color: var(--cream); margin-bottom: 14px; }
.footer-brand p { line-height: 1.6; }
.footer-areas { margin-top: 12px; font-size: 0.9rem; }
.footer-areas span { color: rgba(250, 248, 243, 0.55); }
.footer-areas a { color: rgba(250, 248, 243, 0.8); }
.footer-areas a:hover { color: var(--terracotta-soft); text-decoration: none; }

.footer-col h4 {
  color: var(--cream);
  font-family: inherit;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  font-weight: 600;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; }
.footer-col a { color: rgba(250, 248, 243, 0.65); }
.footer-col a:hover { color: var(--terracotta-soft); text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
}
.footer-bottom a { color: rgba(250, 248, 243, 0.65); }
.footer-bottom .credit { color: rgba(250, 248, 243, 0.4); }
.footer-bottom .credit a { color: rgba(250, 248, 243, 0.55); text-decoration: none; }
.footer-bottom .credit a:hover { color: var(--terracotta-soft); }
.legal-note {
  color: rgba(250, 248, 243, 0.45);
  font-size: 0.8rem;
  max-width: 720px;
  margin-top: 12px;
  line-height: 1.5;
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Keyboard skip link, hidden until focused */
.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 200;
  background: var(--forest);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
  color: #fff;
  text-decoration: none;
}

/* ---------- Footer social ---------- */
.footer-social { display: flex; gap: 14px; margin-top: 16px; }
.footer-social a { color: rgba(250, 248, 243, 0.7); display: inline-flex; }
.footer-social a:hover { color: var(--terracotta-soft); text-decoration: none; }
.footer-social svg { display: block; }

/* ---------- Mobile quick-action bar (Call + Book) ----------
   On phones the header links collapse behind the hamburger, which hides both
   booking paths. This fixed bar keeps Call and Book one tap away at all times. */
.mobile-cta-bar { display: none; }

@media (max-width: 760px) {
  .mobile-cta-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 150;
    display: flex;
    gap: 10px;
    background: var(--paper);
    border-top: 1px solid var(--line);
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.10);
  }
  .mobile-cta-bar a {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 1rem;
  }
  .mobile-cta-bar a:hover { text-decoration: none; }
  .mcb-call { border: 1.5px solid var(--forest); color: var(--forest-dark); background: transparent; }
  .mcb-book { background: var(--terracotta-ink); color: #fff; }

  /* Keep page content (and the footer credit) clear of the fixed bar. */
  body { padding-bottom: 84px; }
}

/* ---------- Accessibility ---------- */
/* A slightly larger base size makes the whole site easier to read, which
   matters for the clinic's older patients. Everything is sized in rem, so it
   scales proportionally. Users who set a larger browser font still win. */
html { font-size: 106.25%; } /* ~17px */

/* A clearly visible focus ring for keyboard and switch users. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
.btn:focus-visible,
.nav-toggle:focus-visible {
  outline: 3px solid var(--terracotta-ink);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Honour "reduce motion": no pulsing dot, hovers, or smooth-scroll surprises. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Dark mode ----------
   Follows the device / OS setting automatically via prefers-color-scheme, and
   switches back the moment the device does. Most of the work is done by
   re-pointing the design tokens; the handful of sections that are always dark
   (approach, final CTA, footer) are re-pinned so their text stays legible. */
@media (prefers-color-scheme: dark) {
  :root {
    --cream:       #121a19;  /* page background */
    --paper:       #1a2423;  /* cards / elevated surfaces */
    --sand:        #243230;  /* muted accent surface */
    --ink:         #eef2ef;  /* primary text */
    --ink-soft:    #c4ccc7;  /* secondary text */
    --muted:       #8f9a94;  /* tertiary text */
    --line:        #2c3936;  /* borders + dividers */
    --forest-dark: #eef2ef;  /* used as heading ink: light in dark mode */
    --forest:      #a1c492;  /* link / accent that must read on dark */
    --terracotta:  #8fb3a1;  /* lightened sage so it holds up on dark */
  }

  body { background: var(--cream); color: var(--ink); }

  /* Header bar: near-solid so content doesn't bleed through, and the logo crest
     is inverted to white so it reads on the dark bar (matching the footer). */
  .site-header { background: rgba(16, 24, 23, 0.97); border-bottom-color: var(--line); }
  .brand, .brand:hover { color: var(--ink); }
  .brand-logo { filter: brightness(0) invert(1); }

  a { color: var(--forest); }
  .section-eyebrow { color: var(--terracotta-soft); }
  .doctor-body a, .also-content a { color: var(--terracotta-soft) !important; }

  .btn-secondary { color: var(--ink); border-color: #3a4a47; }
  .btn-secondary:hover { background: #24322f; color: #fff; }
  .btn-ghost { color: var(--ink); }
  .btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
  .nav-links a { color: #dce4e0; }
  .nav-links a.btn-ghost { color: #dce4e0; }
  .nav-links { background: rgba(16, 24, 23, 0.98); }

  .mobile-cta-bar { background: #161d12; border-top-color: var(--line); box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.4); }
  .mcb-call { color: var(--ink); border-color: #3a4a47; }

  .tag { background: rgba(255, 255, 255, 0.07); color: var(--ink); }
  .pricing-section-header { background: rgba(255, 255, 255, 0.04); }

  /* The always-dark homepage panels (.approach / .final-cta) are re-pinned in
     homepage.css, which loads after this file and must win the cascade (they use
     --forest-dark / --cream, which flip here). */

  a:focus-visible, button:focus-visible, summary:focus-visible,
  .btn:focus-visible, .nav-toggle:focus-visible { outline-color: var(--terracotta-soft); }
}

/* ---------- Fraunces (self-hosted, was Google Fonts) ---------- */
/* vietnamese */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/fraunces-1.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/fraunces-2.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/fraunces-3.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/fraunces-1.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/fraunces-2.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/fraunces-3.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/fraunces-1.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/fraunces-2.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/fraunces-3.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
