/* Metro Detroit small-engine repair directory */
:root {
  --bg: #f4f1ea;
  --paper: #fffdf8;
  --ink: #1b1a17;
  --muted: #5a564e;
  --line: #d8d2c6;
  --accent: #1e5a3c;
  --accent-dark: #0f3b26;
  --accent-soft: #e6f0ea;
  --link: #14548c;
  --link-visited: #4a3d7a;
  --warn-bg: #fff6e5;
  --warn-line: #b36b10;
  --shadow: 0 1px 2px rgba(27, 26, 23, 0.05), 0 8px 24px rgba(27, 26, 23, 0.04);
  --radius: 14px;
  --max: 72rem;
  --text: 42rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 17px; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
}

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

a { color: var(--link); }
a:visited { color: var(--link-visited); }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--accent);
  color: #fff;
  padding: 0.4rem 0.7rem;
  z-index: 20;
  border-radius: 6px;
}
.skip-link:focus { top: 0.75rem; color: #fff; }

.site-header {
  background: var(--accent-dark);
  color: #f4f1ea;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.7rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1.25rem;
}

.site-mark {
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.01em;
  line-height: 1.25;
  max-width: 14rem;
}
.site-mark:visited { color: #fff; }
.site-mark:hover { text-decoration: underline; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.15rem;
}

.site-nav a {
  color: #efe8d8;
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-size: 0.95rem;
}
.site-nav a:visited { color: #efe8d8; }
.site-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.site-nav a[aria-current="page"] {
  background: #fff;
  color: var(--accent-dark);
  font-weight: 650;
}
.site-nav a[aria-current="page"]:visited { color: var(--accent-dark); }

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.1rem 3rem;
}

.page > h1,
.page > .eyebrow,
.page > .lead,
.page > p,
.page > ul,
.page > ol,
.page > blockquote,
.page > h2,
.page > h3,
.page > pre {
  max-width: var(--text);
}

h1, h2, h3, h4 {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  line-height: 1.2;
  font-weight: 650;
  color: var(--accent-dark);
}

h1 { font-size: clamp(1.7rem, 3.4vw, 2.35rem); margin: 0.2rem 0 0.8rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 0.7rem; }
h3 { font-size: 1.12rem; margin: 1.4rem 0 0.5rem; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.35rem;
}

.lead { font-size: 1.08rem; color: var(--ink); }

.county-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  margin: 1.5rem 0 2rem;
  max-width: none;
}

.county-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem 1.15rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  display: block;
}
.county-card:visited { color: inherit; }
.county-card:hover { border-color: var(--accent); }
.county-card h2 { margin: 0 0 0.35rem; font-size: 1.25rem; }
.county-card .cities { margin: 0; color: var(--muted); font-size: 0.95rem; }
.county-card .count {
  margin: 0.7rem 0 0;
  font-weight: 700;
  color: var(--accent);
}

.shop-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  margin-top: 1.25rem;
}

.shop-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.15rem 1rem;
  box-shadow: var(--shadow);
}

.shop-name { margin: 0 0 0.2rem; font-size: 1.28rem; color: var(--ink); }
.shop-meta { margin: 0 0 0.7rem; color: var(--muted); }

.rating { margin: 0 0 0.15rem; font-size: 1.05rem; }
.rating strong { font-size: 1.25rem; color: var(--accent-dark); }
.rating.unrated strong, .rating.unrated { color: var(--muted); font-size: 1rem; }
.out-of, .review-count { font-weight: 600; }
.rating-source { margin: 0 0 0.8rem; color: var(--muted); font-size: 0.92rem; }

.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.95rem; }

.btn {
  display: inline-block;
  text-decoration: none;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.95rem;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:visited { color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-color: #c3d9cc;
}
.btn-secondary:visited { color: var(--accent-dark); }

.fields { margin: 0; }
.field {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
}
.field dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}
.field dd { margin: 0; }

.caveat {
  margin-top: 0.85rem;
  background: var(--warn-bg);
  border-left: 4px solid var(--warn-line);
  border-radius: 0 10px 10px 0;
  padding: 0.7rem 0.85rem;
  font-size: 0.95rem;
}
.caveat p { margin: 0 0 0.4rem; max-width: none; }
.caveat p:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 0.5rem 0 0.75rem; max-width: none; }
.shop-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.97rem;
}
.shop-table th, .shop-table td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.shop-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: #f3efe6;
}
.shop-table tr:last-child td { border-bottom: 0; }
.table-note { color: var(--muted); font-size: 0.95rem; }

.page ul, .page ol { padding-left: 1.2rem; }
.page li { margin: 0.3rem 0; }
.page pre {
  background: #1b1a17;
  color: #f4f1ea;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.9rem;
}
.page code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}
.page pre code { font-size: 0.9rem; }
.page blockquote {
  margin: 1rem 0;
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 4px solid var(--accent);
  color: var(--muted);
}

.site-footer {
  background: #efe8d8;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.4rem 1.1rem 2rem;
}
.site-footer p { margin: 0 0 0.5rem; max-width: var(--text); }
.footer-nav { margin-top: 0.8rem !important; }

@media (min-width: 700px) {
  .county-grid { grid-template-columns: 1fr 1fr; }
  .header-inner { padding: 0.8rem 1.5rem; }
  .site-mark { max-width: none; }
  .page { padding: 2rem 1.5rem 3.5rem; }
  .shop-card { padding: 1.3rem 1.35rem 1.1rem; }
}

@media (min-width: 980px) {
  .shop-list { grid-template-columns: 1fr 1fr; }
  html { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
