/*
Theme Name: Back To Active
Theme URI: https://backtoactive.ca
Author: Sylvana D'Angelo
Description: Lightweight single-page theme for Back To Active @ Northview. No page builder, no plugin dependencies.
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: backtoactive
*/

/* ---------- tokens ---------- */
:root {
  --teal:       #75B6B2;
  --blue:       #77C1E2;
  --grey:       #76787B;
  --peach:      #DC9680;
  --black:      #000;
  --white:      #fff;

  --header-h:   96px;
  --gutter:     clamp(1.25rem, 5vw, 5rem);
  --maxw:       1600px;

  --ff:         'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ff);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--black);
  background: var(--white);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5em; line-height: 1.15; }
p { margin: 0 0 1.25em; }
p:last-child { margin-bottom: 0; }

h1 { font-size: clamp(2.25rem, 5.5vw, 3.75rem); font-weight: 600; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.75rem); font-weight: 500; }
h3 { font-size: clamp(1.375rem, 2.4vw, 1.875rem); font-weight: 500; }
h5 { font-size: 1.0625rem; font-weight: 400; line-height: 1.65; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--white); color: var(--black); padding: .75rem 1.25rem;
}
.skip-link:focus { left: 0; }

/* Visually hidden, still read by screen readers. */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.header-social { display: flex; gap: .75rem; padding-left: var(--gutter); }
.header-social a { display: inline-flex; color: var(--black); transition: color .2s; }
.header-social a:hover { color: var(--teal); }
.header-social svg { width: 34px; height: 34px; }

.site-logo { justify-self: center; padding: .5rem 1rem; }
.site-logo img { max-height: 76px; width: auto; }

.header-cta {
  justify-self: end; align-self: stretch;
  display: flex; align-items: center; justify-content: center;
  min-width: 230px; padding: 0 2rem;
  background: var(--teal); color: var(--white);
  font-size: 1.25rem; letter-spacing: .04em;
  text-decoration: none;
  transition: background .2s;
}
.header-cta:hover, .header-cta:focus { background: var(--blue); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 5rem var(--gutter);
  background: var(--grey) center/cover no-repeat;
  color: var(--white);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(0,0,0,.18);
}
.hero > * { position: relative; z-index: 1; }

/* Each line is its own block, so it is always exactly two lines.
   Size is driven by viewport width so the long line never has to wrap. */
.hero h1 {
  max-width: none;
  margin-bottom: 2rem;
  text-shadow: 0 2px 18px rgba(0,0,0,.35);
  font-size: clamp(1.75rem, 4.4vw, 3.75rem);
}
.hero h1 span { display: block; white-space: nowrap; }

.btn {
  display: inline-block;
  padding: 1.1rem 3rem;
  background: var(--teal); color: var(--white);
  text-decoration: none; letter-spacing: .06em;
  font-size: 1.0625rem;
  transition: background .2s;
}
.btn:hover, .btn:focus { background: var(--blue); }

/* ---------- split sections ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; }
.split__media { min-height: 420px; background: #eee center/cover no-repeat; }
.split__media img { width: 100%; height: 100%; object-fit: cover; }
.split__body { padding: clamp(2.5rem, 5vw, 5.5rem); display: flex; flex-direction: column; justify-content: center; }

.bio { background: var(--peach); }
.approach { background: var(--white); }

/* ---------- bio ----------
   The image column is `auto`: it sizes itself to whatever the headshot is
   wide at exactly 100vh tall. Nothing crops, nothing stretches. The text
   column is 1fr and takes every remaining pixel. */
.bio {
  grid-template-columns: auto 1fr;
  align-items: stretch;
}
.bio .split__media {
  background: var(--white);
  min-height: 0;
  padding: 0;
  display: flex;
}
.bio .split__media img {
  height: 100vh;
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: center bottom;
}
.bio .split__body {
  padding: clamp(1.5rem, 3.5vw, 4.5rem);
}

/* ---------- hours + map ---------- */
.locate {
  background: var(--blue);
  padding: clamp(3rem, 6vw, 6rem) var(--gutter);
  /* stops the sticky header landing on top of this section on the anchor jump */
  scroll-margin-top: var(--header-h);
}
.locate__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem);
}
.tel { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 700; text-decoration: none; }
.tel:hover { text-decoration: underline; }

.hours-title { font-size: 1.5rem; font-weight: 400; letter-spacing: .02em; margin: 2rem 0 1rem; }
.hours { width: 100%; border-collapse: collapse; max-width: 460px; }
.hours th, .hours td { text-align: left; padding: .45rem 0; font-weight: 400; }
.hours th { width: 45%; }

.addr { font-size: 1.25rem; line-height: 1.5; margin-bottom: 1.5rem; }
.map-frame { position: relative; padding-top: 62%; background: rgba(255,255,255,.4); }
.map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--grey); color: var(--white); padding: clamp(3rem, 6vw, 5rem) var(--gutter); }
.site-footer__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1.4fr auto; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.footer-brand { text-align: center; }
.footer-brand img { margin: 0 auto 1.25rem; max-width: 260px; mix-blend-mode: multiply; }
.footer-brand .name { font-size: 1.5rem; letter-spacing: .08em; margin: 0 0 .35rem; }
.footer-brand .sub { font-size: 1.0625rem; margin: 0; }

.site-footer h3 { font-weight: 500; }
.site-footer .tel { display: inline-block; margin-bottom: 1.5rem; color: var(--white); }
.footer-social { display: flex; gap: 1rem; margin-top: 1.5rem; }
.footer-social a { color: var(--white); display: inline-flex; transition: opacity .2s; }
.footer-social a:hover { opacity: .7; }
.footer-social svg { width: 38px; height: 38px; }

.footer-cta { justify-self: end; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .split, .locate__inner, .site-footer__inner { grid-template-columns: 1fr; }
  .split__media { min-height: 320px; order: -1; }
  .approach .split__media { order: 0; }

  /* stacked: image sits on top at a sane height, text below at full size */
  .bio { grid-template-columns: 1fr; }
  .bio .split__media { min-height: 0; justify-content: center; }
  .bio .split__media img { height: 70vh; width: auto; }
  .footer-cta { justify-self: center; }
  .footer-brand { order: -1; }
}

@media (max-width: 760px) {
  :root { --header-h: 72px; }
  .site-header { grid-template-columns: auto 1fr; grid-template-areas: "social logo" "cta cta"; }
  .header-social { grid-area: social; }
  .site-logo { grid-area: logo; justify-self: end; padding-right: var(--gutter); }
  .site-logo img { max-height: 52px; }
  .header-cta { grid-area: cta; width: 100%; min-height: 56px; font-size: 1.0625rem; }
  .site-header { position: static; }
  .hero { min-height: 70vh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
