/* ============================================================
   Prairie Creek Plumbing — stylesheet
   Beginner notes:
   - All colors and sizes live in the :root "design tokens" block,
     so you can re-brand the whole site by editing a few lines.
   - Sections are in the same order as the page itself.
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Brand colors */
  --navy: #15324F;        /* deep navy — headings, header, footer */
  --navy-soft: #2A4A6B;   /* lighter navy for secondary shapes */
  --orange: #C45116;      /* warm orange — buttons, accents */
  --orange-dark: #A33F0B; /* darker orange — hover states & small text links
                             (passes WCAG AA contrast on off-white) */
  --bg: #F7F5F0;          /* off-white page background */
  --card: #FFFFFF;        /* card backgrounds */
  --ink: #1E2A36;         /* main body text (near-black, readable) */
  --ink-soft: #46586A;    /* secondary text */
  --line: #E2DED4;        /* subtle borders */

  /* Type & spacing */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif; /* system fonts = fast */
  --radius: 10px;         /* restrained rounded corners */
  --shadow: 0 1px 3px rgba(21, 50, 79, 0.08), 0 4px 14px rgba(21, 50, 79, 0.06);
  --space: clamp(3.5rem, 8vw, 6rem);  /* vertical rhythm between sections */
  --header-h: 72px;       /* approximate sticky header height */
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  /* Keeps anchor targets from hiding under the sticky header */
  scroll-padding-top: calc(var(--header-h) + 12px);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;      /* ~17px: comfortable for all ages */
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

img, svg { max-width: 100%; display: block; }

h1, h2, h3 {
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 0.6em;
  text-wrap: balance;       /* nicer multi-line headings (safe to ignore in old browsers) */
}
h1 { font-size: clamp(2rem, 5.5vw, 3rem); letter-spacing: -0.015em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }
a { color: var(--orange-dark); }
a:hover { color: var(--navy); }

/* Layout helper: a centered column with side padding */
.container {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}
.container-narrow { max-width: 760px; }

/* Each major section gets breathing room + anchor offset */
.section { padding-block: var(--space); scroll-margin-top: calc(var(--header-h) + 12px); }
.section-alt { background: #FDFCF9; border-block: 1px solid var(--line); }
.section-lede { max-width: 56ch; color: var(--ink-soft); margin-bottom: 2.2rem; }

/* ---------- 3. Accessibility helpers ---------- */
.skip-link {
  position: absolute;
  left: 1rem; top: -100px;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 0.6rem; }

/* A clearly visible focus ring for keyboard users */
:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Turn off smooth-scrolling for people who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- 4. Demo banner ---------- */
.demo-banner {
  margin: 0;
  padding: 0.45rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  background: var(--navy);
  color: #D9E2EC;
}

/* ---------- 5. Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.button-lg { padding: 0.95rem 1.6rem; font-size: 1.0625rem; }

.button-primary { background: var(--orange); color: #fff; }
.button-primary:hover { background: var(--orange-dark); color: #fff; }

.button-secondary {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.button-secondary:hover { background: var(--navy); color: #fff; }

/* ---------- 6. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 245, 240, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--navy);
  font-size: 1.2rem;
  margin-right: auto;
}
.logo-mark { color: var(--orange); flex-shrink: 0; }
.logo-text strong { font-weight: 800; }

.site-nav ul {
  display: flex;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  text-decoration: none;
  color: var(--navy);
  font-weight: 600;
  padding: 0.4rem 0.1rem;
}
.site-nav a:hover { color: var(--orange-dark); }

/* Mobile menu button — hidden on desktop */
.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}
.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
}
.menu-toggle-bars::before { position: absolute; top: -6px; }
.menu-toggle-bars::after  { position: absolute; top: 6px; }

/* ---------- 7. Hero ---------- */
.hero {
  padding-block: clamp(2.5rem, 7vw, 5.5rem);
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange-dark);
  background: rgba(196, 81, 22, 0.1);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  margin-bottom: 1rem;
}
.hero-lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 50ch; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.6rem;
}
.hero-hours { margin-top: 1rem; font-size: 0.92rem; color: var(--ink-soft); }

/* ---------- 8. Services cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.3rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem;
}
.card-icon {
  width: 40px;
  height: 40px;
  color: var(--orange);
  margin-bottom: 0.9rem;
}
.card h3 { margin-bottom: 0.4em; }
.card p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- 9. About ---------- */
.about-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.highlights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
}
.highlights li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.9rem;
  align-items: center;
}
.highlight-icon {
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  color: var(--orange);
}
.highlights h3 { margin: 0; font-size: 1.05rem; }
.highlights p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- 10. Steps ---------- */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.3rem;
}
.steps li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  margin-bottom: 0.8rem;
}
.steps h3 { margin-bottom: 0.3em; }
.steps p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- 11. Service area (navy band) ---------- */
.section-navy {
  background: var(--navy);
  color: #E6ECF2;
}
.section-navy h2 { color: #fff; }
.service-area-inner { max-width: 760px; }
.section-navy a { color: #FFC59E; font-weight: 700; }
.section-navy a:hover { color: #fff; }
.service-area-cta { margin-top: 1.4rem; font-size: 1.1rem; }

/* ---------- 12. FAQ ---------- */
.faq-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 0.9rem;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--navy);
  padding: 1rem 1.3rem;
  list-style-position: inside;
}
.faq-item summary:hover { color: var(--orange-dark); }
.faq-item[open] summary { border-bottom: 1px solid var(--line); }
.faq-item p { margin: 0; padding: 1rem 1.3rem; color: var(--ink-soft); }

/* ---------- 13. Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
  margin-top: 1.5rem;
}
.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
}
.contact-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.contact-list a { font-weight: 700; font-size: 1.1rem; }

.contact-form-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.8rem;
}
.form-demo-note {
  background: rgba(196, 81, 22, 0.08);
  border: 1px dashed var(--orange-dark);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  font-size: 0.92rem;
  color: var(--ink);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-field { margin-bottom: 1rem; }
label {
  display: block;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.3rem;
}
.req { color: var(--orange-dark); }
.optional { font-weight: 400; color: var(--ink-soft); font-size: 0.9rem; }

input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #B9B2A4;
  border-radius: calc(var(--radius) - 4px);
  padding: 0.65rem 0.8rem;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 1px;
  border-color: var(--orange-dark);
}
/* Highlight fields the user has touched that are still invalid */
input.field-invalid, select.field-invalid, textarea.field-invalid {
  border-color: #B3261E;
}

.form-privacy { font-size: 0.88rem; color: var(--ink-soft); }
.form-error {
  background: #FBEAE9;
  border: 1px solid #B3261E;
  border-radius: var(--radius);
  color: #8C1D17;
  padding: 0.7rem 1rem;
  font-weight: 600;
}
.form-result {
  margin-top: 1rem;
  background: #EEF3F8;
  border: 1px solid var(--navy-soft);
  border-radius: var(--radius);
  color: var(--navy);
  padding: 0.8rem 1rem;
  font-weight: 600;
}

/* ---------- 14. Footer ---------- */
.site-footer {
  background: var(--navy);
  color: #C9D4DF;
  padding-block: 2.8rem 1.6rem;
  /* Leave room for the mobile call bar (set via JS-free CSS below) */
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.footer-name { font-size: 1.2rem; font-weight: 800; color: #fff; margin-bottom: 0.2em; }
.footer-tagline { margin-bottom: 0.3em; }
.footer-hours { font-size: 0.92rem; margin: 0; }
.footer-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.footer-nav a { color: #E6ECF2; text-decoration: none; font-weight: 600; }
.footer-nav a:hover { color: #FFC59E; }
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 1.4rem;
  font-size: 0.88rem;
}
.footer-legal p { margin: 0; }

/* ---------- 15. Mobile call bar ---------- */
.mobile-call-bar {
  display: none; /* shown only on small screens (media query below) */
}

/* ============================================================
   16. Responsive layout
   ============================================================ */
@media (max-width: 920px) {
  .hero-inner, .about-inner { grid-template-columns: 1fr; }
  .hero-art { max-width: 420px; margin-inline: auto; }
  .card-grid, .steps { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .card-grid, .steps, .form-row { grid-template-columns: 1fr; }

  /* --- Mobile navigation --- */
  .menu-toggle { display: inline-flex; }
  .header-call { display: none; } /* the call bar below covers this */

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: block; }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
  }
  .site-nav a {
    display: block;
    padding: 0.85rem 1.5rem;
    font-size: 1.1rem;
  }

  /* --- Mobile call bar --- */
  .mobile-call-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: rgba(247, 245, 240, 0.97);
    border-top: 1px solid var(--line);
    padding: 0.55rem 0.8rem;
    /* Respect iPhone/Android safe areas so the bar isn't under the
       home indicator */
    padding-bottom: calc(0.55rem + env(safe-area-inset-bottom));
  }
  .mobile-call-bar .button { padding: 0.65rem 0.5rem; font-size: 0.98rem; }

  /* Keep page content & footer from hiding behind the fixed bar */
  body { padding-bottom: 76px; }
  /* Keep keyboard-focused elements visible above the bar when scrolled to */
  html { scroll-padding-bottom: 90px; }
}
