/* Renters EV Grant Guide — base styles, mobile-first, system fonts for zero CWV penalty */

* { box-sizing: border-box; }

:root {
  --primary: #0a5d3a;
  --primary-dark: #064024;
  --primary-light: #0e7a4c;
  --accent: #f5b800;
  --text: #1a1a1a;
  --text-muted: #555;
  --bg: #ffffff;
  --bg-alt: #f5f7f5;
  --border: #e2e7e3;
  --link: #0a5d3a;
  --link-hover: #064024;
  --max-width: 1100px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }

h1, h2, h3, h4 { line-height: 1.25; color: var(--text); margin-top: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0.4em 0 0.6em; }
h2 { font-size: clamp(1.45rem, 3vw, 1.85rem); margin: 1.6em 0 0.8em; padding-bottom: 0.3em; border-bottom: 2px solid var(--border); }
h3 { font-size: 1.2rem; margin: 1.6em 0 0.5em; color: var(--primary-dark); }
h4 { font-size: 1.05rem; margin: 1.2em 0 0.4em; }

p, li { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }

/* Skip link for keyboard accessibility */
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--primary); color: #fff;
  padding: 8px 12px; text-decoration: none;
  z-index: 100; transition: top 0.1s;
}
.skip-link:focus { top: 0; color: #fff; }

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; padding-bottom: 14px;
}
.logo { font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--primary-dark); }
.site-header nav ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 22px; flex-wrap: wrap; }
.site-header nav a { font-size: 0.95rem; text-decoration: none; color: var(--text-muted); }
.site-header nav a:hover { color: var(--primary); }

@media (max-width: 720px) {
  .site-header nav { display: none; }
}

/* Hero */
.hero {
  background: linear-gradient(180deg, #f0f7f3 0%, #fafcfb 100%);
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
}
.kicker {
  display: inline-block;
  background: rgba(10, 93, 58, 0.08);
  color: var(--primary-dark);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: 0 0 18px; }
.hero .lead { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 26px; max-width: 720px; }
.hero .lead strong { color: var(--text); }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; }
.micro-note { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.05s, box-shadow 0.15s, background 0.15s;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary {
  background: transparent;
  color: var(--primary-dark);
  border-color: var(--primary);
}
.btn-secondary:hover { background: var(--primary); color: #fff; }

/* Key facts grid */
.key-facts {
  background: var(--primary-dark);
  color: #fff;
  padding: 36px 0;
}
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.fact { text-align: center; }
.fact-num { display: block; font-size: 2rem; font-weight: 700; color: #fff; margin-bottom: 6px; }
.fact-label { display: block; font-size: 0.92rem; color: rgba(255,255,255,0.85); }

/* Eligibility checker */
.eligibility-checker {
  padding: 56px 0;
  background: var(--bg-alt);
}
.checker-app {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  max-width: 720px;
  margin-top: 24px;
}
.checker-step h3 { margin-top: 0; }
.checker-options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
  font-family: inherit;
  color: var(--text);
}
.opt:hover { border-color: var(--primary); background: rgba(10, 93, 58, 0.04); }
.opt:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.checker-result {
  background: var(--bg);
  border-left: 4px solid var(--primary);
  padding: 24px 28px;
  border-radius: 4px;
}
.checker-result h3 { margin-top: 0; color: var(--primary-dark); }
.checker-result.eligible h3::before { content: "✓ "; color: var(--primary); }
.checker-result.ineligible { border-left-color: #c33; }
.checker-result.ineligible h3 { color: #c33; }
.checker-result.ineligible h3::before { content: "✗ "; }
#result-actions { padding-left: 1.2em; }

/* Content sections */
.content-section { padding: 56px 0; }
.content-section.alt { background: var(--bg-alt); }

/* Tables */
.schemes-table, .cost-table {
  overflow-x: auto;
  margin: 24px 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
thead { background: var(--primary); color: #fff; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
.cost-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* HowTo steps */
.howto-steps {
  list-style: none;
  padding: 0;
  counter-reset: howto;
}
.howto-steps > li {
  counter-increment: howto;
  margin: 28px 0;
  padding: 24px 26px 22px 70px;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}
.howto-steps > li::before {
  content: counter(howto);
  position: absolute;
  left: 22px; top: 24px;
  width: 36px; height: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
}
.howto-steps h3 { margin-top: 0; color: var(--primary-dark); }

.callout {
  background: rgba(10, 93, 58, 0.06);
  border-left: 4px solid var(--primary);
  padding: 18px 22px;
  border-radius: 4px;
  font-style: italic;
  margin: 30px 0;
}

/* Charger grid */
.charger-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.charger-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.charger-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.charger-card h3 { margin-top: 0; color: var(--primary-dark); font-size: 1.1rem; }
.charger-card .meta { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 10px; }

/* Permission letter */
.permission-letter pre {
  background: var(--bg);
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Issues */
.issue {
  background: var(--bg);
  border-left: 3px solid var(--accent);
  padding: 18px 22px;
  margin: 18px 0;
  border-radius: 4px;
  box-shadow: var(--shadow);
}
.issue h3 { margin-top: 0; color: var(--text); font-size: 1.05rem; }
.issue p { margin-bottom: 0; }

/* FAQ accordion (uses native <details>) */
.faq-list details {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  padding: 0;
}
.faq-list summary {
  cursor: pointer;
  padding: 16px 22px;
  font-weight: 600;
  font-size: 1.02rem;
  list-style: none;
  position: relative;
  padding-right: 50px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 22px; top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--primary);
  font-weight: 400;
}
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p {
  padding: 0 22px 18px;
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
}

/* CTA section at bottom */
.cta-section {
  background: var(--primary-dark);
  color: #fff;
  text-align: center;
}
.cta-section h2 { color: #fff; border-bottom-color: rgba(255,255,255,0.2); }
.cta-section p { color: rgba(255,255,255,0.9); max-width: 640px; margin: 0 auto 24px; }
.cta-section .btn-primary { background: var(--accent); color: var(--text); border-color: var(--accent); }
.cta-section .btn-primary:hover { background: #d99e00; color: var(--text); }

/* Footer */
.site-footer {
  background: #0a1f15;
  color: rgba(255,255,255,0.85);
  padding: 50px 0 30px;
  font-size: 0.95rem;
}
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.site-footer a { color: rgba(255,255,255,0.85); }
.site-footer a:hover { color: #fff; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.footer-fineprint {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 22px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin: 0;
}

/* Responsive table fallback */
@media (max-width: 600px) {
  table { font-size: 0.92rem; }
  th, td { padding: 10px 12px; }
}
