@import url('tokens.css?v=2');

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--oxblood-600);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--dur-fast) var(--ease-quart);
}

a:hover {
  color: var(--oxblood-800);
}

:focus-visible {
  outline: 2.5px solid var(--oxblood-600);
  outline-offset: 3px;
  border-radius: 1px;
}

::selection {
  background: var(--ochre-100);
  color: var(--ink-900);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.shell {
  width: min(100% - 2.5rem, var(--shell));
  margin-inline: auto;
}

.shell-wide {
  width: min(100% - 2.5rem, var(--shell-wide));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 200;
  padding: var(--sp-2xs) var(--sp-s);
  background: var(--oxblood-800);
  color: var(--paper);
  transform: translateY(-120%);
  transition: transform var(--dur-fast) var(--ease-quart);
}

.skip-link:focus {
  transform: translateY(0);
}

.eyebrow {
  font-family: var(--font-text);
  font-size: var(--step--2);
  font-weight: 620;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* ==========================================================================
   Masthead. This is where the boldness lives.
   ========================================================================== */

.masthead {
  position: relative;
  background: var(--oxblood-900);
  color: var(--oxblood-050);
  padding-block: clamp(var(--sp-xl), 9vw, var(--sp-3xl)) var(--sp-2xl);
  overflow: hidden;
}

/* A single hairline grid, not decoration for its own sake: it echoes the
   Eixample street grid the whole trip is organised around. */
.masthead::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, oklch(1 0 0 / 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, oklch(1 0 0 / 0.055) 1px, transparent 1px);
  background-size: 4.5rem 4.5rem;
  mask-image: radial-gradient(ellipse 80% 70% at 72% 30%, #000 20%, transparent 78%);
  pointer-events: none;
}

.masthead > * {
  position: relative;
}

.masthead .eyebrow {
  color: var(--ochre-400);
}

.masthead-title {
  font-family: var(--font-display);
  font-size: var(--step-6);
  font-weight: 700;
  font-variation-settings: 'SOFT' 0, 'WONK' 1, 'opsz' 144;
  line-height: 0.86;
  letter-spacing: -0.028em;
  margin-block: var(--sp-m) var(--sp-s);
  max-width: 16ch;
  text-wrap: balance;
}

.masthead-title em {
  font-style: italic;
  font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 144;
  color: var(--ochre-400);
}

.masthead-standfirst {
  font-size: var(--step-1);
  line-height: 1.5;
  max-width: 46ch;
  color: oklch(0.90 0.020 30);
  margin-bottom: var(--sp-l);
}

/* Constraint strip: the fixed facts that bound every plan. */
.constraints {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1px;
  margin-top: var(--sp-xl);
  background: oklch(1 0 0 / 0.12);
  border: 1px solid oklch(1 0 0 / 0.12);
}

.constraint {
  background: var(--oxblood-900);
  padding: var(--sp-s) var(--sp-m) var(--sp-m);
}

.constraint dt {
  font-size: var(--step--2);
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: oklch(0.78 0.045 30);
  margin-bottom: var(--sp-2xs);
}

.constraint dd {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.constraint dd small {
  display: block;
  font-family: var(--font-text);
  font-size: var(--step--1);
  font-weight: 400;
  letter-spacing: 0;
  color: oklch(0.80 0.030 30);
  margin-top: var(--sp-3xs);
}

/* ==========================================================================
   Control bar. Sticky, always reachable, quiet.
   ========================================================================== */

.controls {
  position: sticky;
  top: 0;
  z-index: 100;
  background: oklch(0.982 0.0055 62 / 0.93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-strong);
}

.controls-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-s) var(--sp-m);
  padding-block: var(--sp-2xs);
  min-height: 3.5rem;
}

.controls-group {
  display: flex;
  align-items: center;
  gap: var(--sp-2xs);
}

.controls-label {
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

.controls-spacer {
  margin-left: auto;
}

/* Segmented control */
.segmented {
  display: inline-flex;
  border: 1.5px solid var(--ink-800);
  border-radius: var(--radius-s);
  overflow: hidden;
}

.segmented button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.34rem 0.8rem;
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-700);
  transition: background var(--dur-fast) var(--ease-quart),
    color var(--dur-fast) var(--ease-quart);
}

.segmented button + button {
  border-left: 1.5px solid var(--ink-800);
}

.segmented button[aria-pressed='true'] {
  background: var(--ink-900);
  color: var(--paper);
}

.segmented button:not([aria-pressed='true']):hover {
  background: var(--ink-100);
}

/* Toggle switch with a persistent text label, never colour alone */
.switch {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2xs);
  cursor: pointer;
  font-size: var(--step--1);
  font-weight: 550;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  position: relative;
  flex: none;
  width: 2.55rem;
  height: 1.4rem;
  border: 1.5px solid var(--ink-800);
  border-radius: 999px;
  background: var(--paper-raised);
  transition: background var(--dur-mid) var(--ease-quart);
}

.switch-track::after {
  content: '';
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 0.92rem;
  height: 0.92rem;
  border-radius: 50%;
  background: var(--ink-800);
  transition: transform var(--dur-mid) var(--ease-expo),
    background var(--dur-mid) var(--ease-quart);
}

.switch input:checked + .switch-track {
  background: var(--safe-fg);
  border-color: var(--safe-fg);
}

.switch input:checked + .switch-track::after {
  transform: translateX(1.13rem);
  background: var(--paper);
}

.switch input:focus-visible + .switch-track {
  outline: 2.5px solid var(--oxblood-600);
  outline-offset: 3px;
}

/* ==========================================================================
   Section furniture
   ========================================================================== */

.section {
  padding-block: var(--sp-2xl);
  border-top: 1px solid var(--rule);
}

.section-head {
  margin-bottom: var(--sp-xl);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 640;
  font-variation-settings: 'SOFT' 0, 'WONK' 1, 'opsz' 96;
  line-height: 1.0;
  letter-spacing: -0.024em;
  margin-block: var(--sp-2xs) var(--sp-s);
  max-width: 22ch;
  text-wrap: balance;
}

.section-intro {
  max-width: var(--measure);
  color: var(--fg-muted);
  font-size: var(--step-1);
  line-height: 1.58;
}

/* ==========================================================================
   Compare table. The spine of the page. Deliberately calm.
   ========================================================================== */

/* Both axes scroll inside this box, which makes it the containing block for
   the sticky header and the sticky first column. That is deliberate: it gives
   a frozen header row and a frozen label column, so you can read any cell
   without losing track of which plan and which row you are in. */
.compare-scroll {
  overflow: auto;
  overscroll-behavior: contain;
  max-height: min(78vh, 46rem);
  border: 1px solid var(--rule-strong);
  background: var(--bg-raised);
}

.compare {
  border-collapse: collapse;
  width: 100%;
  min-width: 62rem;
  font-size: var(--step--1);
}

.compare th,
.compare td {
  text-align: left;
  padding: var(--sp-xs) var(--sp-s);
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.compare thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--ink-900);
  color: var(--paper);
  font-size: var(--step--2);
  font-weight: 620;
  letter-spacing: 0.04em;
  vertical-align: bottom;
  padding-block: var(--sp-s);
}

/* The corner cell freezes on both axes, so it must outrank both. */
.compare thead th:first-child {
  left: 0;
  z-index: 30;
  border-right: 1px solid var(--rule-strong);
}

.compare tbody th {
  position: sticky;
  left: 0;
  z-index: 10;
  background: var(--bg-sunken);
  font-weight: 600;
  font-size: var(--step--2);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--fg-muted);
  white-space: nowrap;
  border-right: 1px solid var(--rule-strong);
  width: 12rem;
}

.compare tbody tr:hover td {
  background: var(--ochre-100);
}

.compare-plan-name {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 640;
  line-height: 1.08;
  letter-spacing: -0.015em;
  display: block;
  margin-bottom: 0.15rem;
}

.compare-plan-region {
  display: block;
  font-family: var(--font-text);
  font-size: var(--step--2);
  font-weight: 450;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ochre-400);
}

.compare th a,
.compare th a:hover {
  color: inherit;
  text-decoration: none;
}

.compare th a:hover .compare-plan-name {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.compare-verdict td {
  background: var(--oxblood-050);
  font-size: var(--step--1);
  line-height: 1.5;
}

/* ==========================================================================
   Plan sections
   ========================================================================== */

.plan {
  border-top: 3px solid var(--ink-900);
  padding-block: var(--sp-2xl);
  scroll-margin-top: 4.5rem;
}

.plan-head {
  display: grid;
  gap: var(--sp-m);
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: end;
  margin-bottom: var(--sp-xl);
}

@media (max-width: 62rem) {
  .plan-head {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

.plan-index {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--oxblood-600);
}

.plan-title {
  font-family: var(--font-display);
  font-size: var(--step-5);
  font-weight: 680;
  font-variation-settings: 'SOFT' 0, 'WONK' 1, 'opsz' 120;
  line-height: 0.92;
  letter-spacing: -0.028em;
  margin-block: var(--sp-2xs) var(--sp-s);
  text-wrap: balance;
}

.plan-thesis {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--fg-muted);
  max-width: 44ch;
}

/* The tradeoff is stated plainly and given real weight. */
.plan-tradeoff {
  border-left: 0;
  border-top: 2px solid var(--oxblood-700);
  padding-top: var(--sp-s);
}

.plan-tradeoff dt {
  font-size: var(--step--2);
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oxblood-700);
  margin-bottom: var(--sp-2xs);
}

.plan-tradeoff dd {
  font-size: var(--step-0);
  line-height: 1.55;
}

.plan-body {
  display: grid;
  gap: var(--sp-xl) var(--sp-l);
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
}

@media (max-width: 62rem) {
  .plan-body {
    grid-template-columns: 1fr;
  }
}

.subhead {
  font-family: var(--font-text);
  font-size: var(--step--2);
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  padding-bottom: var(--sp-2xs);
  border-bottom: 1px solid var(--rule-strong);
  margin-bottom: var(--sp-m);
}

/* ==========================================================================
   Timeline
   ========================================================================== */

.day {
  padding-block: var(--sp-m);
  border-bottom: 1px solid var(--rule);
}

.day-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-2xs) var(--sp-s);
  margin-bottom: var(--sp-s);
}

.day-date {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 640;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.day-label {
  font-size: var(--step--1);
  color: var(--fg-subtle);
}

.day-tag {
  margin-left: auto;
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oxblood-600);
}

.slots {
  display: grid;
  gap: var(--sp-2xs);
}

.slot {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr);
  gap: var(--sp-s);
  padding-block: var(--sp-3xs);
}

@media (max-width: 32rem) {
  .slot {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

.slot-time {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  color: var(--oxblood-600);
  font-weight: 550;
  padding-top: 0.12em;
}

.slot-what {
  font-weight: 550;
}

.slot-detail {
  color: var(--fg-muted);
  font-size: var(--step--1);
  line-height: 1.5;
}

.slot-travel .slot-what {
  font-weight: 450;
  color: var(--fg-muted);
  font-style: italic;
}

/* ==========================================================================
   Food-safety flags. Colour plus icon plus label, always all three.
   ========================================================================== */

.flag {
  display: inline-flex;
  align-items: center;
  gap: 0.32em;
  padding: 0.1em 0.5em 0.14em;
  border: 1px solid;
  border-radius: var(--radius-s);
  font-size: var(--step--2);
  font-weight: 620;
  letter-spacing: 0.03em;
  white-space: nowrap;
  vertical-align: 0.08em;
}

.flag::before {
  font-weight: 700;
}

.flag-safe {
  color: var(--safe-fg);
  background: var(--safe-bg);
  border-color: var(--safe-rule);
}

.flag-safe::before {
  content: '\2713'; /* check */
}

.flag-caution {
  color: var(--caution-fg);
  background: var(--caution-bg);
  border-color: var(--caution-rule);
}

.flag-caution::before {
  content: '?';
}

.flag-avoid {
  color: var(--avoid-fg);
  background: var(--avoid-bg);
  border-color: var(--avoid-rule);
}

.flag-avoid::before {
  content: '\00D7'; /* multiplication sign */
}

/* Filter state: suppressed, never silently removed. */
.gf-filtering .gf-caution,
.gf-filtering .gf-avoid {
  opacity: 0.34;
  filter: saturate(0.25);
}

.gf-filtering .gf-avoid {
  text-decoration: line-through;
  text-decoration-color: var(--avoid-rule);
}

.gf-suppressed-note {
  display: none;
}

.gf-filtering .gf-suppressed-note {
  display: block;
  font-size: var(--step--1);
  color: var(--fg-muted);
  padding: var(--sp-2xs) 0;
}

/* ==========================================================================
   Food list
   ========================================================================== */

.food {
  display: grid;
  gap: var(--sp-s);
}

.food-item {
  padding-bottom: var(--sp-s);
  border-bottom: 1px solid var(--rule);
}

.food-name {
  font-weight: 620;
  font-size: var(--step-0);
  margin-right: 0.4em;
}

.food-meta {
  font-size: var(--step--2);
  color: var(--fg-subtle);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-block: 0.15rem;
}

.food-note {
  font-size: var(--step--1);
  color: var(--fg-muted);
  line-height: 1.5;
}

/* ==========================================================================
   Cost tables. Quiet, tabular, honest about the two buckets.
   ========================================================================== */

.costs {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}

.costs th,
.costs td {
  padding: var(--sp-2xs) var(--sp-2xs);
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

.costs td:last-child,
.costs th:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.costs caption {
  text-align: left;
  font-size: var(--step--2);
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  padding-bottom: var(--sp-2xs);
}

.costs tbody th {
  font-weight: 450;
}

.costs .subtotal th,
.costs .subtotal td {
  border-top: 1.5px solid var(--ink-800);
  border-bottom: 0;
  font-weight: 680;
  font-size: var(--step-0);
  padding-top: var(--sp-2xs);
}

.costs .per-head th,
.costs .per-head td {
  border-bottom: 0;
  color: var(--fg-muted);
  font-size: var(--step--2);
}

/* Budget meter against the $3,500 accommodation cap */
.budget-meter {
  margin-top: var(--sp-m);
}

.budget-bar {
  position: relative;
  height: 0.65rem;
  background: var(--ink-200);
  border: 1px solid var(--rule-strong);
  overflow: hidden;
}

.budget-fill {
  height: 100%;
  background: var(--safe-fg);
  transition: width var(--dur-slow) var(--ease-expo);
}

.budget-fill.over {
  background: var(--avoid-fg);
}

.budget-legend {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-s);
  margin-top: var(--sp-2xs);
  font-size: var(--step--2);
  color: var(--fg-muted);
}

/* ==========================================================================
   Gallery
   ========================================================================== */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--sp-2xs);
  margin-top: var(--sp-s);
}

.shot {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--ink-200);
}

.shot:first-child {
  grid-column: span 2;
  aspect-ratio: 16 / 9;
}

@media (max-width: 40rem) {
  .shot:first-child {
    grid-column: auto;
    aspect-ratio: 4 / 3;
  }
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-expo);
}

.shot:hover img {
  transform: scale(1.035);
}

.shot figcaption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: var(--sp-m) var(--sp-2xs) var(--sp-2xs);
  background: linear-gradient(to top, oklch(0.19 0.016 30 / 0.85), transparent);
  color: var(--paper);
  font-size: var(--step--2);
  line-height: 1.35;
}

/* Missing-image state: the frame says so rather than showing a broken icon. */
.shot-missing {
  display: grid;
  place-content: center;
  gap: var(--sp-3xs);
  padding: var(--sp-s);
  text-align: center;
  background: var(--ink-100);
  border: 1px dashed var(--rule-strong);
  color: var(--fg-subtle);
  font-size: var(--step--2);
}

/* ==========================================================================
   Notes and votes
   ========================================================================== */

.notes {
  margin-top: var(--sp-l);
  padding: var(--sp-m);
  background: var(--bg-sunken);
  border: 1px solid var(--rule-strong);
}

.notes-grid {
  display: grid;
  gap: var(--sp-s);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-top: var(--sp-s);
}

.note-person {
  display: grid;
  gap: var(--sp-2xs);
}

.note-name {
  font-size: var(--step--2);
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.note-person textarea {
  width: 100%;
  min-height: 4.5rem;
  padding: var(--sp-2xs);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-s);
  background: var(--paper-raised);
  font-size: var(--step--1);
  line-height: 1.5;
  resize: vertical;
}

.vote-row {
  display: flex;
  gap: var(--sp-3xs);
}

.vote-btn {
  flex: 1;
  appearance: none;
  cursor: pointer;
  padding: 0.28rem 0.4rem;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius-s);
  background: var(--paper-raised);
  font-size: var(--step--2);
  font-weight: 620;
  transition: all var(--dur-fast) var(--ease-quart);
}

.vote-btn:hover {
  border-color: var(--ink-700);
}

.vote-btn[aria-pressed='true'] {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: var(--paper);
}

.saved-flash {
  font-size: var(--step--2);
  color: var(--safe-fg);
  opacity: 0;
  transition: opacity var(--dur-mid) var(--ease-quart);
}

.saved-flash.on {
  opacity: 1;
}

/* ==========================================================================
   Callouts
   ========================================================================== */

.callout {
  padding: var(--sp-m);
  border: 1px solid var(--rule-strong);
  background: var(--bg-raised);
  margin-block: var(--sp-m);
}

.callout-alert {
  border-color: var(--avoid-rule);
  background: var(--avoid-bg);
}

.callout-note {
  border-color: var(--ochre-500);
  background: oklch(0.975 0.020 82);
}

.callout h3 {
  font-family: var(--font-text);
  font-size: var(--step--2);
  font-weight: 680;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: var(--sp-2xs);
}

.callout p + p {
  margin-top: var(--sp-2xs);
}

.callout p {
  font-size: var(--step--1);
  line-height: 1.55;
  max-width: var(--measure);
}

/* ==========================================================================
   Prose
   ========================================================================== */

.prose p,
.prose li {
  max-width: var(--measure);
  line-height: 1.65;
}

.prose p + p {
  margin-top: var(--sp-s);
}

.prose ul {
  display: grid;
  gap: var(--sp-2xs);
  margin-top: var(--sp-s);
}

.prose ul li {
  padding-left: 1.15em;
  position: relative;
}

.prose ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.38em;
  height: 1.5px;
  background: var(--oxblood-600);
}

.prose h3 {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 640;
  letter-spacing: -0.015em;
  margin-top: var(--sp-l);
  margin-bottom: var(--sp-2xs);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.colophon {
  background: var(--ink-900);
  color: var(--ink-300);
  padding-block: var(--sp-xl);
  font-size: var(--step--1);
}

.colophon a {
  color: var(--ochre-400);
}

.colophon p {
  max-width: var(--measure);
}

.colophon p + p {
  margin-top: var(--sp-s);
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  .controls,
  .notes,
  .skip-link,
  .gallery {
    display: none !important;
  }

  body {
    background: #fff;
    font-size: 10pt;
  }

  .masthead {
    background: #fff;
    color: #000;
    padding-block: 0 1rem;
  }

  .masthead::before {
    display: none;
  }

  .masthead-title,
  .constraint dd {
    color: #000;
  }

  .constraint {
    background: #fff;
  }

  .plan {
    break-before: page;
    padding-block: 1rem;
  }

  .compare {
    min-width: 0;
    font-size: 8pt;
  }

  .compare thead th {
    position: static;
    background: #eee;
    color: #000;
  }

  a::after {
    content: ' (' attr(href) ')';
    font-size: 7pt;
    color: #555;
    word-break: break-all;
  }
}

/* ==========================================================================
   Page navigation. Twelve pages, so the nav has to carry the whole map
   without dominating. Horizontal scroll on narrow screens.
   ========================================================================== */

.pagenav {
  background: var(--ink-900);
  color: var(--ink-300);
  border-bottom: 1px solid var(--oxblood-800);
}

.pagenav-inner {
  display: flex;
  align-items: stretch;
  gap: var(--sp-2xs);
}

.pagenav-scroll {
  flex: 1;
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.pagenav-links {
  display: flex;
  gap: 0;
  min-width: max-content;
}

.pagenav-link {
  display: flex;
  align-items: center;
  white-space: nowrap;
  padding: var(--sp-xs) var(--sp-s);
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-400);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  scroll-snap-align: start;
  transition: color var(--dur-fast) var(--ease-quart),
    border-color var(--dur-fast) var(--ease-quart);
}

.pagenav-link:hover {
  color: var(--paper);
  border-bottom-color: var(--oxblood-500);
}

.pagenav-link.is-current {
  color: var(--paper);
  border-bottom-color: var(--ochre-500);
}

.pagenav-arrow {
  display: grid;
  place-content: center;
  flex: none;
  width: 2.6rem;
  color: var(--ochre-400);
  text-decoration: none;
  font-size: var(--step-1);
  transition: background var(--dur-fast) var(--ease-quart);
}

.pagenav-arrow:hover {
  background: var(--oxblood-800);
  color: var(--paper);
}

.pagenav-arrow[aria-disabled='true'] {
  opacity: 0.25;
  pointer-events: none;
}

/* Prev / next at the foot of each page */
.steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-s);
  padding-block: var(--sp-xl);
  border-top: 1px solid var(--rule);
}

.step {
  display: grid;
  gap: var(--sp-3xs);
  padding: var(--sp-m);
  border: 1px solid var(--rule-strong);
  text-decoration: none;
  color: var(--fg);
  transition: border-color var(--dur-fast) var(--ease-quart),
    background var(--dur-fast) var(--ease-quart);
}

.step:hover {
  border-color: var(--oxblood-600);
  background: var(--oxblood-050);
}

.step-next {
  text-align: right;
}

.step-label {
  font-size: var(--step--2);
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

.step-name {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 640;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

/* Slimmer masthead on the interior pages */
.masthead-slim {
  padding-block: var(--sp-xl) var(--sp-l);
}

.masthead-title-slim {
  font-size: var(--step-4);
  max-width: 20ch;
}

/* ==========================================================================
   Flight timeline. Vertical, one entry per leg, layovers included as
   first-class entries because the connection is the risky part.
   ========================================================================== */

.journey {
  padding-block: var(--sp-l) var(--sp-xl);
  border-top: 1px solid var(--rule);
}

.journey-critical {
  border-top: 3px solid var(--oxblood-700);
}

.journey-head {
  margin-bottom: var(--sp-l);
}

.journey-name {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 660;
  line-height: 1.05;
  letter-spacing: -0.022em;
}

.journey-date {
  font-size: var(--step-0);
  color: var(--fg-muted);
  margin-top: var(--sp-3xs);
}

.journey-total {
  font-size: var(--step--1);
  color: var(--oxblood-600);
  font-weight: 600;
  margin-top: var(--sp-2xs);
}

.legs {
  display: grid;
  gap: 0;
  position: relative;
}

.leg {
  position: relative;
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: var(--sp-s);
  padding-bottom: var(--sp-m);
}

/* The connecting rail */
.leg::before {
  content: '';
  position: absolute;
  left: 0.44rem;
  top: 0.9rem;
  bottom: -0.2rem;
  width: 2px;
  background: var(--rule-strong);
}

.leg:last-child::before {
  display: none;
}

.leg-marker {
  position: relative;
  z-index: 1;
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.5rem;
  border-radius: 50%;
  background: var(--oxblood-700);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1.5px var(--oxblood-700);
}

.leg-layover .leg-marker {
  background: var(--bg);
  box-shadow: 0 0 0 1.5px var(--ink-400);
}

.leg-body {
  min-width: 0;
}

.leg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-2xs) var(--sp-s);
  margin-bottom: var(--sp-s);
}

.leg-flightno {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--oxblood-700);
}

.leg-carrier {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

.leg-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--sp-s);
  align-items: center;
  padding: var(--sp-s) 0;
  border-block: 1px solid var(--rule);
}

@media (max-width: 34rem) {
  .leg-route {
    grid-template-columns: 1fr;
    gap: var(--sp-2xs);
  }
  .endpoint-arr {
    text-align: left;
  }
}

.endpoint-arr {
  text-align: right;
}

.endpoint-time {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 660;
  line-height: 1;
  letter-spacing: -0.02em;
}

.endpoint-date {
  font-size: var(--step--2);
  color: var(--fg-subtle);
  margin-top: 0.1rem;
}

.endpoint-code {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--oxblood-600);
  margin-top: var(--sp-2xs);
}

.endpoint-name {
  font-size: var(--step--1);
  font-weight: 550;
}

.endpoint-terminal {
  font-size: var(--step--2);
  color: var(--fg-muted);
}

.leg-duration {
  display: grid;
  justify-items: center;
  gap: var(--sp-3xs);
  min-width: 5.5rem;
}

.leg-line {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--rule-strong);
  position: relative;
}

.leg-line::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -3px;
  border-left: 6px solid var(--rule-strong);
  border-block: 3.5px solid transparent;
}

.leg-duration-text {
  font-size: var(--step--2);
  font-variant-numeric: tabular-nums;
  color: var(--fg-subtle);
  letter-spacing: 0.04em;
}

.leg-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: var(--sp-2xs) var(--sp-s);
  margin-top: var(--sp-s);
}

.leg-facts dt {
  font-size: var(--step--2);
  font-weight: 620;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

.leg-facts dd {
  font-size: var(--step--1);
  line-height: 1.45;
}

/* Fare rows swap with the cabin toggle */
.fact-economy { display: none; }
body.cabin-economy .fact-business { display: none; }
body.cabin-economy .fact-economy { display: block; }

.leg-note {
  font-size: var(--step--1);
  line-height: 1.55;
  color: var(--fg-muted);
  margin-top: var(--sp-s);
  max-width: var(--measure);
}

.leg-layover-head {
  font-size: var(--step-0);
  padding-top: 0.35rem;
}

.leg-layover .leg-note {
  margin-top: var(--sp-2xs);
}

/* Fallback options table */
.fallbacks {
  padding-block: var(--sp-l) var(--sp-xl);
  border-top: 1px solid var(--rule);
}

.fallback-table th[scope='row'] {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--oxblood-700);
}

.fallback-table td:last-child,
.fallback-table th:last-child {
  text-align: left;
  white-space: normal;
}

.fallback-verdict {
  min-width: 16rem;
}

.rank-good td,
.rank-good th {
  background: var(--safe-bg);
}

.rank-bad td,
.rank-bad th {
  background: var(--avoid-bg);
}

@media print {
  .pagenav,
  .steps {
    display: none !important;
  }
}
