/* Gas Discount Guide — Modern Design System (site_AG_260922)
   Mobile-first, high contrast, clean typography, ad-network ready layout */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600;700&display=swap');

:root {
  color-scheme: light dark;
  
  /* Brand Tokens */
  --navy-900: #0f172a;
  --navy-800: #1e293b;
  --navy-700: #334155;
  
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  
  --amber-600: #d97706;
  --amber-500: #f59e0b;
  --amber-50: #fffbeb;

  --blue-600: #2563eb;
  --blue-50: #eff6ff;

  --red-600: #dc2626;
  --red-50: #fef2f2;
  
  /* Light Theme Defaults */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --surface-card: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  
  --ink-heading: #0f172a;
  --ink-body: #334155;
  --ink-muted: #64748b;
  --ink-faint: #94a3b8;
  
  --accent: var(--emerald-600);
  --accent-hover: var(--emerald-700);
  --accent-light: var(--emerald-50);
  --accent-ink: #ffffff;
  
  --link: #0284c7;
  --link-hover: #0369a1;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --max-w: 68rem;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f19;
    --surface: #111827;
    --surface-alt: #1f2937;
    --surface-card: #161e2e;
    --border: #2d3748;
    --border-strong: #4a5568;
    
    --ink-heading: #f8fafc;
    --ink-body: #cbd5e1;
    --ink-muted: #94a3b8;
    --ink-faint: #64748b;
    
    --accent: #10b981;
    --accent-hover: #059669;
    --accent-light: rgba(16, 185, 129, 0.12);
    --accent-ink: #0f172a;
    
    --link: #38bdf8;
    --link-hover: #7dd3fc;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
  }
}

/* Base resets & layout */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink-body);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.skip-link {
  position: absolute;
  top: -999px;
  left: 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus { top: 1rem; }

/* Header & Navigation */
.site-header {
  background: var(--navy-900);
  color: #ffffff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--emerald-600), var(--emerald-700));
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.brand-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255,255,255,0.15);
  color: #34d399;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.93rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.nav-link:hover, .nav-link:focus {
  color: #ffffff;
  background: rgba(255,255,255,0.08);
}

.nav-link[aria-current="page"] {
  color: #ffffff;
  background: rgba(255,255,255,0.12);
  font-weight: 600;
}

/* Mobile Menu Button */
.mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #ffffff;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
}

@media (max-width: 48rem) {
  .mobile-toggle { display: block; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 4rem;
    left: 0;
    right: 0;
    background: var(--navy-900);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .nav-menu.open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0.4rem; }
  .nav-link { padding: 0.75rem 1rem; }
}

/* Typography & Headings */
h1, h2, h3, h4 {
  color: var(--ink-heading);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-top: 0;
}

h1 { font-size: 2.25rem; line-height: 1.2; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; line-height: 1.3; margin-top: 2.5rem; margin-bottom: 0.85rem; }
h3 { font-size: 1.15rem; margin-top: 1.75rem; margin-bottom: 0.6rem; }

p { margin-top: 0; margin-bottom: 1.2rem; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--link-hover); }

.lede {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--ink-body);
  font-weight: 400;
  max-width: 48rem;
}

/* Hero Section */
.hero-banner {
  background: linear-gradient(135deg, var(--navy-900) 0%, #1e1b4b 100%);
  color: #ffffff;
  padding: 3rem 0 3.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 52rem) {
  .hero-grid { grid-template-columns: 1.2fr 0.8fr; }
}

.hero-title {
  color: #ffffff;
  font-size: 2.5rem;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-title span {
  background: linear-gradient(120deg, #34d399, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: #cbd5e1;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.hero-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3);
}

.hero-card-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.hero-stat-price {
  font-family: var(--font-mono);
  font-size: 2.75rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0.2rem 0 0.5rem;
}

.hero-stat-meta {
  font-size: 0.85rem;
  color: #a7f3d0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1;
}

.badge-emerald { background: var(--emerald-100); color: #065f46; }
.badge-amber { background: var(--amber-50); color: #92400e; border: 1px solid #fde68a; }
.badge-blue { background: var(--blue-50); color: #1e40af; }
.badge-gray { background: var(--surface-alt); color: var(--ink-muted); }

/* Search & Filter Bar */
.search-container {
  margin: 1.75rem 0 2rem;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.search-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--ink-heading);
  font-size: 1rem;
  font-family: var(--font-sans);
  outline: none;
}

.search-input::placeholder { color: var(--ink-faint); }

/* Grid of Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2.5rem;
}

.chain-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
}

.chain-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  text-decoration: none;
}

.chain-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.chain-card-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink-heading);
  margin: 0;
}

.chain-card-program {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

.chain-card-saving {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.chain-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--ink-muted);
}

/* Fact Box / Highlight Panel */
.fact-panel {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

.fact-panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 0.6rem;
}

.fact-dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1.25rem;
  margin: 0;
}

.fact-dt {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  font-weight: 600;
}

.fact-dd {
  margin: 0.2rem 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-heading);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  margin: 1.25rem 0 2rem;
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.93rem;
}

th, td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

thead th {
  background: var(--surface-alt);
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

tbody tr:hover { background: var(--surface-alt); }
td.num { font-family: var(--font-mono); text-align: right; font-weight: 600; }

.price-up { color: var(--red-600); }
.price-down { color: var(--emerald-600); }

/* Calculators & Form Controls */
.calc-container {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin: 1.5rem 0 2.5rem;
  box-shadow: var(--shadow-md);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-heading);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-heading);
}

.form-control:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }

.calc-output-box {
  background: var(--accent-light);
  border: 1px solid var(--emerald-100);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1.5rem;
  text-align: center;
}

.calc-output-number {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--accent);
}

/* Ad placement hooks.
 *
 * The `.ad-slot` divs are deliberate, pre-agreed ad positions: the markup and
 * the `m.ad_slot()` calls in the templates stay so a network's script has
 * somewhere to land. There is no ad network yet, so the slots render NOTHING
 * — `display: none` generates no box at all, which means no dashed
 * "Advertisement Space" placeholder and no reserved empty strip pushing the
 * copy down.
 *
 * TO RE-ENABLE when an ad network is actually live: delete the `display: none`
 * line below, restore `display: flex`, and replace the placeholder text in
 * templates/partials/macros.html with the network's tag. Until then a visible
 * placeholder reads as an unfinished site, which is the opposite of what the
 * sourcing copy is trying to earn.
 */
.ad-slot {
  display: none;             /* re-enable as `flex` when ads are live */
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--ink-faint);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 2rem 0;
  min-height: 100px;
  overflow: hidden;
}

/* Sizes apply only once .ad-slot is displayed again; a `display: none` box
 * reserves no height, so these do not hold space open today. */
.ad-banner { min-height: 90px; width: 100%; }
.ad-inline { min-height: 250px; width: 100%; }

/* Footer */
.site-footer {
  background: var(--navy-900);
  color: #94a3b8;
  padding: 3.5rem 0 2.5rem;
  margin-top: 4rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-title {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: #cbd5e1; text-decoration: none; }
.footer-links a:hover { color: #ffffff; text-decoration: underline; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
}
