/* ============================================================
   FuelPrice Live — main stylesheet
   "Quiet premium" theme: calm neutral light base + one
   confident fuel-amber accent, used sparingly for primary
   actions and key highlights only. Vanilla CSS, mobile-first,
   no external dependencies.
   ============================================================ */
:root {
  --bg: #fbfbfd;                 /* calm neutral light base */
  --bg-soft: #f5f5f7;            /* soft gray surface */
  --surface: #ffffff;            /* card surface */
  --surface-2: #f5f5f7;          /* recessed surface */
  --line: #e8e8ec;               /* hairlines */
  --line-strong: #d2d2d7;
  --ink: #1d1d1f;                /* primary text */
  --body: #515154;               /* body text */
  --muted: #86868b;              /* secondary text */
  --accent: #ffb224;             /* the one accent: fuel amber (actions, brand) */
  --accent-strong: #b45309;      /* readable amber text on light surfaces */
  --accent-ink: #2b1a02;
  --accent-soft: rgba(255, 178, 36, 0.10);
  --up: #c0362c;                 /* price rising (semantic) */
  --down: #1e7e5e;               /* price falling (semantic) */
  --flat: #86868b;
  --cheap: #1e7e5e;
  --dear: #c0362c;
  --tint-cheap: #e7f4ec;         /* pastel: cheapest tile only */
  --tint-dear: #fceae8;          /* pastel: most-expensive tile only */
  --radius: 20px;
  --radius-lg: 24px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 18px 44px -12px rgba(0, 0, 0, 0.09);
  --font: -apple-system, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: var(--accent-strong); text-decoration: none; transition: color 0.18s ease; }
a:hover { color: var(--accent-ink); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 251, 253, 0.8);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; flex: 0 0 36px;
  background: var(--accent);
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
}
.brand-live { color: var(--accent-strong); font-weight: 800; }
.main-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 0.25rem; flex-wrap: wrap;
}
.main-nav a {
  color: var(--body);
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  position: relative;
  transition: color 0.18s ease, background 0.18s ease;
}
.main-nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.main-nav a[aria-current="page"] { color: var(--ink); }
.main-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 2px;
  transform: translateX(-50%);
  width: 16px; height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* ---------- Layout ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }
main .container { padding-top: 3rem; padding-bottom: 4rem; }

/* ---------- Hero ---------- */
.hero {
  color: var(--ink);
  padding: 4.5rem 0 4rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.55rem;
  margin: 0 0 1.25rem;
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted);
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.1rem, 1.35rem + 3.6vw, 3.15rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
  max-width: 16ch;
  text-wrap: balance;
}
.hero h1 .accent-word { color: var(--accent-strong); }
.hero p.lead {
  margin: 0 0 1.6rem;
  color: var(--body);
  font-size: 1.08rem;
  max-width: 44rem;
  line-height: 1.7;
}
.hero-badges { display: flex; gap: 0.55rem; flex-wrap: wrap; }
.badge {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.34rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--body);
}

/* ---------- Sub-page hero ---------- */
.page-hero {
  padding: 3.2rem 0 2.6rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.page-hero h1 { margin: 0; font-size: clamp(1.7rem, 1.3rem + 2.4vw, 2.4rem); letter-spacing: -0.025em; font-weight: 800; }
.page-hero p { color: var(--body); margin: 0.6rem 0 0; max-width: 44rem; }

/* ---------- Sections & headings ---------- */
section { margin-bottom: 3.5rem; }
main h2 {
  font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 1.4rem; line-height: 1.3;
}
main h3 { font-size: 1.12rem; margin: 1.6rem 0 0.6rem; color: var(--ink); letter-spacing: -0.01em; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

/* Extremes — one hero stat card, pastel halves inside */
.extremes-hero {
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 640px) { .extremes-hero { grid-template-columns: 1fr 1fr; } }

.extreme-half {
  border-radius: 16px;
  padding: 1.9rem 1.9rem 1.7rem;
}
.extreme-half.cheapest { background: var(--tint-cheap); }
.extreme-half.expensive { background: var(--tint-dear); }
.extreme-label {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
  padding: 0.3rem 0.75rem; border-radius: 999px; margin-bottom: 0.85rem;
  border: 1px solid;
}
.cheapest .extreme-label { background: rgba(30, 126, 94, 0.08); color: var(--cheap); border-color: rgba(30, 126, 94, 0.28); }
.expensive .extreme-label { background: rgba(192, 54, 44, 0.08); color: var(--dear); border-color: rgba(192, 54, 44, 0.28); }
.extreme-half h3 { margin: 0 0 0.25rem; font-size: 1.5rem; letter-spacing: -0.015em; font-weight: 800; }
.extreme-price {
  font-family: var(--mono);
  font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0.4rem 0 0.3rem;
  color: var(--ink);
}
.extreme-half p { margin: 0.3rem 0; color: var(--muted); font-size: 0.93rem; }

/* Market snapshot strip */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat {
  background: var(--surface);
  padding: 1.25rem 1.4rem;
}
.stat dt {
  font-size: 0.74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.stat dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1;
  color: var(--ink);
}
@media (max-width: 560px) {
  .stat { padding: 0.85rem 0.9rem; }
  .stat dd { font-size: 1.02rem; }
  .stat dt { font-size: 0.66rem; }
}

/* ---------- Controls ---------- */
.controls {
  display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: center;
  margin: 0 0 1.1rem;
}
.search-box { position: relative; flex: 1 1 240px; max-width: 400px; }
.search-box input {
  width: 100%;
  padding: 0.7rem 2.6rem 0.7rem 2.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 1rem; font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-box input::placeholder { color: var(--muted); }
.search-box input:hover { border-color: var(--muted); }
.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 178, 36, 0.28);
}
.search-box .search-icon {
  position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted); pointer-events: none;
}
.search-clear {
  position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px;
  border: none; border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 1.05rem; line-height: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.18s ease, color 0.18s ease;
}
.search-clear:hover { background: var(--accent); color: var(--accent-ink); }
.sort-hint { font-size: 0.85rem; color: var(--muted); }
#result-count {
  font-family: var(--mono); font-size: 0.82rem;
  color: var(--body);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}

.data-stamp {
  font-size: 0.88rem; color: var(--body);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 1.1rem;
  margin-bottom: 1.25rem;
}
.data-stamp strong { color: var(--ink); }

/* ---------- Table ---------- */
.table-scroll {
  overflow: auto;
  max-height: min(68vh, 620px);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.table-scroll::-webkit-scrollbar { height: 10px; width: 10px; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
.table-scroll::-webkit-scrollbar-track { background: transparent; }
table.price-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  font-size: 0.94rem;
  min-width: 740px;
}
.price-table caption {
  text-align: left; padding: 0.75rem 1rem;
  font-weight: 600; font-size: 0.85rem; color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.price-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  padding: 0;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-strong);
}
.price-table thead th button {
  all: unset;
  cursor: pointer;
  color: inherit;
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.85rem 0.9rem;
  width: 100%;
  box-sizing: border-box;
  transition: color 0.18s ease, background 0.18s ease;
}
.price-table thead th button:hover { color: var(--ink); background: var(--surface-2); }
.price-table thead th button:focus-visible { outline-offset: -2px; }
.price-table tbody td {
  padding: 0.72rem 0.9rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  color: var(--body);
}
.price-table tbody tr:nth-child(even) td { background: rgba(0, 0, 0, 0.015); }
.price-table tbody tr:hover td { background: var(--surface-2); }
.price-table tbody tr:last-child td { border-bottom: none; }
.price-table td.country { font-weight: 700; white-space: normal; color: var(--ink); }
.num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.price-table thead th.num { text-align: right; }
.price-table thead th.num button { justify-content: flex-end; }
/* USD columns get a whisper of tint to guide comparison */
.price-table td:nth-child(4), .price-table td:nth-child(6) {
  background: rgba(0, 0, 0, 0.028);
  color: var(--ink);
  font-weight: 600;
}
.price-table tbody tr:nth-child(even) td:nth-child(4),
.price-table tbody tr:nth-child(even) td:nth-child(6) { background: rgba(0, 0, 0, 0.04); }
.price-table tbody tr:hover td:nth-child(4),
.price-table tbody tr:hover td:nth-child(6) { background: rgba(0, 0, 0, 0.05); }
/* Trend pills */
.trend-up, .trend-down, .trend-flat {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-family: var(--mono); font-size: 0.82rem; font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}
.trend-up { color: var(--up); border-color: rgba(192, 54, 44, 0.25); background: rgba(192, 54, 44, 0.06); }
.trend-down { color: var(--down); border-color: rgba(30, 126, 94, 0.25); background: rgba(30, 126, 94, 0.06); }
.trend-flat { color: var(--flat); border-color: var(--line-strong); background: var(--surface-2); }
.table-note { font-size: 0.85rem; color: var(--muted); margin-top: 0.7rem; }
.empty-row td { text-align: center; padding: 2rem 1.5rem; color: var(--muted); white-space: normal; }

/* ---------- Explainer ---------- */
.explainer {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.2rem;
  color: var(--body);
}
.explainer h2 { margin-top: 0; }
.explainer ul { padding-left: 0.2rem; list-style: none; margin: 1rem 0; }
.explainer li { position: relative; padding-left: 1.4rem; margin-bottom: 0.9rem; }
.explainer li::before {
  content: "";
  position: absolute; left: 0.35rem; top: 0.72em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--line-strong);
}
.explainer li strong { color: var(--ink); }
.callout {
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  padding: 1rem 1.25rem;
  border-radius: 0 10px 10px 0;
  margin: 1.4rem 0;
  color: var(--body);
}
.callout strong { color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  color: var(--muted);
  margin-top: 2rem;
}
.footer-grid {
  max-width: 1120px; margin: 0 auto; padding: 2.75rem 1.5rem 1.75rem;
  display: grid; grid-template-columns: 1fr; gap: 1.75rem;
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; } }
.site-footer h3 { color: var(--ink); font-size: 0.95rem; margin: 0 0 0.7rem; letter-spacing: 0.02em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.45rem; }
.site-footer a { color: var(--body); font-size: 0.93rem; }
.site-footer a:hover { color: var(--ink); text-decoration: none; }
.site-footer p { font-size: 0.93rem; }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 1.25rem 1.5rem;
  text-align: center;
  font-size: 0.84rem;
  color: var(--muted);
}
.footer-bottom p { margin: 0.3rem 0; }

/* (Ad slots are invisible HTML comments in the markup — no visible placeholder styles needed.) */

/* ---------- Contact form ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 760px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.form-group { margin-bottom: 1.05rem; }
.form-group label { display: block; font-weight: 700; margin-bottom: 0.4rem; color: var(--ink); font-size: 0.93rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px; font-size: 1rem; font-family: inherit;
  background: var(--surface); color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--muted); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 178, 36, 0.28);
}
.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 999px;
  font-size: 1rem; font-weight: 800; letter-spacing: 0.01em;
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease;
}
.btn:hover, .btn:focus-visible {
  filter: brightness(0.96);
  text-decoration: none;
  color: var(--accent-ink);
}
.btn:active { transform: translateY(1px); }
.form-note { font-size: 0.85rem; color: var(--muted); margin-top: 0.7rem; }
.form-error { color: var(--up); font-weight: 700; font-size: 0.92rem; margin-top: 0.6rem; }
.form-success { color: var(--down); font-weight: 700; margin-top: 0.6rem; }

/* ---------- Misc ---------- */
.prose { max-width: 46rem; }
.prose p, .prose li { color: var(--body); }
.prose h2 { margin-top: 2.25rem; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.last-updated {
  font-size: 0.9rem; color: var(--muted);
  display: inline-flex; align-items: center; gap: 0.45rem;
}
.last-updated::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--down);
}

/* ---------- Reveal on scroll (JS-gated) ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.55s ease, transform 0.55s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Next steps (retention cross-links) ---------- */
.next-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 0 0 2rem;
}
.next-step {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 2px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.next-step strong { display: block; margin-bottom: 0.35rem; font-size: 1.05rem; color: var(--ink); }
.next-step span { color: var(--body); font-size: 0.95rem; }
.next-step:hover, .next-step:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.next-inline { margin: 0 0 2rem; color: var(--body); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .nav-wrap { padding: 0.75rem 1rem; }
  .main-nav a { padding: 0.45rem 0.65rem; font-size: 0.88rem; }
  .hero { padding: 3.2rem 0 2.8rem; }
  main .container { padding-top: 2rem; padding-bottom: 3rem; }
  .explainer { padding: 1.5rem; }
  .extreme-price { font-size: 2rem; }
  .controls { gap: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
