/* SmogShops — California Smog Check Directory */
:root {
  --ink: #182420;
  --muted: #5b6b64;
  --bg: #f5f7f6;
  --card: #ffffff;
  --line: #dde5e1;
  --brand: #1e7a4f;
  --brand-dark: #175e3d;
  --brand-soft: #e7f3ed;
  --sky: #2277a8;
  --star: #9a6d00;
  --star-bg: #fdf3d7;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(24, 36, 32, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1100;
}
.site-header .wrap {
  display: flex; align-items: center; gap: 18px;
  height: 62px;
}
.logo {
  font-weight: 800; font-size: 1.15rem; text-decoration: none;
  color: var(--ink); letter-spacing: -0.02em; white-space: nowrap;
}
.logo .dot { color: var(--brand); }
.site-nav { margin-left: auto; display: flex; gap: 4px; }
.site-nav a {
  text-decoration: none; color: var(--muted); font-size: 0.92rem;
  padding: 8px 12px; border-radius: 8px; font-weight: 600;
}
.site-nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }

/* Hero */
.hero {
  background: linear-gradient(170deg, #123527 0%, #1e5a3d 60%, #27714d 100%);
  color: #fff; padding: 64px 0 72px;
}
.hero h1 { font-size: clamp(1.7rem, 4.2vw, 2.7rem); margin: 0 0 10px; letter-spacing: -0.02em; }
.hero p.lede { font-size: 1.08rem; opacity: 0.88; max-width: 620px; margin: 0 0 28px; }

/* Search box */
.searchbox { display: flex; gap: 10px; max-width: 620px; }
.searchbox .field { position: relative; flex: 1; }
.searchbox input {
  width: 100%; padding: 15px 16px; font-size: 1.05rem;
  border: 2px solid transparent; border-radius: var(--radius);
  outline: none;
}
.searchbox input:focus { border-color: var(--brand); }
.searchbox button {
  padding: 0 26px; font-size: 1rem; font-weight: 700; cursor: pointer;
  background: var(--brand); color: #fff; border: 0; border-radius: var(--radius);
}
.searchbox button:hover { background: var(--brand-dark); }
.geo-link {
  display: inline-block; margin-top: 14px;
  color: #cfe6da; font-size: 0.92rem; cursor: pointer; text-decoration: underline;
  background: none; border: 0; padding: 0; font-family: inherit;
}
.geo-link:hover { color: #fff; }

/* Autocomplete */
.ac-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(24,36,32,0.14); z-index: 1200;
  max-height: 300px; overflow-y: auto; text-align: left;
}
.ac-list div { padding: 10px 14px; cursor: pointer; color: var(--ink); font-size: 0.98rem; }
.ac-list div:hover, .ac-list div.active { background: var(--brand-soft); }
.ac-list .ac-meta { color: var(--muted); font-size: 0.85rem; margin-left: 6px; }

/* Sections */
section.block { padding: 44px 0; }
section.block h2 { font-size: 1.45rem; letter-spacing: -0.01em; margin: 0 0 18px; }
.stats-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: -34px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 22px; flex: 1; min-width: 150px;
}
.stat b { display: block; font-size: 1.5rem; color: var(--brand-dark); }
.stat span { color: var(--muted); font-size: 0.88rem; }

/* City grid */
.city-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.city-grid a {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; text-decoration: none; color: var(--ink); font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem;
}
.city-grid a:hover { border-color: var(--brand); color: var(--brand-dark); }
.city-grid .count { color: var(--muted); font-weight: 400; font-size: 0.85rem; }

/* Cards / listings */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 14px;
}
.station-card h3 { margin: 0 0 2px; font-size: 1.12rem; }
.station-card h3 a { text-decoration: none; color: var(--ink); }
.station-card h3 a:hover { color: var(--brand-dark); text-decoration: underline; }
.station-card .addr { color: var(--muted); font-size: 0.94rem; margin: 2px 0; }
.station-card .phone { font-size: 0.94rem; }
.station-card .dist { float: right; color: var(--sky); font-weight: 700; font-size: 0.9rem; }

/* Badges */
.badges { margin: 8px 0 2px; display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px; background: var(--brand-soft); color: var(--brand-dark);
}
.badge.star { background: var(--star-bg); color: var(--star); }
.badge.repair { background: #e8eff7; color: #23608a; }

/* Buttons */
.btn {
  display: inline-block; padding: 9px 16px; border-radius: 8px; font-weight: 700;
  font-size: 0.92rem; text-decoration: none; cursor: pointer; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-family: inherit;
}
.btn:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }

/* Station detail */
.station-head h1 { margin: 0 0 6px; font-size: clamp(1.4rem, 3.4vw, 2rem); letter-spacing: -0.02em; }
.station-meta { color: var(--muted); }
.station-meta a { color: var(--ink); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } }

.kv { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.kv td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.kv td:first-child { color: var(--muted); width: 34%; padding-right: 12px; }

/* Map */
.map { height: 340px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 1; }
.map.tall { height: 460px; }

/* Results layout */
.results-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; align-items: start; }
@media (max-width: 860px) {
  .results-layout { grid-template-columns: 1fr; }
  .results-layout .map-pane { order: -1; }
}
.map-pane { position: sticky; top: 78px; }
.results-tools {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px;
}
.results-tools select {
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 0.92rem;
  background: var(--card); font-family: inherit;
}
.results-count { color: var(--muted); font-size: 0.94rem; }

/* Prose / SEO content */
.prose { max-width: 760px; }
.prose h2 { margin-top: 34px; }
.prose h3 { margin-top: 24px; font-size: 1.08rem; }
.prose p, .prose li { color: #33413b; }
details.faq {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 10px;
}
details.faq summary { font-weight: 700; cursor: pointer; }
details.faq p { margin: 10px 0 2px; }

/* Ad slots (placeholders until AdSense approval) */
.ad-slot { margin: 26px auto; text-align: center; }
.ad-slot .ad-label { font-size: 0.7rem; color: #a8b3ae; text-transform: uppercase; letter-spacing: 0.08em; }

/* Breadcrumbs */
.crumbs { font-size: 0.86rem; color: var(--muted); margin: 18px 0 6px; }
.crumbs a { color: var(--muted); }

/* Footer */
.site-footer {
  margin-top: 50px; background: #14231c; color: #b9c8c0; padding: 40px 0 30px; font-size: 0.9rem;
}
.site-footer a { color: #dce8e1; }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 40px; margin-bottom: 22px; }
.site-footer .disclaimer { font-size: 0.8rem; color: #7e8f87; max-width: 720px; line-height: 1.6; }

/* Toast */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 8px;
  font-size: 0.92rem; opacity: 0; transition: all 0.25s ease; z-index: 2000; pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 620px) {
  .site-nav a:not(.nav-keep) { display: none; }
  .searchbox { flex-direction: column; }
  .searchbox button { padding: 13px; }
  .hero { padding: 44px 0 58px; }
}
