/* Main Street Fresh — reusable client-site template stylesheet.
   Shared/static across every client site. Per-client color theming comes from
   the small inline <style> block in the generated <head> (--primary,
   --primary-dark, --accent), set via build_site.py from site-config.json.
   Do not hardcode a client's brand color in here — it belongs in the config.

   Design pass 2026-08-30: brought up to the same language as the venture's own
   pitch page (site/css/styles.css) — larger type, clamp-based section rhythm,
   pill buttons, borderless tonal cards with soft shadows, a translucent blurred
   header, and dark-mode support. Every class name is unchanged so
   src/page.html.tmpl needs no edits.

   IMPORTANT constraint this file works under: a client's --primary can be any
   hue or lightness. Anything that puts text on a brand-colored field has to
   stay safe for a light brand color too, which is why the hero is a soft tint
   with dark text rather than the pitch page's white-on-navy gradient — there is
   no designer checking each client's palette. */

:root {
  --bg: #fafbfc;
  --surface: #ffffff;
  --surface-alt: #f2f4f7;
  --fg: #2f343d;
  --muted: #646973;
  --muted-2: #646973;   /* was #86867f = 3.66 on white: an AA fail on real footer text */
  --line: #e6e9ee;
  --line-soft: rgba(47, 68, 97, 0.10);
  --line-strong: #c9d0da;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --font-sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --focus-ring: #1c1c1a;
  --shadow-sm: 0 1px 2px rgba(47, 52, 61, 0.05);
  --shadow-md: 0 8px 24px rgba(47, 52, 61, 0.08);
  --ease: cubic-bezier(0.16, 0.84, 0.44, 1);
  /* Primary used as a FOREGROUND color (service icons, checkmarks, focus rings)
     has to be able to diverge from primary-as-a-button-background once the page
     goes dark: a dark brand color reads fine behind white button text but
     disappears as text on a near-black surface. */
  --primary-fg: var(--primary-ink);
  --header-bg: rgba(250, 251, 252, 0.78);
  --icon-tint: rgba(28, 32, 40, 0.06);
  --hero-tint: transparent;
  --btn-ghost-bg: #ffffff;
  --btn-ghost-bg-hover: #eef2f7;
}

/* Derive the brand-tinted surfaces from whatever the client's --primary is,
   where color-mix is available. Guarded by @supports so a browser without it
   keeps the neutral fallbacks above rather than dropping to an invalid value. */
@supports (color: color-mix(in srgb, red, blue)) {
  :root {
    --icon-tint: color-mix(in srgb, var(--primary) 11%, transparent);
    --hero-tint: color-mix(in srgb, var(--primary) 7%, transparent);
    /* Tint the page grounds with the client's brand too. Capped at 4%/8%:
       verified that even a pure-black brand keeps --fg at ~11.5 and --muted at
       ~4.6 here, so no client colour can drop body text below AA. */
    --bg: color-mix(in srgb, var(--primary) 4%, #ffffff);
    --surface-alt: color-mix(in srgb, var(--primary) 8%, #ffffff);
  }
}

/* Dark mode is OPT-IN per client (theme.color_scheme: "auto" in the config sets
   data-scheme="auto" on <html>). Default is light-only: a small-business owner
   should never discover their site "went black" on a phone set to dark mode,
   and a brand palette nobody reviewed in dark can end up unreadable. */
@media (prefers-color-scheme: dark) {
  :root[data-scheme="auto"] {
    --bg: #101215;
    --surface: #191c21;
    --surface-alt: #15181c;
    --fg: #f1f0ed;
    --muted: #a8a69f;
    --muted-2: #817f79;
    --line: #292d33;
    --line-soft: rgba(255, 255, 255, 0.09);
    --line-strong: #3b4048;
    --shadow-sm: 0 10px 28px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 26px 56px rgba(0, 0, 0, 0.55);
    --focus-ring: #f1f0ed;
    --header-bg: rgba(16, 18, 21, 0.72);
    --icon-tint: rgba(255, 255, 255, 0.08);
    --hero-tint: rgba(255, 255, 255, 0.03);
    --btn-ghost-bg: #23272d;
    --btn-ghost-bg-hover: #2c3138;
    /* Safe light neutral by default; brand-tinted where color-mix works. Never
       left as the raw (dark) client primary, which would be unreadable here. */
    --primary-fg: #cfd6de;  /* light neutral; brand-tinted below where supported */
  }
  @supports (color: color-mix(in srgb, red, blue)) {
    :root[data-scheme="auto"] {
      --primary-fg: color-mix(in srgb, var(--primary) 55%, #ffffff);
      --icon-tint: color-mix(in srgb, var(--primary) 22%, transparent);
    }
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-weight: 800; line-height: 1.1; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.9rem, 4.5vw, 2.75rem); margin-bottom: 1.75rem; }
/* Small uppercase label above each section heading -- the same "finished
   product" cue the venture's own pitch page uses. Brand-inked, AA-safe. */
.eyebrow {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-fg);
  margin-bottom: 0.7rem;
}
h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.012em; margin-bottom: 0.6rem; }
p { max-width: 62ch; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 1.5rem; }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--fg);
  color: var(--bg);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

.icon { width: 1.1em; height: 1.1em; vertical-align: -0.15em; }

/* ---- header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem 1.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--fg);
  margin-right: auto;
}
.brand-mark { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.brand-text { white-space: nowrap; }
.site-nav { display: flex; gap: 2rem; }
.site-nav a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--muted);
  transition: color 0.15s ease;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--fg); }

.call-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-button);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.call-btn:hover, .call-btn:focus-visible { background: var(--primary-dark); transform: translateY(-1px); }

.mobile-menu { display: none; }
.mobile-menu summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
}
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu[open] summary { border-color: var(--fg); }
.mobile-menu nav {
  position: absolute;
  left: 1rem;
  right: 1rem;
  margin-top: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
}
.mobile-menu nav a {
  text-decoration: none;
  color: var(--fg);
  font-weight: 600;
  padding: 0.85rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
}
.mobile-menu nav a:hover, .mobile-menu nav a:focus-visible { background: var(--bg); }

/* ---- hero ----
   Soft brand tint + dark text, deliberately NOT white-on-brand: see the note at
   the top of this file about arbitrary client brand colors. */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(4rem, 10vw, 7rem) 0 clamp(3.5rem, 8vw, 5.5rem);
  background: var(--hero-tint);
  border-bottom: 1px solid var(--line-soft);
}
.hero::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.07;
  filter: blur(70px);
  top: -180px;
  right: -120px;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 820px; }
/* With a hero photo: two columns, copy left, photo right. The photo is what
   stops the hero reading as "text on a tint with an empty right half". */
.hero-inner.has-media {
  max-width: 1160px;   /* the .wrap width -- 'none' broke alignment with the header */
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero-media { margin: 0; position: relative; }
.hero-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: calc(var(--radius-lg) + 6px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 30px 60px -20px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.hero-media::after {   /* brand-colored offset slab behind the photo for depth */
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  border-radius: calc(var(--radius-lg) + 6px);
  background: var(--primary);
  opacity: 0.12;
  z-index: -1;
}
.hero-chips {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.hero-chips li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.85rem 0.4rem 0.65rem;
  box-shadow: var(--shadow-sm);
}
.hero-chips .icon { width: 1rem; height: 1rem; color: var(--primary-fg); }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.hero .lead {
  margin-top: 1.4rem;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  color: var(--muted);
  max-width: 54ch;
}
.hero-cta { margin-top: 2.5rem; display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.03rem;
  padding: 0.95rem 1.9rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
              box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn-primary { background: var(--primary-button); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-ghost { background: var(--btn-ghost-bg); color: var(--fg); }
.btn-ghost:hover, .btn-ghost:focus-visible { background: var(--btn-ghost-bg-hover); }

/* ---- services ---- */
.services { padding: clamp(4rem, 9vw, 6.5rem) 0; }
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.service-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  border: 1px solid var(--line);
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
/* Badged icon without needing a wrapper element in page.html.tmpl: the <svg>
   itself takes the padding, tinted background and radius. Relies on the global
   border-box rule above so the glyph sits inset rather than overflowing. */
.service-icon {
  width: 3rem;
  height: 3rem;
  padding: 0.72rem;
  border-radius: 50%;
  background: var(--icon-tint);
  color: var(--primary-fg);
  margin-bottom: 1rem;
}
.service-card p { color: var(--muted); font-size: 0.97rem; }

/* ---- about ---- */
.about { padding: clamp(4rem, 9vw, 6.5rem) 0; background: var(--surface-alt); }
.about-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  align-items: start;
}
.about-copy p { margin-bottom: 1rem; color: var(--muted); }
.service-area { color: var(--fg) !important; }
.hours-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.hours-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.hours-row:last-child { border-bottom: 0; }
.hours-row dt { color: var(--muted); font-weight: 600; }
.hours-row dd { color: var(--fg); font-weight: 600; text-align: right; }

/* ---- gallery ---- */
.gallery { padding: clamp(4rem, 9vw, 6.5rem) 0; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}
.gallery-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  border: 1px solid var(--line);
}
.gallery-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
/* Only rendered when a config sets `gallery_note` -- used by the two demo sites
   to say the photography is illustrative. Deliberately opt-in so it can never
   appear on a real client's site by default. */
.gallery-note {
  margin: 1.25rem auto 0;
  max-width: 62ch;
  text-align: center;
  font-size: 0.92rem;
  color: var(--muted);
}

/* ---- contact ---- */
.contact { padding: clamp(4rem, 9vw, 6.5rem) 0 clamp(4.5rem, 10vw, 7rem); background: var(--surface-alt); }
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: start;
}
.nap { margin: 1rem 0 1.25rem; line-height: 1.9; }
.nap a { text-decoration: underline; text-underline-offset: 0.15em; }
/* Facebook / Google Business Profile / directions -- pill links with a glyph so
   they scan as a row of destinations, not three sentences. Facebook uses its
   plain "f" glyph; GBP uses a neutral storefront icon rather than Google's mark. */
.social-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.5rem; }
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--primary-fg);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.5rem 0.95rem 0.5rem 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.social-link .icon { width: 1.05rem; height: 1.05rem; }
.social-link:hover, .social-link:focus-visible { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
/* Demo sites only (`demo: true`): the same pill, not a link -- the example configs'
   placeholder URLs are dead pages, and these sites are shown to prospects. */
.social-link.is-demo { cursor: default; }

.contact-form {
  display: grid;
  gap: 1rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
/* Post-submit confirmation. contact-handler.php redirects to ./#contact-sent, so
   this shows via :target with no JS -- the page has none. Hidden otherwise. */
.form-sent {
  display: none;
  grid-column: 1 / -1;
  margin: 0 0 1rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--primary-ink);
  border-left-width: 5px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
  font-size: 0.95rem;
}
.form-sent:target { display: block; }
.form-error { border-color: #a33a2a; }
.form-error:target { display: block; }
.form-row { display: grid; gap: 0.4rem; }
.form-row label { font-weight: 600; font-size: 0.9rem; }
.form-row input, .form-row textarea {
  font: inherit;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  width: 100%;
  transition: border-color 0.15s ease;
}
.form-row input:focus-visible, .form-row textarea:focus-visible {
  outline-color: var(--primary-fg);
  border-color: var(--primary-fg);
}
.form-note { font-size: 0.9rem; color: var(--muted); }
/* Honeypot: hidden from sighted users AND removed from tab order/AT, but
   still present in the DOM for basic bots that don't execute CSS. */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- footer ---- */
.site-footer { padding: 3.25rem 0 2rem; border-top: 1px solid var(--line-soft); background: var(--surface-alt); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 2rem;
  padding-bottom: 2rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line-soft);
}
.footer-brand strong { display: block; font-size: 1.05rem; margin-top: 0.6rem; }
.footer-brand p { color: var(--muted); font-size: 0.92rem; margin-top: 0.3rem; max-width: 34ch; }
.footer-brand .brand-mark { width: 28px; height: 28px; }
.footer-nav, .footer-contact { display: flex; flex-direction: column; gap: 0.45rem; font-size: 0.92rem; font-style: normal; }
.footer-nav a, .footer-contact a { color: var(--fg); text-decoration: none; }
.footer-nav a:hover, .footer-contact a:hover { color: var(--primary-fg); text-decoration: underline; }
.footer-contact span { color: var(--muted); }
/* Icon-only social row in the footer -- the place people already look for
   these; the labelled versions live in the Contact section. */
.footer-social { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.footer-social a, .footer-social .is-demo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); color: var(--primary-fg);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.footer-social a:hover, .footer-social a:focus-visible { transform: translateY(-1px); box-shadow: var(--shadow-md); text-decoration: none; }
.footer-social .icon { width: 1.05rem; height: 1.05rem; }
.footer-social .is-demo { cursor: default; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted-2);
}
.footer-inner a { color: var(--muted-2); }

/* ---- responsive ---- */
@media (max-width: 860px) {
  .about-inner, .contact-inner { grid-template-columns: 1fr; }
  .hero-inner.has-media { grid-template-columns: 1fr; }
  .hero-media { max-width: 560px; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 720px) {
  .site-nav { display: none; }
  .mobile-menu { display: block; position: relative; }
  .header-inner { padding: 0.75rem 1rem; gap: 0.6rem; }
  /* Phone width: the brand shrinks and truncates instead of colliding with the
     call button, and the call button collapses to its icon (aria-label keeps
     the number for screen readers). Found by a 375px render, 2026-08-30. */
  .brand { min-width: 0; flex: 1 1 auto; font-size: 0.98rem; }
  .brand-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .call-btn { padding: 0.55rem 0.7rem; }
  .call-btn span.call-label { display: none; }
  .wrap { padding: 0 1.1rem; }
  .hero { padding: 3rem 0; }
  .services, .about, .gallery, .contact { padding: 3.25rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .service-card, .gallery-item, .btn, .call-btn { transition: none; }
  .service-card:hover, .gallery-item:hover, .btn-primary:hover { transform: none; }
}

/* ---- print (price sheets / quotes printed from the browser) ---- */
@media print {
  .site-header, .mobile-menu, .contact-form, .call-btn, .skip-link { display: none !important; }
}
