/* =============================================================================
   HEV Risk Index — Stylesheet
   evri-hev.css — for hev.evriskindex.com
   ============================================================================= */

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --c-bg:          #f7f5f0;
  --c-surface:     #ffffff;
  --c-border:      #e5e1d8;
  --c-text:        #1a1a1a;
  --c-text-muted:  #666666;
  --c-text-faint:  #999999;

  --c-risk-low:       #22c55e;
  --c-risk-moderate:  #eab308;
  --c-risk-high:      #f97316;
  --c-risk-critical:  #ef4444;

  --c-phev-bg:        #f0f9ff;
  --c-phev-border:    #bae6fd;
  --c-methodology-bg: #eff6ff;
  --c-methodology-border: #bfdbfe;
  --c-recall-bg:      #fffbeb;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--c-text);
  background: var(--c-bg);
  min-height: 100vh;
  line-height: 1.6;
}

a {
  color: #2554a8;
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ── Risk color helpers ───────────────────────────────────────────────────── */
.risk-low        { color: var(--c-risk-low); }
.risk-moderate   { color: var(--c-risk-moderate); }
.risk-high       { color: var(--c-risk-high); }
.risk-critical   { color: var(--c-risk-critical); }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.risk-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  transition: box-shadow 0.15s, transform 0.15s;
}
.risk-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--c-text);
}

/* ── Factor bars ────────────────────────────────────────────────────────────── */
.factor-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .875rem;
}
.factor-bar-label { flex: 0 0 180px; color: var(--c-text-muted); }
.factor-bar-track {
  flex: 1;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}
.factor-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.factor-bar-fill--low     { background: var(--c-risk-low); }
.factor-bar-fill--moderate { background: var(--c-risk-moderate); }
.factor-bar-fill--high    { background: var(--c-risk-high); }
.factor-bar-fill--critical { background: var(--c-risk-critical); }
.factor-bar-score {
  font-weight: 700;
  min-width: 3rem;
  text-align: right;
}

/* ── Recall cards ──────────────────────────────────────────────────────────── */
.recall-card {
  background: var(--c-recall-bg);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 12px;
}
.recall-card--high   { border-left: 4px solid var(--c-risk-high); }
.recall-card--standard { border-left: 4px solid var(--c-risk-moderate); }
.recall-card--low    { border-left: 4px solid var(--c-risk-low); }

/* ── Methodology badge ─────────────────────────────────────────────────────── */
.methodology-badge {
  background: var(--c-methodology-bg);
  border: 1px solid var(--c-methodology-border);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: .75rem;
  color: #1e40af;
  margin-bottom: 20px;
}
.methodology-badge strong { font-weight: 600; }
.methodology-badge a { color: #1d4ed8; font-weight: 600; }

/* ── PHEV badge ────────────────────────────────────────────────────────────── */
.powertrain-badge {
  display: inline-block;
  background: var(--c-phev-bg);
  color: #0c4a6e;
  border: 1px solid var(--c-phev-border);
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .025em;
  margin-bottom: 12px;
}

/* ── Spec block ────────────────────────────────────────────────────────────── */
.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
}
.spec-cell {
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-border);
}
.spec-cell:nth-child(odd)  { border-right: 1px solid var(--c-border); }
.spec-cell--full           { grid-column: 1 / -1; }

.spec-label {
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--c-text-faint);
  margin-bottom: 4px;
}
.spec-value {
  font-weight: 600;
  margin: 0;
}

/* ── Verdict block ─────────────────────────────────────────────────────────── */
.verdict-low {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #86efac;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 24px;
}
.verdict-moderate {
  background: linear-gradient(135deg, #fefce8, #fef9c3);
  border: 1px solid #fde047;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 24px;
}
.verdict-high {
  background: linear-gradient(135deg, #fff7ed, #fed7aa);
  border: 1px solid #fdba74;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 24px;
}
.verdict-critical {
  background: linear-gradient(135deg, #fef2f2, #fecaca);
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 24px;
}
.verdict-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 8px;
}
.verdict-low .verdict-title        { color: #166534; }
.verdict-moderate .verdict-title   { color: #854d0e; }
.verdict-high .verdict-title       { color: #9a3412; }
.verdict-critical .verdict-title   { color: #991b1b; }
.verdict-body {
  font-size: .875rem;
  margin: 0;
}
.verdict-low .verdict-body         { color: #166534; }
.verdict-moderate .verdict-body    { color: #854d0e; }
.verdict-high .verdict-body        { color: #9a3412; }
.verdict-critical .verdict-body    { color: #991b1b; }

/* ── Brand trend list ──────────────────────────────────────────────────────── */
.brand-trend {
  background: #f9fafb;
  border-radius: 6px;
  padding: 20px;
  margin-top: 24px;
}
.brand-trend-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 12px;
}
.brand-trend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #e5e7eb;
  font-size: .875rem;
}
.brand-trend-item:last-child { border-bottom: none; }

/* ── Section headings ──────────────────────────────────────────────────────── */
.section-heading {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 16px;
  border-bottom: 2px solid var(--c-text);
  padding-bottom: 8px;
}

/* ── Filter / search ────────────────────────────────────────────────────────── */
#powertrain-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.pt-btn {
  padding: 6px 14px;
  border: 1px solid var(--c-border);
  border-radius: 9999px;
  background: var(--c-surface);
  font-size: .875rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.pt-btn:hover { background: #f0ede8; }
.pt-btn.active {
  background: var(--c-text);
  color: #fff;
  border-color: var(--c-text);
}

.search-wrap {
  position: relative;
  max-width: 480px;
  margin-bottom: 8px;
}
.search-input {
  width: 100%;
  padding: 10px 40px 10px 14px;
  font-size: .9375rem;
  border: 1px solid #d8d4ca;
  border-radius: 6px;
  box-sizing: border-box;
  background: var(--c-surface);
}
.search-input:focus {
  outline: none;
  border-color: #2554a8;
  box-shadow: 0 0 0 3px rgba(37, 84, 168, 0.15);
}
.search-clear {
  display: none;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  font-size: 18px;
  color: var(--c-text-muted);
  cursor: pointer;
}

/* ── Related vehicles grid ─────────────────────────────────────────────────── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 32px;
}

/* ── Brand index grid ──────────────────────────────────────────────────────── */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

/* ── Breadcrumbs ────────────────────────────────────────────────────────────── */
.breadcrumbs {
  font-size: .875rem;
  color: var(--c-text-muted);
  padding: 16px 0;
}
.breadcrumbs a { color: var(--c-text-muted); }
.breadcrumbs a:hover { color: var(--c-text); text-decoration: none; }
.breadcrumb-sep { margin: 0 6px; }

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--c-border);
  margin-top: 48px;
  padding-top: 24px;
  font-size: .875rem;
  color: var(--c-text-muted);
}
.site-footer a { color: var(--c-text-muted); }

/* ── Band section headings ─────────────────────────────────────────────────── */
.band-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--c-border);
  padding-bottom: 8px;
}
.band-heading { font-size: 1rem; font-weight: 700; margin: 0; }
.band-range { font-weight: 400; color: var(--c-text-muted); font-size: .875rem; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .spec-grid { grid-template-columns: 1fr; }
  .spec-cell:nth-child(odd) { border-right: none; }
  .factor-bar-label { flex: 0 0 140px; }
  .related-grid { grid-template-columns: 1fr; }
  .brand-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Print ─────────────────────────────────────────────────────────────────── */
@media print {
  body { background: white; }
  .methodology-badge { border: 1px solid #ccc; }
}