/* Shared by the app and the server-rendered pages (worker/site/): tokens, base, header, hero, footer and
   the content pages. App-only styles are in src/styles.css. */

:root {
  --bg: #000;
  --panel: #0b0c0e;
  --line: #24272c;
  --line-strong: #3a3f46;
  --text: #f5f5f7;
  --muted: #8b9098;
  --dim: #5b6068;
  --ok: #e9ecef;
  --out: #ff453a;
  --unknown: #bb9af7;
  --flight: #fff;
  --font: 'D-DIN', 'DIN Alternate', 'DIN Next', 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    sans-serif;
  --gutter: 16px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a {
  color: inherit;
}

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

.app {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) env(safe-area-inset-bottom)
    max(var(--gutter), env(safe-area-inset-left));
}

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

.top {
  display: flex;
  align-items: center;
  height: 64px;
  padding-top: env(safe-area-inset-top);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.32em;
}

.brand-sub {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- Hero ---- */

.hero {
  padding: 28px 0 8px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 7vw, 46px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.01em;
  max-width: 14em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 34em;
  font-size: 16px;
}

/* ---- Footer ---- */

footer {
  padding: 28px 0 40px;
  font-size: 12px;
  color: var(--dim);
  max-width: 60em;
}

footer p {
  margin: 0 0 8px;
}


/* ---- Site links and explainer under the app ---- */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text);
}

.site-info {
  margin-top: 40px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 32px;
  padding-bottom: 24px;
}

.info-grid h2 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.info-grid p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.info-grid a,
.site-page main a {
  color: var(--text);
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

code {
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

/* ---- Content pages (airlines, countries) and flight summaries before the app loads ---- */

.site-page main {
  max-width: 60em;
  padding-bottom: 32px;
}

.site-page h2,
.flight-summary h2 {
  margin: 32px 0 10px;
  font-size: 19px;
  font-weight: 600;
}

.site-page p {
  margin: 0 0 12px;
}

.answer {
  color: var(--text) !important;
  font-size: 17px !important;
  max-width: 40em !important;
}

.muted,
.count {
  color: var(--muted);
}

.count {
  margin-left: 6px;
  font-weight: 400;
}

.crumbs {
  padding-top: 20px;
  color: var(--muted);
  font-size: 13px;
}

.crumbs a {
  color: var(--muted) !important;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 20px;
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pill-off {
  color: var(--unknown);
  border-color: color-mix(in srgb, var(--unknown) 45%, transparent);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  background: var(--text);
  color: #000 !important;
  border: 1px solid var(--text);
  border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}

.cta-btn.ghost {
  background: transparent;
  color: var(--text) !important;
}

.table-wrap {
  overflow-x: auto;
  margin: 12px 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table-wrap th,
.table-wrap td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table-wrap thead th {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.table-wrap tbody tr:last-child > * {
  border-bottom: 0;
}

.table-wrap tbody th {
  font-weight: 600;
  white-space: nowrap;
}

.table-wrap td:last-child {
  color: var(--muted);
  min-width: 16em;
}

.code {
  margin-left: 4px;
  color: var(--dim);
  font-weight: 400;
  font-size: 12px;
}

.sources,
.evidence {
  margin: 0;
  padding-left: 18px;
}

.sources li {
  margin-bottom: 12px;
}

.evidence {
  margin-top: 6px;
  font-size: 13px;
}

blockquote {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.flight-summary {
  max-width: 44em;
  color: var(--muted);
}

.flight-summary b,
.flight-summary h2 {
  color: var(--text);
}

.route-places {
  padding-left: 18px;
  font-size: 14px;
}

.nw {
  white-space: nowrap;
}

.site-page .hero h1 {
  max-width: 18em;
}

/* Narrow screens: each table row becomes a stacked block. */
@media (max-width: 640px) {
  .table-wrap {
    overflow: visible;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
  }

  .table-wrap tr {
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }

  .table-wrap tbody tr:last-child {
    border-bottom: 0;
  }

  .table-wrap th,
  .table-wrap td,
  .table-wrap td:last-child {
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .table-wrap td {
    margin-top: 6px;
  }

  .table-wrap td[data-label]::before {
    content: attr(data-label) ': ';
    color: var(--muted);
  }
}

.date-check {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 20px 0 6px;
}

.date-check label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.date-check input {
  height: 44px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font: inherit;
}

.date-check .cta-btn {
  cursor: pointer;
}

.flight-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px 16px;
  padding: 0;
  list-style: none;
}
