/* =========================================================================
   Eleve Physical Therapy — site styles
   Change colors, fonts and spacing in the :root block below; everything
   else picks them up automatically.
   ========================================================================= */

/* Font files live in /fonts (see fonts/README.md). If they're missing the
   site falls back to similar system fonts. */
@font-face {
  font-family: "Glacial Indifference";
  src: url("../fonts/GlacialIndifference-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Glacial Indifference";
  src: url("../fonts/GlacialIndifference-Bold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* Clinic theme colors */
  --blue: #6699cc;
  --blue-dark: #4d7fb3;
  --offwhite: #fffcf4;
  --green: #82d4c9;
  --green-dark: #5fbfb2;

  --text: #111111;
  --muted: #4a4a4a;
  --line: #e2e2e2;
  --bg: #ffffff;

  --font: "Glacial Indifference", "Century Gothic", "Avenir Next", "Segoe UI", sans-serif;
  --max-width: 1100px;
  --radius: 10px;
  --header-height: 72px;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.65;
}

img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; font-weight: 700; margin: 0 0 0.6em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
a { color: var(--blue-dark); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}
.narrow { max-width: 780px; margin-left: auto; margin-right: auto; }
.center { text-align: center; }

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

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

/* Links that jump to a section (e.g. contact.html#form) stop below the sticky banner */
[id] { scroll-margin-top: calc(var(--header-height) + 16px); }

/* ---------- "Wait for photos" loading screen ---------- */
.page-loader { display: none; }
html.is-loading .page-loader {
  display: flex;
  position: fixed; inset: 0;
  align-items: center; justify-content: center;
  background: var(--bg);
  z-index: 100;
}
html.is-loading body > *:not(.page-loader) { visibility: hidden; }
main { transition: opacity 0.4s ease; }
html.is-loading main { opacity: 0; }

.spinner {
  width: 44px; height: 44px;
  border: 4px solid var(--offwhite);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Top banner ---------- */
.site-header {
  position: sticky; top: 0;
  z-index: 50;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 20px;
}
.brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  display: flex; align-items: center;
}
.brand img { height: 52px; width: auto; }

.nav ul {
  list-style: none;
  display: flex; flex-wrap: wrap;
  gap: 2px;
  margin: 0; padding: 0;
}
.nav a {
  display: block;
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  padding: 8px 12px;
  border-radius: 6px;
}
.nav a:hover { background: rgba(255, 255, 255, 0.15); }
.nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--green); border-radius: 6px 6px 0 0; }

.menu-toggle {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  cursor: pointer;
}
.menu-toggle .bar { display: block; height: 2px; background: #fff; border-radius: 2px; }

@media (max-width: 880px) {
  .menu-toggle { display: flex; }
  .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--blue);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; padding: 8px 20px 16px; }
  .nav a { padding: 12px; font-size: 1.1rem; }
  .nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--green); border-radius: 0; }
}

/* ---------- Page title image (top of every page) ---------- */
.page-hero {
  position: relative;
  height: clamp(220px, 36vw, 420px);
  overflow: hidden;
  background: var(--blue);
}
.page-hero > img { width: 100%; height: 100%; object-fit: cover; }
.page-hero__content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 20px;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
}
.page-hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  margin: 0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

/* Home page hero: taller, with tagline and button */
.page-hero--home { height: clamp(460px, 75vh, 700px); }
.page-hero--home .lead {
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  max-width: 820px;
  margin: 0.6em auto 0.4em;
  font-weight: 700;
}
.page-hero--home p { max-width: 640px; margin-left: auto; margin-right: auto; }
.page-hero--home .button { margin-top: 1em; }

/* Hero with no photo (FAQ page) */
.page-hero--plain { height: auto; background: var(--offwhite); }
.page-hero--plain .page-hero__content {
  position: static;
  background: none;
  color: var(--text);
  padding: 72px 20px;
}
.page-hero--plain h1 { text-shadow: none; }

/* ---------- Page bottom image (no text) ---------- */
.page-end-image img {
  width: 100%;
  height: clamp(200px, 30vw, 380px);
  object-fit: cover;
}

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section--tint { background: var(--offwhite); }
.section + .section:not(.section--tint) { padding-top: 24px; }

/* Text + picture side by side. Text always comes first in the HTML,
   so on phones the paragraph sits above its picture. */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.split--reverse .split__text { order: 2; }
.split__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}
.split__media--portrait img { aspect-ratio: 4 / 5; }

@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; gap: 24px; }
  .split--reverse .split__text { order: 0; }
  .section { padding: 52px 0; }
}

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  background: var(--green);
  color: #0d2f2a;
  font-weight: 700;
  font-family: inherit;
  font-size: 1.05rem;
  text-decoration: none;
  padding: 14px 30px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.button:hover { background: var(--green-dark); transform: translateY(-1px); }
.button:disabled { opacity: 0.6; cursor: default; transform: none; }

/* ---------- Service cards (home page) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  margin: 36px 0;
}
.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  display: flex; flex-direction: column;
}
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card__body { padding: 22px 24px 26px; }
.card__body h3 { font-size: 1.2rem; }
.card__body p { margin: 0; color: var(--muted); }

/* ---------- Photo rows and gallery ---------- */
.photo-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* stays 3-across, even on phones */
  gap: clamp(6px, 1.5vw, 14px);
  margin: 24px 0 28px;
}
.photo-row img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Single wide banner photo inside a section */
.wide-image img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 32px;
}
.intro { font-size: 1.25rem; }

/* ---------- Services page ---------- */
.service-group { padding: 64px 0; border-top: 1px solid var(--line); }
.service-group:first-of-type { border-top: 0; }
.service-item { margin-top: 44px; }
.service-item:first-of-type { margin-top: 0; }

.check-list { padding-left: 1.2em; margin: 0 0 1.4em; }
.check-list li { margin-bottom: 0.3em; }
.check-list li::marker { color: var(--blue); }

.price-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 10px;
  border-top: 1px solid var(--line);
  max-width: 620px;
}
.price-list li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.price-list .price { font-weight: 700; white-space: nowrap; }
.note { color: var(--muted); font-size: 0.95rem; }

/* ---------- Question / answer lists (New Patients, FAQ) ---------- */
.qa-item { padding: 28px 0; border-bottom: 1px solid var(--line); }
.qa-item:last-child { border-bottom: 0; }
.qa-item h2 { font-size: 1.3rem; margin-bottom: 0.5em; }
.qa-item p:last-child { margin-bottom: 0; }

/* ---------- Contact form ---------- */
.form-card {
  background: var(--offwhite);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 44px);
}
.form-card fieldset { border: 0; padding: 0; margin: 0 0 28px; }
.form-card legend { font-weight: 700; font-size: 1.2rem; margin-bottom: 12px; padding: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.field { margin-bottom: 16px; }
.field label, .field-label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 1rem; }
.field .hint { display: block; font-weight: 400; color: var(--muted); font-size: 0.92rem; }
.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="tel"],
.form-card textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem;
  border: 1px solid #bdbdbd;
  border-radius: 8px;
  background: #fff;
}
.form-card input:focus, .form-card textarea:focus { outline: 3px solid var(--green); border-color: var(--blue); }
.form-card textarea { min-height: 130px; resize: vertical; }
.choices label { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 1rem; cursor: pointer; }
.choices input { width: 18px; height: 18px; accent-color: var(--blue); }
.form-status { margin-top: 14px; color: var(--muted); }
.form-success {
  background: var(--offwhite);
  border-left: 6px solid var(--green);
  border-radius: var(--radius);
  padding: 32px;
  font-size: 1.2rem;
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--offwhite);
  border-top: 4px solid var(--blue);
  padding: 40px 0 20px;
  font-size: 0.98rem;
}
.footer-inner {
  display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: flex-start;
  gap: 24px;
}
.footer-brand p { margin: 4px 0 0; color: var(--muted); }
.footer-logo { height: 56px; width: auto; }
.footer-links, .footer-social {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px 18px;
}
.footer-links a, .footer-social a { color: var(--text); text-decoration: none; }
.footer-links a:hover, .footer-social a:hover { color: var(--blue-dark); text-decoration: underline; }
.footer-copy { margin-top: 28px; color: var(--muted); font-size: 0.88rem; }
.footer-copy p { margin: 0; }
