/* Market pages — /fuel-prices/{market}, region hubs, index */

:root {
  --bg: #f1f1f0;
  --text: #0f0f0f;
  --text-muted: rgba(0, 0, 0, 0.55);
  --line: rgba(0, 0, 0, 0.1);
  --border: rgba(0, 0, 0, 0.1);
  --surface: #fff;
  --orange: #ff6a00;
  --up: #dc2626;
  --down: #16a34a;
}

@media (prefers-color-scheme: dark) {
  html { color-scheme: dark; }
  :root {
    --bg: #0c0c0c;
    --text: #ececec;
    --text-muted: rgba(255, 255, 255, 0.55);
    --line: rgba(255, 255, 255, 0.12);
    --border: rgba(255, 255, 255, 0.12);
    --surface: #161616;
    --up: #f87171;
    --down: #4ade80;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body > header, body > .site-footer { flex-shrink: 0; }
body > .site-footer { margin-top: auto; }

body > header .logo-block { justify-content: space-between; }

.mk-header-cta {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--text) 18%, transparent);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.mk-header-cta:hover {
  border-color: color-mix(in srgb, var(--text) 38%, transparent);
  background: var(--surface);
}

.mk-main {
  width: 100%;
  flex: 1;
  max-width: var(--ppx-content-max);
  margin: 0 auto;
  padding: 1.25rem max(var(--ppx-page-inset), env(safe-area-inset-left, 0px)) clamp(3rem, 8vw, 4.5rem);
}

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

/* --------------------------------------------------------------------------
   Breadcrumb + hero
-------------------------------------------------------------------------- */

.mk-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.mk-breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  color: color-mix(in srgb, var(--text-muted) 55%, transparent);
}

.mk-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.mk-breadcrumb a:hover { color: var(--text); text-decoration: underline; }
.mk-breadcrumb [aria-current] { color: var(--text); }

.mk-hero { margin-bottom: clamp(2rem, 4vw, 2.75rem); }

.mk-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-wordmark);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
}

.mk-lede {
  margin: 0;
  max-width: 62ch;
  font-size: 1rem;
  color: var(--text-muted);
  text-wrap: pretty;
}

.mk-lede a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

.mk-updated {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text);
}

.mk-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
}

.mk-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--orange) 12%, transparent);
  color: var(--orange);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mk-source {
  margin: 0;
  max-width: 68ch;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.mk-source a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

.mk-stale {
  margin-top: 1rem;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--orange) 35%, transparent);
  border-left-width: 3px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--orange) 6%, transparent);
  font-size: 0.84375rem;
  color: var(--text);
  max-width: 72ch;
}

.mk-subsidy {
  margin: 1rem 0 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-left: 3px solid var(--orange);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.84375rem;
  max-width: 72ch;
}

/* --------------------------------------------------------------------------
   Sections
-------------------------------------------------------------------------- */

.mk-section { margin-bottom: clamp(2.25rem, 5vw, 3.25rem); }

.mk-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 1rem;
  font-family: var(--font-wordmark);
  font-size: clamp(1.125rem, 2.2vw, 1.375rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mk-section-title a { color: inherit; text-decoration: none; }
.mk-section-title a:hover { text-decoration: underline; }

.mk-count {
  padding: 1px 8px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--text-muted);
}

.mk-section-note {
  margin: 0 0 1rem;
  max-width: 72ch;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.mk-section-note a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

/* --------------------------------------------------------------------------
   Price cards
-------------------------------------------------------------------------- */

.mk-price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mk-price-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 12px;
  background: var(--surface);
}

.mk-price-grade {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mk-price-grade em {
  font-style: normal;
  color: var(--orange);
}

.mk-price-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.mk-price-value {
  font-family: var(--font-wordmark);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.mk-price-cur {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.mk-price-sub {
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.mk-price-change {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  font-variant-numeric: tabular-nums;
}

.mk-up { color: var(--up); }
.mk-down { color: var(--down); }
.mk-flat { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Tables
-------------------------------------------------------------------------- */

.mk-table-wrap {
  overflow-x: auto;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 12px;
  background: var(--surface);
}

.mk-table-scroll { max-height: 520px; overflow-y: auto; }

.mk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84375rem;
  font-variant-numeric: tabular-nums;
}

.mk-table th, .mk-table td {
  padding: 10px 14px;
  text-align: right;
  white-space: nowrap;
}

.mk-table th:first-child, .mk-table td:first-child {
  text-align: left;
  font-weight: 500;
}

.mk-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mk-table tbody tr + tr th,
.mk-table tbody tr + tr td {
  border-top: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
}

.mk-table tbody tr:hover { background: color-mix(in srgb, var(--text) 3%, transparent); }

.mk-table tbody th { font-weight: 500; }
.mk-table tbody td { font-family: var(--font-mono); }

.mk-table a { color: var(--text); text-decoration: none; }
.mk-table a:hover { text-decoration: underline; }

.mk-cur { color: var(--text-muted); font-size: 0.6875rem; }

/* --------------------------------------------------------------------------
   Chart
-------------------------------------------------------------------------- */

.mk-chart-figure {
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 12px;
  background: var(--surface);
}

.mk-chart {
  display: block;
  width: 100%;
  height: 180px;
}

.mk-line {
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.mk-line-0 { stroke: var(--orange); }
.mk-line-1 { stroke: color-mix(in srgb, var(--text) 45%, transparent); }
.mk-line-2 { stroke: color-mix(in srgb, var(--text) 75%, transparent); }
.mk-line-3 { stroke: color-mix(in srgb, var(--text) 28%, transparent); }
.mk-line-4 { stroke: color-mix(in srgb, var(--orange) 45%, transparent); }

.mk-chart-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.mk-chart-legend { display: flex; flex-wrap: wrap; gap: 12px; }

.mk-legend-item { display: inline-flex; align-items: center; gap: 5px; }

.mk-swatch {
  width: 10px; height: 2px;
  border-radius: 2px;
  flex-shrink: 0;
}

.mk-swatch-0 { background: var(--orange); }
.mk-swatch-1 { background: color-mix(in srgb, var(--text) 45%, transparent); }
.mk-swatch-2 { background: color-mix(in srgb, var(--text) 75%, transparent); }
.mk-swatch-3 { background: color-mix(in srgb, var(--text) 28%, transparent); }
.mk-swatch-4 { background: color-mix(in srgb, var(--orange) 45%, transparent); }

/* --------------------------------------------------------------------------
   FAQ
-------------------------------------------------------------------------- */

.mk-faq {
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.mk-faq-item + .mk-faq-item { border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }

.mk-faq-item summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mk-faq-item summary::-webkit-details-marker { display: none; }

.mk-faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.mk-faq-item[open] summary::after { transform: rotate(45deg); }

.mk-faq-body {
  padding: 0 16px 14px;
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 72ch;
}

.mk-faq-body p { margin: 0; }

/* --------------------------------------------------------------------------
   Related + index links
-------------------------------------------------------------------------- */

.mk-related {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.mk-related a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.mk-related a:hover { border-color: color-mix(in srgb, var(--text) 22%, transparent); }

.mk-related-name { font-size: 0.875rem; font-weight: 500; }

.mk-related-price {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mk-market-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 2px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mk-market-links a {
  display: block;
  padding: 5px 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.mk-market-links a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 600px) {
  .mk-table th, .mk-table td { padding: 9px 11px; }
  .mk-price-value { font-size: 1.5rem; }
}

/* Wordmark + "| Fuel prices" + CTA won't fit a phone header. The breadcrumb
   directly below already says where you are, so the context label gives way. */
@media (max-width: 560px) {
  body > header .header-context-sep,
  body > header .header-context-label {
    display: none;
  }

  .mk-header-cta {
    padding: 6px 12px;
    font-size: 0.78125rem;
  }
}
