/* SF Valley Plumber — shared stylesheet
   Design system per design.md:
   - §1 tokens: swap the :root block per site palette; components never hardcode colors
   - §5 type ramp: 13 / 15 / 17 / 22 / 29 / 39 (serif display + sans body, 400/700/800)
   - §6.3 spatial echo: spacing limited to 8 / 16 / 24 / 48 / 64
   - §4 accent discipline: accent reserved for CTAs + one isolation detail per section */

:root {
  /* Surfaces */
  --canvas: #ffffff;
  --surface-1: #ffffff;
  --surface-2: #f5f8fb;

  /* Ink */
  --ink: #23282f;
  --ink-muted: #5a626e;

  /* Accent (the ONE isolation color) */
  --accent: #1e4f8a;
  --accent-ink: #ffffff;
  --accent-deep: #16395f;
  --accent-soft: #e9f1f9;
  --accent-glow: rgba(88, 142, 205, 0.45);

  /* Lines */
  --line-strong: rgba(35, 40, 47, 0.14);
  --line-soft: rgba(35, 40, 47, 0.08);

  /* Footer strip */
  --footer-bg: #0f1b2a;
  --footer-ink: #9fafc2;
  --footer-link: #cfe0f2;

  /* Type ramp (§5) */
  --step-label: 13px;
  --step-small: 15px;
  --step-body: 17px;
  --step-h3: 22px;
  --step-h2: 29px;
  --step-h1: 39px;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: Georgia, "Iowan Old Style", "Times New Roman", serif;

  /* Shadows */
  --shadow-card: 0 1px 2px rgba(35, 40, 47, 0.05), 0 4px 16px rgba(35, 40, 47, 0.06);
  --shadow-lift: 0 4px 8px rgba(35, 40, 47, 0.07), 0 12px 32px rgba(35, 40, 47, 0.12);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: 1.7;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Layout — 760px measure, spacing echo 8/16/24/48/64 */
.container {
  max-width: 760px;
  margin-inline: auto;
  padding-inline: 20px;
}

main { padding-block: 48px 64px; }

/* Sites whose pages have no .container wrapper get the same measure */
main:not(.container) {
  max-width: 760px;
  margin-inline: auto;
  padding-inline: 20px;
}

.header-inner,
.footer-inner {
  max-width: 760px;
  margin-inline: auto;
  padding-inline: 20px;
}

section[id],
h2[id] { scroll-margin-top: 96px; }

/* Typography — hierarchy-driven flow (§2.2): ink headings, accent only for CTAs */
h1 {
  font-family: var(--font-display);
  font-size: clamp(var(--step-h2), 6vw, var(--step-h1));
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 24px;
}

h2 {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(var(--step-h3), 5vw, var(--step-h2));
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  margin: 48px 0 16px;
  padding-top: 14px;
}

/* One accent detail per section: the kicker tick */
h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
}

h3 {
  font-size: var(--step-h3);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  margin: 24px 0 8px;
}

p { margin: 0 0 16px; }

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover { color: var(--accent-deep); }

ul, ol { padding-left: 22px; }

li { margin-bottom: 8px; }

/* Header */
.site-header {
  background: var(--accent-deep);
  color: #fff;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), 0 12px 28px -18px rgba(0, 0, 0, 0.55);
}

.header-inner,
.site-header > .container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand {
  color: #fff;
  font-size: var(--step-h3);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand:hover { color: #fff; text-decoration: none; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
}

/* Flatten navs marked up with ul/li into the same flex row */
.site-nav ul { display: contents; list-style: none; }

.site-nav a {
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--step-small);
  text-decoration: none;
}

.site-nav a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* The header call pill is the page's leverage point (§4.1): white on deep accent */
.site-nav .cta-call,
.site-nav .nav-call {
  background: #fff;
  color: var(--accent-deep);
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
  white-space: nowrap;
}

.site-nav .cta-call:hover,
.site-nav .nav-call:hover {
  background: var(--accent-soft);
  color: var(--accent-deep);
  text-decoration: none;
}

@media (min-width: 640px) {
  .header-inner,
  .site-header > .container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* Call bar directly below header */
.call-bar {
  background: var(--accent);
  padding: 10px 0;
}

.call-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.call-bar-text {
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--step-small);
}

/* Buttons — the single accent isolation tactic (§6.5) */
.cta-call {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: var(--step-small);
  padding: 10px 22px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.cta-call:hover {
  background: var(--accent-deep);
  color: var(--accent-ink);
  text-decoration: none;
}

.call-bar .cta-call {
  background: #fff;
  color: var(--accent-deep);
}

.call-bar .cta-call:hover {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

/* Wells — proof blocks sit on surface-2, one accent edge each (§8.1) */
.key-takeaways {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 24px;
  margin: 24px 0;
}

.key-takeaways h2,
.toc h2 {
  font-family: var(--font-body);
  font-size: var(--step-label);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent-deep);
  margin: 0 0 12px;
  padding-top: 0;
}

.key-takeaways h2::before,
.toc h2::before,
.cta-section h2::before,
.footer-nav h2::before { content: none; }

.key-takeaways ul { margin: 0; }

.key-takeaways li:last-child { margin-bottom: 0; }

/* Table of contents */
.toc {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 24px;
  margin: 24px 0;
}

.toc ul { margin: 0; list-style: none; padding-left: 0; }

.toc li { margin-bottom: 8px; }

.toc li:last-child { margin-bottom: 0; }

.toc a { text-decoration: none; }

.toc a:hover { text-decoration: underline; }

.toc .toc-group {
  font-size: var(--step-label);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-muted);
  margin-top: 16px;
}

/* Cost table — editorial hairlines, single accent rule under the header */
.cost-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 48px;
  font-size: var(--step-small);
}

.cost-table th,
.cost-table td {
  padding: 12px 16px;
  text-align: left;
}

.cost-table thead th {
  font-size: var(--step-label);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-muted);
  border-bottom: 2px solid var(--accent);
}

.cost-table tbody td { border-bottom: 1px solid var(--line-soft); }

.cost-table tbody td:first-child { font-weight: 600; }

.cost-table tbody tr:hover { background: var(--accent-soft); }

/* Neighborhood card grid — middle column staggered for implied motion (§2.4) */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 24px 0 48px;
}

@media (min-width: 560px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid .card:nth-child(even) { margin-top: 24px; }
}

@media (min-width: 760px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .card-grid .card:nth-child(even) { margin-top: 0; }
  .card-grid .card:nth-child(3n+2) { margin-top: 24px; }
}

.card {
  background: var(--surface-1);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lift);
}

.card h3 {
  margin: 0 0 8px;
  font-size: var(--step-h3);
}

.card p {
  font-size: var(--step-small);
  color: var(--ink-muted);
  margin: 0 0 16px;
  flex-grow: 1;
}

.card a.card-link {
  font-weight: 700;
  text-decoration: none;
}

.card a.card-link:hover { text-decoration: underline; }

/* FAQ — questions in ink; Worcester's .faq-item variant renders as cards */
.faq-section h3 {
  color: var(--ink);
  margin-top: 24px;
}

.faq-section h3:first-child { margin-top: 0; }

.faq-item {
  background: var(--surface-1);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.faq-item h3 { margin-top: 0; }

.faq-item p:last-child { margin-bottom: 0; }

/* Mid-content CTA box — quiet relief zone before the ask (§6.1) */
.cta {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 24px;
  margin-top: 48px;
}

.cta p:last-child { margin-bottom: 0; }

/* Closing CTA — release beat: deep accent band, spotlight glow, whitespace moat (§8.8) */
.cta-section {
  background: radial-gradient(ellipse 80% 130% at 50% -20%, var(--accent-glow), transparent 70%), var(--accent-deep);
  color: #fff;
  text-align: center;
  padding: 64px 20px;
  margin-top: 64px;
}

.cta-section h2,
.cta-section .cta-heading {
  font-family: var(--font-display);
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  margin: 0 0 16px;
  padding-top: 0;
}

.cta-section p {
  color: rgba(255, 255, 255, 0.82);
  max-width: 560px;
  margin: 0 auto 24px;
}

.cta-section a { color: #fff; }

.cta-section .cta-call {
  background: #fff;
  color: var(--accent-deep);
  font-size: var(--step-body);
  padding: 14px 32px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.cta-section .cta-call::after { content: " →"; }

.cta-section .cta-call:hover {
  background: var(--accent-soft);
  color: var(--accent-deep);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

/* In-column CTA sections (inside main) render as a rounded panel, not a band */
main .cta-section {
  border-radius: 14px;
  margin: 48px 0 0;
  padding: 48px 24px;
}

/* Footer — one monotone strip (§6.2) */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-ink);
  padding: 48px 0;
  margin-top: 64px;
  font-size: var(--step-small);
}

.site-footer p { margin: 0 0 16px; }

.footer-brand { color: #fff; }

.footer-brand,
.site-footer .footer-brand strong { font-weight: 800; }

.footer-nav h2 {
  font-family: var(--font-body);
  font-size: var(--step-label);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--footer-ink);
  margin: 0 0 12px;
  padding-top: 0;
}

.footer-links,
.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.footer-nav a { margin-right: 18px; }

.footer-links a,
.footer-nav a,
.footer-contact a {
  color: var(--footer-link);
  text-decoration: none;
}

.footer-links a:hover,
.footer-nav a:hover,
.footer-contact a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.copyright,
.footer-copy { color: var(--footer-ink); opacity: 0.75; }

/* Illustration figures — inline SVG heroes for articles + home */
.article-hero,.home-figure{background:var(--surface-2);border:1px solid var(--line-soft);border-radius:10px;padding:24px;margin:0 0 24px}
.home-figure{margin:24px 0}
.article-hero svg,.home-figure svg{display:block;width:100%;height:auto}
.article-hero figcaption,.home-figure figcaption{font-size:var(--step-small);color:var(--ink-muted);margin:16px 0 0}

/* Hero with quote form — asymmetric two-pane split (§3): copy left, form right.
   Accent discipline (§4): the call button + submit button are the isolation color;
   the form card itself stays neutral so the buttons carry the ask. */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
  margin: 0 0 48px;
}

.hero h1 { margin-bottom: 16px; }

.hero-copy .lede {
  font-size: var(--step-h3);
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 16px;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0 0 16px;
}

.hero-cta-row .cta-call {
  font-size: var(--step-body);
  padding: 14px 32px;
}

.hero-cta-row .cta-call::after { content: " →"; }

.hero-alt { font-weight: 700; white-space: nowrap; }

.hero-trust {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: var(--step-small);
  color: var(--ink-muted);
}

.hero-trust li { margin: 0; }

.hero-trust li::before {
  content: "✓ ";
  color: var(--accent-deep);
  font-weight: 800;
}

.hero-form-card {
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-lift);
}

.hero-form-title {
  font-size: var(--step-h3);
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 8px;
}

.hero-form-sub {
  font-size: var(--step-small);
  color: var(--ink-muted);
  margin: 0 0 16px;
}

#quote-form { scroll-margin-top: 96px; }

.hero-form label {
  display: block;
  font-size: var(--step-small);
  font-weight: 700;
  margin: 0 0 4px;
}

.hero-optional { font-weight: 400; color: var(--ink-muted); }

.hero-form input,
.hero-form select,
.hero-form textarea {
  width: 100%;
  font: inherit;
  font-size: var(--step-small);
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 16px;
}

.hero-form textarea {
  resize: vertical;
  min-height: 72px;
}

.hero-form button[type="submit"] {
  width: 100%;
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: var(--step-body);
  font-weight: 800;
  padding: 14px 24px;
  border-radius: 999px;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.hero-form button[type="submit"]:hover {
  background: var(--accent-deep);
  transform: translateY(-2px);
}

.hero-form-note {
  font-size: var(--step-small);
  color: var(--ink-muted);
  text-align: center;
  margin: 16px 0 0;
}

.hero-form-note a { font-weight: 700; }

.hero-form-success {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 16px;
  font-size: var(--step-small);
  margin: 16px 0 0;
}

.hero-form-success[hidden] { display: none; }

@media (min-width: 660px) {
  .hero { grid-template-columns: 1.15fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-form button[type="submit"]:hover { transform: none; }
}

/* Homeowner comments — aggregated buyer voices, one per buying-cycle stage */
.comments {
  margin-top: 48px;
  border-top: 2px solid var(--line-strong);
  padding-top: 8px;
}

.comments-note {
  font-size: var(--step-small);
  color: var(--ink-muted);
}

.comment {
  border-top: 1px solid var(--line-soft);
  padding: 16px 0;
}

.comment:last-child {
  border-bottom: 1px solid var(--line-soft);
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.comment-avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--accent-deep);
  font-size: var(--step-small);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comment-author {
  margin: 0;
  font-size: var(--step-small);
}

.comment-hood {
  color: var(--ink-muted);
}

.comment-stage {
  margin: 0;
  font-size: var(--step-label);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-muted);
}

.comment-text {
  margin: 0;
  font-size: var(--step-small);
}

/* Official team replies — one answer under each buyer question */
.comment-reply {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
}

.comment-reply-author {
  margin: 0 0 8px;
  font-size: var(--step-small);
}

.comment-reply-label {
  color: var(--ink-muted);
}

.comment-reply-text {
  margin: 0;
  font-size: var(--step-small);
}
