/* ==========================================================================
   Airline Reward Flight Costs — design system
   Editorial travel aesthetic: warm paper, ink, one accent per airline.
   Zero dependencies. Self-hosted variable fonts (see fonts/OFL.txt).
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------- */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* Registered so the per-airline header gradient cross-fades when the
   programme changes (supported in all evergreen browsers; harmless
   elsewhere — the gradient simply snaps). */
@property --grad-a {
  syntax: "<color>";
  inherits: true;
  initial-value: #1d3557;
}
@property --grad-b {
  syntax: "<color>";
  inherits: true;
  initial-value: #2a4a7a;
}

/* --- Tokens ---------------------------------------------------------------- */

:root {
  color-scheme: light;

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Liberation Serif", serif;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;

  --fs-2xs: 0.72rem;
  --fs-xs: 0.79rem;
  --fs-sm: 0.875rem;
  --fs-md: 0.9375rem;
  --fs-lg: 1.0625rem;
  --fs-xl: 1.35rem;
  --fs-2xl: 1.75rem;

  /* 8px-based spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-full: 999px;

  /* Surfaces & ink (light: warm paper + warm ink) */
  --bg: #f6f3ee;
  --surface: #fffefb;
  --surface-2: #f0ebe2;
  --text: #211d18;
  --muted: #675f54;
  --faint: #6c6356; /* AA on every light surface (audited) */
  --border: #e4ddd0;
  --hairline: #eae4d9;

  /* Seasons */
  --offpeak-ink: #196b3b;
  --offpeak-tint: rgba(38, 145, 84, 0.075);
  --peak-ink: #a92832;
  --peak-tint: rgba(197, 59, 70, 0.07);
  --single-tint: rgba(103, 95, 84, 0.055);

  /* Per-airline accent. app.js overrides these on the calculator;
     the static defaults keep the blog and error pages on-brand. */
  --grad-a: #1d3557;
  --grad-b: #2a4a7a;
  --accent-raw: #1d3557;
  --accent-ink: var(--accent-ink-l, #2c4568);
  --link: var(--accent-ink);

  --shadow-sm: 0 1px 2px rgba(33, 24, 9, 0.05), 0 1px 1px rgba(33, 24, 9, 0.03);
  --shadow-md: 0 2px 6px rgba(33, 24, 9, 0.05), 0 14px 32px -14px rgba(33, 24, 9, 0.16);
  --shadow-lg: 0 4px 10px rgba(33, 24, 9, 0.05), 0 28px 56px -20px rgba(33, 24, 9, 0.24);

  /* Strong enough that white header text stays AA on the lightest
     airline accents (audited against all 22 at grad-b lightness). */
  --header-veil-top: rgba(14, 12, 16, 0.32);
  --header-veil-bottom: rgba(14, 12, 16, 0.30);

  /* Form icons (URL-encoded currentColor is not possible; themed per scheme) */
  --icon-chevron: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path d="M1 1.5 6 6.5 11 1.5" fill="none" stroke="%23675f54" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>');
  --icon-search: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><circle cx="6.5" cy="6.5" r="4.75" fill="none" stroke="%238a8175" stroke-width="1.7"/><path d="M10.2 10.2 13.6 13.6" stroke="%238a8175" stroke-width="1.7" stroke-linecap="round"/></svg>');
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #101318;
    --surface: #181c23;
    --surface-2: #212630;
    --text: #e9e6e1;
    --muted: #a49d92;
    --faint: #9a9388; /* AA on every dark surface (audited) */
    --border: #2a303b;
    --hairline: #232934;

    --offpeak-ink: #6fcf97;
    --offpeak-tint: rgba(111, 207, 151, 0.09);
    --peak-ink: #f0808a;
    --peak-tint: rgba(240, 128, 138, 0.09);
    --single-tint: rgba(164, 157, 146, 0.07);

    --accent-ink: var(--accent-ink-d, #9db9dd);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.35), 0 16px 36px -16px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.4), 0 32px 64px -24px rgba(0, 0, 0, 0.7);

    --header-veil-top: rgba(8, 9, 12, 0.52);
    --header-veil-bottom: rgba(8, 9, 12, 0.60);

    --icon-chevron: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path d="M1 1.5 6 6.5 11 1.5" fill="none" stroke="%23a49d92" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    --icon-search: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><circle cx="6.5" cy="6.5" r="4.75" fill="none" stroke="%23857e73" stroke-width="1.7"/><path d="M10.2 10.2 13.6 13.6" stroke="%23857e73" stroke-width="1.7" stroke-linecap="round"/></svg>');
  }
}

/* --- Base ------------------------------------------------------------------ */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: color-mix(in srgb, var(--accent-raw) 22%, transparent);
}

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Accessibility: skip-to-content link, visually hidden until focused */
.skip-nav {
  position: absolute;
  top: -100px;
  left: var(--sp-2);
  background: var(--text);
  color: var(--bg);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: var(--fs-sm);
  text-decoration: none;
  z-index: 1000;
  transition: top 120ms;
}
.skip-nav:focus { top: var(--sp-2); outline: 2px solid var(--bg); outline-offset: 2px; }

/* Visually hidden helper for accessibility labels */
.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;
}

/* --- Header ----------------------------------------------------------------- */

header {
  position: relative;
  color: #fff;
  text-align: center;
  padding: var(--sp-8) var(--sp-5) 84px;
  background:
    linear-gradient(var(--header-veil-top), var(--header-veil-bottom)),
    linear-gradient(135deg, var(--grad-a) 0%, var(--grad-b) 100%);
  transition: --grad-a 600ms ease, --grad-b 600ms ease;
  overflow: hidden;
}

/* Decorative flight-ring artwork; pure CSS, no extra markup. */
header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(640px 320px at 88% -30%, rgba(255, 255, 255, 0.16), transparent 62%),
    radial-gradient(480px 260px at 4% 130%, rgba(255, 255, 255, 0.10), transparent 60%),
    repeating-radial-gradient(circle at 112% 160%, transparent 0 54px, rgba(255, 255, 255, 0.055) 54px 55.5px);
}
header > * { position: relative; }

header h1 {
  margin: 0 auto var(--sp-3);
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: 0.005em;
  max-width: 22ch;
  text-wrap: balance;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
header .sub {
  margin: 0 auto;
  max-width: 62ch;
  font-size: var(--fs-md);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
  text-wrap: pretty;
}
header .header-cta {
  margin: var(--sp-4) auto 0;
  padding: var(--sp-2) var(--sp-4);
  display: inline-block;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.92);
}
header .header-cta a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.top-nav {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-4);
  right: var(--sp-4);
  display: flex;
  gap: var(--sp-1);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.top-nav a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  padding: 5px 11px;
  border-radius: var(--r-full);
  transition: background 140ms, color 140ms;
}
.top-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.top-nav a.active { color: #fff; background: rgba(255, 255, 255, 0.17); }

/* Slim header variant for article pages (site name instead of an H1) */
header:has(.site-name) { padding: var(--sp-7) var(--sp-5) var(--sp-6); }

.site-name {
  display: inline-block;
  margin: 0;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.01em;
  padding-top: var(--sp-4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.site-name:hover { opacity: 0.92; }

/* --- Calculator controls ----------------------------------------------------- */

.controls {
  position: relative;
  z-index: 5;
  max-width: 1140px;
  margin: -52px auto 0;
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: grid;
  grid-template-columns: 2fr 1.35fr 1.1fr 1fr 1.4fr;
  gap: var(--sp-4) var(--sp-4);
  align-items: end;
  box-shadow: var(--shadow-lg);
}
.controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--fs-2xs);
  color: var(--faint);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  min-width: 0;
}

.controls select,
.controls input {
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--text);
  letter-spacing: normal;
  text-transform: none;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background-color: var(--surface);
  min-width: 0;
  width: 100%;
  transition: border-color 140ms, box-shadow 140ms;
}
.controls select {
  appearance: none;
  -webkit-appearance: none;
  background-image: var(--icon-chevron);
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}
.controls input[type="search"] {
  background-image: var(--icon-search);
  background-repeat: no-repeat;
  background-position: 12px center;
  padding-left: 36px;
}
.controls input::placeholder { color: var(--faint); }
.controls select:hover,
.controls input:hover { border-color: color-mix(in srgb, var(--accent-raw) 38%, var(--border)); }
.controls select:focus-visible,
.controls input:focus-visible {
  outline: none;
  border-color: var(--accent-ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-raw) 18%, transparent);
}

/* --- Legend / meta bar --------------------------------------------------------- */

.legend {
  max-width: 1140px;
  margin: var(--sp-4) auto 0;
  padding: 0 var(--sp-5);
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
  display: flex;
  gap: var(--sp-2) var(--sp-4);
  align-items: baseline;
  flex-wrap: wrap;
}
.legend #airline-note { flex: 1 1 44ch; }
.legend .count {
  margin-left: auto;
  font-size: var(--fs-2xs);
  font-weight: 650;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.legend.no-seasons .pill.peak,
.legend.no-seasons .pill.offpeak { display: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: var(--fs-2xs);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid var(--border);
  background: var(--surface);
}
.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.pill.peak { color: var(--peak-ink); }
.pill.offpeak { color: var(--offpeak-ink); }

/* --- Results grid ---------------------------------------------------------------- */

main {
  max-width: 1140px;
  margin: var(--sp-5) auto var(--sp-7);
  padding: 0 var(--sp-5);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: var(--sp-4);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-4) var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent-raw) 30%, var(--border));
}

/* Staggered entrance when the programme/filters change (not while typing). */
@keyframes card-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
main.animate .card {
  animation: card-rise 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(min(var(--i, 0), 14) * 26ms);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-2);
}
.card-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: 0.002em;
  line-height: 1.15;
}
.card-header .iata {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: 0.09em;
  background: var(--surface-2);
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
}

.card-meta {
  font-size: var(--fs-2xs);
  color: var(--faint);
  font-weight: 550;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
}
.card-meta span { white-space: nowrap; }
.card-meta span + span::before {
  content: "·";
  margin: 0 7px;
  color: var(--border);
}

/* --- Fare tables --------------------------------------------------------------- */

table.fares {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
table.fares th,
table.fares td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--hairline);
}
table.fares th {
  font-weight: 650;
  color: var(--faint);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding-top: 2px;
}
table.fares tr:last-child td { border-bottom: none; }
table.fares .cabin {
  font-weight: 600;
  color: var(--text);
  font-size: var(--fs-xs);
}

/* Price cells: numbers right-aligned, points over muted taxes */
table.fares th:not(:first-child),
table.fares td:not(:first-child) { text-align: right; }
table.fares .points {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
table.fares .points .num { white-space: nowrap; }
table.fares .points .unit {
  display: inline-block;
  font-size: 0.8em;
  font-weight: 550;
  color: var(--muted);
  letter-spacing: 0;
}
table.fares .tax {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: var(--fs-2xs);
  margin-top: 2px;
  text-wrap: balance;
}

/* Season encoding: dot in the column header + a whisper of tint on cells */
table.fares.seasons th:nth-child(2)::before,
table.fares.seasons th:nth-child(3)::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
}
table.fares.seasons th:nth-child(2)::before { background: var(--offpeak-ink); }
table.fares.seasons th:nth-child(3)::before { background: var(--peak-ink); }
table.fares td.offpeak-cell { background: var(--offpeak-tint); }
table.fares td.peak-cell { background: var(--peak-tint); }
table.fares td.single-cell { background: var(--single-tint); }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--sp-8) var(--sp-5);
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
}
.empty a { color: var(--link); font-weight: 600; }

/* Programme-guide index below the calculator results */
.programme-links {
  max-width: 1140px;
  margin: var(--sp-6) auto 0;
  padding: var(--sp-5);
  border-top: 1px solid var(--hairline);
  color: var(--muted);
}
.programme-links h2 {
  margin: 0 0 var(--sp-2);
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}
.programme-links p { margin: 0 0 var(--sp-4); font-size: var(--fs-sm); }
.programme-links ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-2) var(--sp-4);
  font-size: var(--fs-sm);
}
.programme-links a {
  color: var(--link);
  text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent);
  text-underline-offset: 2.5px;
}
.programme-links a:hover { text-decoration-color: var(--link); }

/* --- Footers ------------------------------------------------------------------- */

footer {
  max-width: 1140px;
  margin: 0 auto var(--sp-7);
  padding: var(--sp-5);
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.7;
  border-top: 1px solid var(--hairline);
}
footer a {
  color: var(--link);
  text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
  text-underline-offset: 2px;
}
footer .updated { font-size: var(--fs-2xs); color: var(--faint); }

/* Site-wide footer (About, Privacy, etc.) for non-article pages */
.site-footer {
  max-width: 1140px;
  margin: var(--sp-6) auto var(--sp-6);
  padding: var(--sp-4) var(--sp-5);
  color: var(--muted);
  font-size: var(--fs-xs);
  border-top: 1px solid var(--hairline);
  text-align: center;
}
.site-footer a {
  color: var(--link);
  text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
  text-underline-offset: 2px;
}
.site-footer .updated { font-size: var(--fs-2xs); color: var(--faint); margin-top: 6px; }

/* --- Error page (404) ------------------------------------------------------------ */

.error-page {
  max-width: 720px;
  margin: var(--sp-7) auto;
  padding: 0 var(--sp-5);
  display: block;
}
.error-page .error-inner {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  font-size: var(--fs-lg);
  line-height: 1.7;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.error-page .error-inner::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--grad-a), var(--grad-b));
}
.error-page .error-inner a { color: var(--link); font-weight: 600; }

/* --- Blog: search + jump navigation ----------------------------------------------- */

.blog-search {
  max-width: 860px;
  margin: var(--sp-5) auto 0;
  padding: 0 var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.blog-search input[type="search"] {
  width: 100%;
  font: inherit;
  font-size: var(--fs-md);
  padding: 13px 16px 13px 40px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background-color: var(--surface);
  background-image: var(--icon-search);
  background-repeat: no-repeat;
  background-position: 14px center;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color 140ms, box-shadow 140ms;
}
.blog-search input[type="search"]::placeholder { color: var(--faint); }
.blog-search input[type="search"]:hover { border-color: color-mix(in srgb, var(--accent-raw) 38%, var(--border)); }
.blog-search input[type="search"]:focus-visible {
  outline: none;
  border-color: var(--accent-ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-raw) 18%, transparent);
}
.blog-jump {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.blog-jump a {
  font-size: var(--fs-2xs);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  color: var(--muted);
  text-decoration: none;
  transition: background 140ms, color 140ms, border-color 140ms;
}
.blog-jump a:hover,
.blog-jump a:focus-visible {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.blog-search-status {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* --- Blog: article list ------------------------------------------------------------ */

.blog-list {
  max-width: 860px;
  margin: var(--sp-5) auto var(--sp-7);
  padding: 0 var(--sp-5);
  display: grid;
  gap: var(--sp-3);
}
.blog-list .section-heading {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-ui);
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  margin: var(--sp-5) 0 var(--sp-1);
  font-weight: 700;
}
.blog-list .section-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.blog-list .section-heading:first-child { margin-top: 0; }

.blog-list article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.blog-list article:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent-raw) 30%, var(--border));
}
.blog-list h2 {
  margin: 0 0 var(--sp-1);
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: 0.002em;
  text-wrap: balance;
}
.blog-list h2 a {
  color: var(--text);
  text-decoration: none;
}
.blog-list h2 a:hover { color: var(--accent-ink); }
.blog-list .meta {
  font-size: var(--fs-2xs);
  color: var(--faint);
  font-weight: 600;
  margin-bottom: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.blog-list p { margin: 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.65; }

/* Featured lead article (the walkthrough) */
.blog-list article:first-of-type {
  padding: var(--sp-6) var(--sp-6) var(--sp-5);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--grad-a) 8%, var(--surface)) 0%, var(--surface) 55%);
  border-color: color-mix(in srgb, var(--grad-a) 24%, var(--border));
}
.blog-list article:first-of-type h2 { font-size: 1.65rem; }
.blog-list article:first-of-type p { font-size: var(--fs-md); }

/* --- Blog: article pages -------------------------------------------------------------- */

article.post {
  max-width: 760px;
  margin: var(--sp-6) auto var(--sp-7);
  padding: 0 var(--sp-5);
}
article.post .post-inner { padding: 0; }

/* Breadcrumb trail (visible counterpart of the BreadcrumbList JSON-LD) */
article.post .crumbs {
  display: flex;
  gap: var(--sp-2);
  align-items: baseline;
  font-size: var(--fs-2xs);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--faint);
  margin-bottom: var(--sp-4);
  white-space: nowrap;
  overflow: hidden;
}
article.post .crumbs a {
  color: var(--faint);
  text-decoration: none;
}
article.post .crumbs a:hover { color: var(--accent-ink); text-decoration: underline; }
article.post .crumbs .sep { color: var(--border); }
article.post .crumbs .here {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}

article.post .post-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--sp-5);
  margin-bottom: var(--sp-5);
}
article.post h1 {
  margin: 0 0 var(--sp-3);
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.4rem);
  line-height: 1.14;
  letter-spacing: 0.002em;
  text-wrap: balance;
}
article.post .post-meta {
  font-size: var(--fs-2xs);
  color: var(--faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

article.post .prose {
  font-size: var(--fs-lg);
  line-height: 1.75;
  max-width: 66ch;
}
article.post .prose h2 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.2;
  margin: var(--sp-6) 0 var(--sp-3);
  letter-spacing: 0.002em;
}
article.post .prose h3 {
  font-size: var(--fs-md);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: var(--sp-5) 0 var(--sp-2);
}
article.post .prose p { margin: 0 0 var(--sp-4); text-wrap: pretty; }
article.post .prose ul, article.post .prose ol { padding-left: 24px; margin: 0 0 var(--sp-4); }
article.post .prose li { margin-bottom: var(--sp-2); }
article.post .prose a {
  color: var(--link);
  text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2.5px;
  transition: text-decoration-color 120ms;
}
article.post .prose a:hover { text-decoration-color: var(--link); }
article.post .prose code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.85em;
}

/* Pull-quote / callout styling for blockquotes */
article.post .prose blockquote {
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-ink);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
article.post .prose blockquote p:last-child { margin-bottom: 0; }

/* Data tables inside articles */
article.post .prose table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-5) 0;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
article.post .prose th, article.post .prose td {
  border: 0;
  border-bottom: 1px solid var(--hairline);
  padding: 9px 14px;
  text-align: left;
}
article.post .prose tr:last-child td { border-bottom: 0; }
article.post .prose th {
  background: var(--surface-2);
  font-weight: 650;
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

/* Table of contents (nav or list with class "toc") */
article.post .prose .toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--fs-sm);
  margin: 0 0 var(--sp-5);
}

/* Related guides block at the foot of every article */
article.post .related {
  margin-top: var(--sp-6);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
article.post .related h2 {
  margin: 0 0 var(--sp-3);
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 1.1rem;
  font-weight: 600;
}
article.post .related ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
}
article.post .related a {
  color: var(--link);
  text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
  text-underline-offset: 2.5px;
}
article.post .related a:hover { text-decoration-color: var(--link); }
article.post .related .related-calc {
  margin: var(--sp-3) 0 0;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--hairline);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.post-footer {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.post-footer a { color: var(--link); }

/* --- Responsive --------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .controls { grid-template-columns: 1.6fr 1fr 1fr; }
}
@media (max-width: 820px) {
  .controls { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  header { padding: 76px var(--sp-4) 72px; }
  header:has(.site-name) { padding: 64px var(--sp-4) var(--sp-5); }
  header .sub { font-size: var(--fs-sm); }
  header .header-cta { font-size: var(--fs-2xs); padding: 6px 12px; }

  .controls {
    margin: -44px var(--sp-3) 0;
    padding: var(--sp-3) var(--sp-4) var(--sp-4);
    grid-template-columns: 1fr;
    gap: var(--sp-3);
    align-items: stretch;
  }
  /* On mobile, only the airline selector stays sticky at the top so
     users can switch airlines without scrolling back up. */
  .controls label:first-child {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface);
    margin: calc(-1 * var(--sp-3)) calc(-1 * var(--sp-4)) 0;
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--hairline);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }

  .legend { gap: var(--sp-2) var(--sp-2); }
  .legend .count { margin-left: 0; flex-basis: 100%; }

  main { padding: 0 var(--sp-3); gap: var(--sp-3); }
  table.fares th, table.fares td { padding: 8px 6px; }

  article.post .post-inner { padding: 0; }
  .blog-list article:first-of-type { padding: var(--sp-5); }
  .blog-list article:first-of-type h2 { font-size: 1.4rem; }
}

/* --- Reduced motion -------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .card:hover, .blog-list article:hover { transform: none; }
}
