/* The fuel finder's own sheet (feature/fuel-finder). styles.css is
   content-hashed into every page's URL, so fuel rules live here and load
   only on the fuel pages. Tokens only (styles.css :root): no literal
   radius. */

/* where (a postcode, a suburb or a town, or your location), the fuel and
   the distance: one band above the list */
.fuel-controls { display: flex; flex-direction: column; gap: 12px; margin: 0 0 18px; }
.fuel-postcode-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fuel-postcode-form label { font-weight: 600; font-size: 14px; }
.fuel-postcode-form input {
  flex: 1 1 12em; min-width: 0; max-width: 20em; padding: 8px 10px; font: inherit; color: var(--text);
  background: #fff; border: 1px solid #C9D5E6; border-radius: var(--radius-control);
}
/* "Use my location": hidden until fuel-locate.js shows it */
.fuel-locate { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.fuel-locate[hidden] { display: none; }
.fuel-locate-note { flex: 1 1 18em; margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.fuel-locate-note a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.fuel-locate-status { flex-basis: 100%; margin: 0; font-size: 14px; line-height: 1.5; }
.fuel-locate-status:empty { display: none; }
/* the prompt's coverage, above the box: the states covered, and where the
   rest publish their prices */
.fuel-coverage { margin: 10px 0 18px; font-size: 14px; line-height: 1.55; }
.empty-state .fuel-coverage p { margin: 0 0 2px; color: var(--text); }
/* a search's answers: the names it could mean */
.fuel-near-places { margin: 0 0 14px; font-size: 14px; line-height: 1.6; }
.fuel-places { display: flex; flex-direction: column; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.fuel-places a { font-weight: 600; }
.fuel-places span { font-size: 14px; color: var(--muted); }
.fuel-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.fuel-chips-label { width: 100%; margin: 0 0 2px; font-size: 13px; color: var(--muted); }
.fuel-chip {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-control); background: #fff;
  color: var(--text); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.fuel-chip small { font-size: 12px; color: var(--muted); }
.fuel-chip:hover { border-color: var(--navy); }
.fuel-chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.fuel-chip.on small { color: var(--platinum); }

/* the card: the station on the left, its price on the right, on every width */
.fuel-list { display: flex; flex-direction: column; gap: 10px; margin: 0 0 18px; }
.fuel-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: start;
  padding: 14px 18px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.fuel-card h3 { margin: 0; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.fuel-card p { margin: 0; }
.fuel-where { font-size: 13.5px; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
.fuel-where strong { color: var(--text); font-weight: 600; }
.fuel-figure { text-align: right; }
.fuel-price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fuel-price strong { font-size: 24px; line-height: 1.15; font-weight: 700; color: var(--text); }
.fuel-unit { margin-left: 3px; font-size: 13px; color: var(--muted); }
.fuel-reported { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.fuel-card .fuel-label { margin: 0 0 4px; }
.fuel-label .tag { text-transform: none; }

/* the card a map pin's "See it in the list" opens */
.fuel-card:target { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy); scroll-margin-top: 16px; }
/* a card's "See it on the map": hidden until fuel-map.js draws the map */
.fuel-card .fuel-onmap { margin: 4px 0 0; font-size: 13px; }
.fuel-onmap a { font-weight: 600; }

/* THE MAP (step 4): over the list, hidden until fuel-map.js draws it. Its
   own stacking context, so Leaflet's layers never rise over the menus. */
.fuel-map-wrap { margin: 0 0 16px; }
.fuel-map {
  height: 340px; position: relative; z-index: 0; isolation: isolate;
  border: 1px solid var(--border); border-radius: var(--radius-card); background: #F2EFE9;
}
.fuel-map-key { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.fuel-map-key a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.fuel-key { display: inline-flex; vertical-align: middle; margin-right: 4px; }
.fuel-key span { width: 14px; height: 8px; }
/* the five bands, lowest price to highest: each clears 5.2:1 with white text */
.fuel-band-0 { --pin: #0E7A4E; background: #0E7A4E; }
.fuel-band-1 { --pin: #3F7A12; background: #3F7A12; }
.fuel-band-2 { --pin: #7A6A00; background: #7A6A00; }
.fuel-band-3 { --pin: #9A5200; background: #9A5200; }
.fuel-band-4 { --pin: #B42318; background: #B42318; }
/* a pin: the price on its band's colour, a point under it at the station */
.leaflet-marker-icon.fuel-pin { width: 0; height: 0; background: none; border: 0; }
.fuel-pin span {
  position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-100% - 7px));
  padding: 2px 6px; border-radius: var(--radius-control); background: var(--pin);
  color: #fff; font: 600 12px/1.3 var(--font-sans); white-space: nowrap;
  box-shadow: 0 1px 3px rgba(6, 13, 31, .35);
}
.fuel-pin span::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px;
  border: 6px solid transparent; border-bottom: 0; border-top-color: var(--pin);
}
.fuel-pin-lowest span { outline: 2px solid #fff; box-shadow: 0 0 0 4px var(--pin), 0 1px 3px rgba(6, 13, 31, .35); }
/* Leaflet makes each pin a button; the ring shows on its label, the part you see */
.leaflet-marker-icon.fuel-pin:focus { outline: none; }
.leaflet-marker-icon.fuel-pin:focus-visible span { outline: 3px solid #fff; box-shadow: 0 0 0 5px var(--navy); }
.fuel-pop strong { display: block; font-size: 14px; margin: 0 0 2px; }
.fuel-pop p { margin: 0 0 2px; font-size: 13px; }
.fuel-pop .fuel-pop-meta { color: var(--muted); }
.fuel-pop a { font-size: 13px; font-weight: 600; }

/* the coverage page's table (/our-data/fuel) */
.fuel-table-wrap { overflow-x: auto; margin: 0 0 8px; }
.fuel-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fuel-table th, .fuel-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.fuel-table th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fuel-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* on a phone each state is a block of labelled lines, not five squeezed columns */
@media (max-width: 560px) {
  .fuel-table thead { display: none; }
  .fuel-table, .fuel-table tbody, .fuel-table tr, .fuel-table td { display: block; }
  .fuel-table tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .fuel-table td { padding: 1px 0; border: 0; }
  .fuel-table td:first-child { font-weight: 600; }
  .fuel-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
  .fuel-table .num { text-align: left; white-space: normal; }
}

/* a state not covered yet with nothing covered in reach: where its own
   prices are published, as the page's one action */
.fuel-elsewhere {
  margin: 0 0 20px; padding: 18px 20px; background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--navy); border-radius: var(--radius-card);
}
.fuel-elsewhere p { margin: 0 0 10px; font-size: 15px; line-height: 1.55; }
.fuel-elsewhere .fuel-elsewhere-lead { font-size: 17px; font-weight: 600; color: var(--text); }
.fuel-elsewhere .btn { margin: 2px 0 4px; }
.fuel-elsewhere .fuel-elsewhere-covered { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* a sentence the list needs before it: a state not covered, an old read */
.fuel-notice {
  margin: 0 0 14px; padding: 12px 16px; font-size: 14px; line-height: 1.5;
  border: 1px solid var(--border); border-left: 3px solid var(--navy);
  border-radius: var(--radius-card); background: #fff;
}

@media (max-width: 560px) {
  .fuel-map { height: 260px; }
  /* the five distances on one line at 375 px */
  .fuel-chip { padding: 6px 9px; }
  .fuel-card { padding: 12px 14px; gap: 2px 12px; }
  .fuel-price strong { font-size: 21px; }
  /* the time wraps under the price, so the name keeps the width */
  .fuel-reported { white-space: normal; max-width: 7.5em; margin-left: auto; line-height: 1.35; }
}

/* the way between the fuel pages and the EV charger pages (with EV_ENABLED
   on; evpages.mjs loads this sheet too) */
.ev-elsewhere { margin: 14px 0 0; font-size: 14px; }
.ev-elsewhere a { font-weight: 600; }
