/* ---------
   Base
   --------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827;
  background: #f3f4f6;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------
   Header / Nav
   --------- */

.site-header {
  background: #0f172a;
  color: #e5e7eb;
  border-bottom: 1px solid #111827;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.brand-link:hover .brand-icon {
  transform: scale(1.05);
  filter: drop-shadow(0 0 3px rgba(37, 99, 235, 0.5));
}

.site-title {
  margin: 0;
  font-size: 1.2rem;
  color: #f9fafb;
}

.site-subtitle {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: #9ca3af;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.9rem;
  align-items: center;
}

.nav-links a {
  color: #e5e7eb;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover {
  background: #1f2937;
}

.nav-links .nav-active {
  background: #2563eb;
  color: #f9fafb;
}

/* Dropdown for calculators */

/* -------------------- */
/* NAV DROPDOWN (FIXED) */
/* -------------------- */

.nav-dropdown {
  position: relative;
  display: inline-block;
  z-index: 50;
}

.nav-dropbtn {
  all: unset;
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: 6px 10px;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  display: none;
  flex-direction: column;
  padding: 8px;
  margin-top: 6px;

  z-index: 9999; /* VERY important */
}

/* Invisible hover bridge so it never disconnects */
.nav-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 12px;
}

/* Show dropdown on hover */
.nav-dropdown:hover .nav-dropdown-menu {
  display: flex;
}

/* Dropdown links */
.nav-dropdown-menu a {
  padding: 8px 10px;
  border-radius: 6px;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-dropdown-menu a:hover {
  background: #1e293b;
}

.nav-dropdown-active {
  background: #1e293b;
}

/* ---------
   Layout
   --------- */

.site-main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

/* Hero */

.hero {
  background: #ffffff;
  border-radius: 16px;
  padding: 22px 20px 24px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  margin-bottom: 22px;
}

.hero-text h2 {
  margin: 0 0 10px;
  font-size: 1.6rem;
}

.hero-text p {
  margin: 0 0 8px;
  color: #4b5563;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 6px;
}

.hero-note {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Cards */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.info-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 16px 16px 18px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.10);
}

.info-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.info-card p {
  margin: 0 0 6px;
  font-size: 0.9rem;
  color: #4b5563;
}

.card-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.9rem;
  color: #2563eb;
  text-decoration: none;
}

.card-link:hover {
  text-decoration: underline;
}

/* ---------
   Buttons
   --------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: #2563eb;
  color: #f9fafb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-ghost {
  background: transparent;
  color: #2563eb;
  border: 1px solid #2563eb;
}

.btn-ghost:hover {
  background: rgba(37, 99, 235, 0.08);
}

.full-width {
  width: 100%;
}

/* ---------
   Calculator page
   --------- */

.calculator-main {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.calculator-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px 18px 24px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

.calculator-card h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.lead {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: #4b5563;
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.form-group input,
.form-group select {
  border-radius: 10px;
  border: 1px solid #d1d5db;
  padding: 8px 10px;
  font-size: 0.9rem;
  outline: none;
  background: #f9fafb;
}

.form-group input:focus,
.form-group select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
  background: #ffffff;
}

.field-note {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: #6b7280;
}

.result-box {
  border-radius: 10px;
  padding: 9px 11px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-weight: 600;
  font-size: 1rem;
  color: #1d4ed8;
}

.info-panel {
  margin-top: 18px;
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
}

.info-panel h3 {
  margin: 8px 0 4px;
  font-size: 1rem;
}

.info-panel ul {
  margin: 4px 0 10px 18px;
  padding: 0;
  font-size: 0.9rem;
  color: #4b5563;
}

.info-panel li {
  margin-bottom: 4px;
}

.inline-link {
  color: #2563eb;
  text-decoration: none;
}

.inline-link:hover {
  text-decoration: underline;
}

.warning-text {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #7f1d1d;
  background: #fef2f2;
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid #fecaca;
}

/* ---------
   Footer
   --------- */

.site-footer {
  margin-top: auto;
  padding: 10px 16px 14px;
  text-align: center;
  font-size: 0.8rem;
  color: #6b7280;
}

/* ---------
   ULEZ car check page
   --------- */

.car-check-form {
  margin: 10px 0 12px;
}

.reg-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.reg-input-row input {
  flex: 1;
}

#regStatus.muted {
  color: #6b7280;
}

.error-text {
  color: #b91c1c;
}

.car-results {
  margin-top: 16px;
}

.car-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.info-card.compact {
  padding: 14px 14px 16px;
}

.vehicle-title {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 0.95rem;
}

.vehicle-details {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px 18px;
  font-size: 0.83rem;
}

.vehicle-details div {
  display: flex;
  flex-direction: column;
}

.vehicle-details dt {
  font-weight: 600;
  color: #4b5563;
}

.vehicle-details dd {
  margin: 0;
  color: #111827;
}

/* ULEZ badge */

.ulez-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 4px 0 6px;
}

.ulez-ok {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.ulez-not-ok {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.ulez-summary {
  font-size: 0.85rem;
  color: #374151;
}

.ulez-warning {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #facc15;
}

/* Emissions comparison */

.emissions-card {
  margin-top: 10px;
  background: #f9fafb;
  border-radius: 14px;
  padding: 12px 12px 14px;
  border: 1px solid #e5e7eb;
}

.emissions-chart {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.emissions-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.emissions-label {
  width: 90px;
  flex-shrink: 0;
  font-size: 0.8rem;
  color: #4b5563;
}

.emissions-bar-container {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.emissions-bar {
  height: 100%;
  border-radius: 999px;
}

.emissions-bar.bar-yours {
  background: #2563eb;
}

.emissions-bar.bar-average {
  background: #9ca3af;
}

.emissions-bar.bar-older {
  background: #b91c1c;
}

.emissions-value {
  width: 60px;
  text-align: right;
  font-size: 0.8rem;
  color: #374151;
}

/* ---------
   Responsive tweaks
   --------- */

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
  }

  .hero {
    padding: 18px 16px 20px;
  }

  .site-main {
    padding: 16px;
  }

  .calculator-main {
    padding: 16px;
  }
}
.guide-image {
  width: 100%;
  max-width: 1000px;
  height: auto;
  border-radius: 14px;
  margin: 24px auto;
  display: block;
  box-shadow: 0 14px 30px rgba(0,0,0,0.25);
}

/* -------- GUIDE TEXT IMPROVEMENTS -------- */

.guide-body p,
.guide-body li {
  font-size: 1.05rem;
  line-height: 1.7;
}

.guide-body .info-panel {
  margin-top: 26px;
}

/* -------- SMALLER GUIDE IMAGES -------- */

.guide-image {
  width: 100%;
  max-width: 720px;   /* smaller than before */
  height: auto;
  border-radius: 12px;
  margin: 18px auto 24px;
  display: block;
  box-shadow: 0 10px 22px rgba(0,0,0,0.22);
}

/* -------- GUIDE BUTTON LINKS -------- */

.guide-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
}

.guide-btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  background: #0f172a;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.95rem;
  border: 1px solid #1e293b;
  transition: background 0.2s ease, transform 0.15s ease;
}

.guide-btn:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

/* -------- GUIDES INDEX GRID & CARDS -------- */

.guides-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

/* wider screens: two columns */
@media (min-width: 800px) {
  .guides-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.guide-card {
  display: block;
  text-decoration: none;
  color: #0f172a;                 /* DARK TEXT */
  border-radius: 18px;
  border: 1px solid #cbd5e1;     /* LIGHT BORDER */
  background: #f8fafc;          /* VERY LIGHT CARD */
  box-shadow: 0 10px 22px rgba(0,0,0,0.15);
  transition: 
    transform 0.15s ease, 
    box-shadow 0.15s ease, 
    border-color 0.15s ease, 
    background 0.15s ease;
}

.guide-card-inner {
  padding: 16px 16px 18px;
}

.guide-card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
  color: #020617;   /* VERY DARK TITLE */
}

.guide-card p {
  font-size: 1rem;
  margin-top: 10px;
  color: #334155;   /* DARK GREY BODY TEXT */
}

.guide-card-image {
  width: 100%;
  max-height: 190px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.guide-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.25);
  border-color: #38bdf8;
  background: #f1f5f9;   /* SLIGHTLY DARKER ON HOVER */
}

/* Cookie Consent Banner */

.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 900px;
  width: calc(100% - 30px);
  background: #020617;
  color: #e5e7eb;
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.5);
  display: none;
  z-index: 99999;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.cookie-banner p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  flex: 1 1 300px;
}

.cookie-banner a {
  color: #38bdf8;
  text-decoration: none;
}

.cookie-banner a:hover {
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  gap: 8px;
}

.cookie-buttons button {
  background: #38bdf8;
  color: #020617;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
}

.cookie-buttons button:last-child {
  background: #334155;
  color: #e5e7eb;
}

.cookie-buttons button:hover {
  opacity: 0.9;
}

/* ========================= */
/* Cookie Consent Overlay    */
/* ========================= */

.cookie-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.86); /* dark overlay */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none; /* shown via JS */
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 99999;
}

.cookie-modal {
  max-width: 520px;
  width: 100%;
  background: #020617;
  color: #e5e7eb;
  border-radius: 18px;
  padding: 20px 22px 18px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.75);
  border: 1px solid #1e293b;
}

.cookie-modal h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.cookie-modal p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.cookie-modal a {
  color: #38bdf8;
  text-decoration: underline;
}

.cookie-modal-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cookie-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease, opacity 0.12s ease;
}

.cookie-btn-primary {
  background: #22c55e;
  color: #022c22;
  box-shadow: 0 8px 18px rgba(34, 197, 94, 0.4);
}

.cookie-btn-secondary {
  background: #111827;
  color: #e5e7eb;
  border: 1px solid #334155;
}

.cookie-btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.cookie-secondary-text {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* Compact related guides under CO2 chart */
.emissions-card .related-guides {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.related-guide-card {
  flex: 1 1 230px;
  max-width: 260px;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: #f7f9fc;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  text-decoration: none;
  color: inherit;
  font-size: 0.9rem;
}

.related-guide-card:hover {
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
  transform: translateY(-1px);
}

.related-guide-image {
  width: 64px;
  height: 64px;
  border-radius: 0.5rem;
  object-fit: cover;
  flex-shrink: 0;
}

.related-guide-text h4 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.related-guide-text p {
  margin: 0;
  font-size: 0.8rem;
  color: #4b5563;
}
