/* =========================================================
   THEME VARIABLES (Paired Foreground/Background)
   ========================================================= */
:root {
  /* Surfaces */
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #eef3f9;

  /* Text */
  --text: #1f2937;
  --muted: #5b6b80;
  --border: rgba(31,41,55,.12);

  /* Brand pair */
  --brand-bg: #2563eb;
  --brand-text: #ffffff;

  /* Nav CTA warm accent (text on brand bg) */
  --nav-cta-text: #fb923c;

  /* Active interactive surface */
  --control-active-bg: #1e40af;   /* darker than section bg */
  --control-active-text: #ffffff;

  /* Primary CTA pair */
  --cta-bg: #16a34a;
  --cta-text: #ffffff;

  /* Utility */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 28px rgba(31,41,55,.12);

  /* Layout */
  --max: 1120px;
  --pad: clamp(16px, 3vw, 28px);

  /* Typography */
  --h1: clamp(2.1rem, 3.2vw, 3.1rem);
  --h2: clamp(1.4rem, 2.2vw, 2rem);
  --h3: 1.15rem;
  --lead: 1.05rem;
  --body: 1rem;
  --line: 1.55;
}

/* =========================================================
   BASE
   ========================================================= */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font: 400 var(--body)/var(--line)
        system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--brand-bg); text-decoration: none; }
a:hover { text-decoration: underline; }

p { margin: 0 0 1rem; }

h1, h2, h3 {
  margin: 0 0 .6rem;
  line-height: 1.15;
}

h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }

.muted { color: var(--muted); }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* Accessibility */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: .75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 1000;
}

/* =========================================================
   BUTTONS (paired)
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .85rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn--primary {
  background: var(--cta-bg);
  color: var(--cta-text);
  border-color: transparent;
}

.btn--ghost {
  background: rgba(37,99,235,.05);
}

.btn--block { width: 100%; }

/* =========================================================
   HEADER / NAV
   ========================================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(6px);
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(31,41,55,.18);
}

.header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .9rem 0;
  gap: 1rem;
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand__name {
  font-weight: 800;
  letter-spacing: .02em;
}

.brand__tag {
  font-size: .9rem;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: .8rem;
  align-items: center;
}

.nav a {
  padding: .55rem .65rem;
  border-radius: 10px;
  font-weight: 600;
  color: #0f172a;
}

.nav a:hover {
  background: #e6efff;
  color: #0f172a;
  text-decoration: none;
}

.nav a[aria-current="page"] {
  background: var(--brand-bg);
  color: var(--brand-text);
}

/* CTA (paired) */
.nav a.nav__cta {
  padding: .55rem .9rem;
  border-radius: 999px;
  background: var(--brand-bg);
  color: var(--nav-cta-text);
}

/* Mobile toggle (IMPORTANT: hide the checkbox) */
.nav-toggle { display: none; }

.nav-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-button span {
  width: 18px;
  height: 2px;
  background: var(--text);
  display: block;
  margin: 3px 0;
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 2rem;
}

.hero--bg {
  background:
    linear-gradient(
      to bottom,
      rgba(0,0,0,.55),
      rgba(0,0,0,.35) 40%,
      rgba(0,0,0,.15) 70%,
      rgba(0,0,0,0)
    ),
    var(--hero-image) center / cover no-repeat;
  color: #ffffff;
}

/* keep hero text readable */
.hero--bg h1,
.hero--bg p,
.hero--bg a { color: #ffffff; }

.hero--bg .lead { color: rgba(255,255,255,.9); }

/* IMPORTANT: ensure card text is visible */
.hero--bg .card { color: var(--text); }

.lead {
  font-size: var(--lead);
  max-width: 60ch;
  color: var(--muted);
}

.hero__actions {
  display: flex;
  gap: .75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* =========================================================
   CARD
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}

.card__row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: .8rem;
  padding: .6rem 0;
  border-bottom: 1px dashed var(--border);
}

.card__row:last-child { border-bottom: none; }

/* =========================================================
   SMOG REQUIREMENTS EXPLAINER (FIXED ACTIVE COLORS)
   ========================================================= */

.explainer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.6fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
  align-items: stretch;
}

/* LEFT: BUTTONS */
.explainer__nav {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.explainer__btn {
  appearance: none;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

/* Active = use your paired control variables (same idea as nav active) */
.explainer__btn.is-active {
  background: var(--control-active-bg);
  color: var(--control-active-text);
  border-color: transparent;
}

/* Hover (inactive only) */
.explainer__btn:hover:not(.is-active) {
  background: rgba(37,99,235,.08);
}

/* CENTER: IMAGE */
.explainer__image {
  display: flex;
}

.explainer__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

/* RIGHT: CONTENT */
.explainer__panel { display: none; }
.explainer__panel.is-active { display: block; }

/* CHECKLIST */
.checklist {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.checklist li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: .45rem;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--cta);
  font-weight: 700;
}

/* RESPONSIVE */
@media (max-width: 980px) {
  .explainer { grid-template-columns: 1fr; }
  .explainer__image img { height: 220px; }
}


/* =========================================================
   END SMOG REQUIREMENTS EXPLAINER
   ========================================================= */
.smog-includes__image {
  width: 100%;
  max-width: 360px;
  height: auto;
}


/* =========================================================
   SECTIONS
   ========================================================= */
.section {
  padding: clamp(2.2rem, 4.5vw, 3.6rem) 0;
}

.section--alt {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0; /* image should reach the edges */
}

.section--alt .section__panel {
  padding: 3rem 0;
}

.section__head { margin-bottom: 1.2rem; }

/* =========================================================
   SPLIT / DENSITY
   ========================================================= */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.7fr);
  gap: 1.6rem;
  align-items: stretch;
}

/* IMPORTANT: keep the review image from blowing up */
.split > img {
  width: 100%;
  height: auto;
  display: block;
}

/* ALT section special: image fills full section height */
.section--alt .wrap.split > img {
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  margin: 0;
}

/* =========================================================
   SERVICE TILES
   ========================================================= */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
}

.tile__links a {
  display: inline-block;
  margin-top: .4rem;
  font-weight: 600;
}

/* =========================================================
   QUOTES
   ========================================================= */
.quotes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.quote {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

/* =========================================================
   MAP
   ========================================================= */
.map-placeholder {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #e9eef6;
  min-height: 260px;
  overflow: hidden;
}

/* Make iframe behave */
.map-placeholder iframe {
  width: 100%;
  height: 100%;
  min-height: 260px;
  border: 0;
  display: block;
}

/* =========================================================
   FINAL CTA
   ========================================================= */
.final-cta {
  padding: 2rem 0;
}

.final-cta__inner {
  background: linear-gradient(135deg, rgba(22,163,74,.12), rgba(37,99,235,.10));
  border-radius: var(--radius);
  border: 1px solid rgba(22,163,74,.35);
  padding: 1.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem 0 1.2rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 1.2rem;
}

.footer__head {
  font-weight: 700;
  color: var(--muted);
  margin-bottom: .6rem;
}

.footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer__links li { margin-bottom: .4rem; }

.footer__bar {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 980px) {
  .hero__grid,
  .tiles,
  .quotes,
  .split,
  .footer__grid {
    grid-template-columns: 1fr;
  }

  .section--alt .section__panel {
    padding: 2rem 0;
  }

  /* On mobile, don't force full-height image behavior */
  .section--alt .wrap.split > img {
    height: auto;
  }
}

@media (max-width: 860px) {
  .nav-button { display: flex; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    display: none;
    padding: .8rem var(--pad);
    border-bottom: 1px solid var(--border);
  }

  .nav-toggle:checked ~ .nav { display: flex; }
}
