/* AeroAtlas — design tokens and components. No build step: this file is served as-is. */

@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-latin-ext-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Brand palette (brief §3) */
  --navy: #0B1220;
  --navy-2: #142238;
  --blue: #2389E8;
  --cyan: #38C6E8;

  /* Light theme */
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #EEF2F7;
  --border: #DCE3EC;
  --text: #182438;
  --muted: #56667D;          /* darker than #718096 so small text passes WCAG AA */
  --faint: #718096;
  --link: #1A6FC2;           /* #2389E8 darkened for 4.5:1 on white */
  --primary: #2389E8;
  --primary-ink: #FFFFFF;
  --focus: #38C6E8;
  --ok: #157A4A;   --ok-bg: #E3F5EC;
  --warn: #8A5A00; --warn-bg: #FFF2D6;
  --info-bg: #E6F1FC;
  --shadow: 0 1px 2px rgba(11, 18, 32, .06), 0 4px 16px rgba(11, 18, 32, .05);

  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 6px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1180px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080F1C; --surface: #0B1220; --surface-2: #142238; --border: #22324B;
    --text: #E7EDF6; --muted: #A3B1C6; --faint: #7F8DA3; --link: #6CB6F5;
    --primary: #2389E8; --ok: #5FD39A; --ok-bg: #0F2A20; --warn: #F2C366; --warn-bg: #2E2410; --info-bg: #10233D;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #080F1C; --surface: #0B1220; --surface-2: #142238; --border: #22324B;
  --text: #E7EDF6; --muted: #A3B1C6; --faint: #7F8DA3; --link: #6CB6F5;
  --primary: #2389E8; --ok: #5FD39A; --ok-bg: #0F2A20; --warn: #F2C366; --warn-bg: #2E2410; --info-bg: #10233D;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.6 "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "tnum" 1;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 4.2vw, 44px); font-weight: 800; }
h2 { font-size: clamp(21px, 2.4vw, 26px); font-weight: 750; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.code { font-weight: 800; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.skip { position: absolute; inset-inline-start: -9999px; }
.skip:focus { inset-inline-start: 12px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.topbar .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.brand svg { width: 30px; height: 30px; flex: none; }
.nav { display: flex; gap: 4px; margin-inline-start: 8px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: var(--radius-sm); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-toggle { display: none; }
@media (max-width: 760px) {
  .menu-toggle { display: inline-grid; }
  .nav { display: none; position: absolute; top: 64px; inset-inline: 0; background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; padding: 8px var(--gutter) 16px; margin: 0; }
  .nav.open { display: flex; }
}

/* ---------- Buttons, badges ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: #1677D4; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--info-bg); color: var(--link); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-plain::before { display: none; }

/* ---------- Hero ---------- */
.hero { background: var(--navy); color: #E7EDF6; position: relative; overflow: hidden; }
.hero .wrap { position: relative; padding-block: clamp(48px, 9vw, 104px) clamp(40px, 7vw, 72px); }
.hero h1 { color: #fff; max-width: 20ch; }
.hero .lede { color: #B9C6D8; font-size: clamp(17px, 2vw, 19px); max-width: 52ch; margin-bottom: 28px; }
.hero-route { position: absolute; inset-inline-end: -40px; top: 0; height: 100%; width: min(56vw, 640px); pointer-events: none; opacity: .9; }
@media (max-width: 760px) { .hero-route { display: none; } }
.hero h1 .l { display: block; }
:root[data-theme="dark"] .hero { background: #0E1A2E; border-bottom: 1px solid var(--border); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { background: #0E1A2E; border-bottom: 1px solid var(--border); } }

/* ---------- Search ---------- */
.search { position: relative; max-width: 640px; }
.search-field { display: flex; align-items: center; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero .search-field { border-color: transparent; background: #FFFFFF; }
.hero .search-field input { color: #182438; }
.hero .search-field input::placeholder { color: #718096; }
@media (max-width: 560px) { .search-field input { font-size: 16px; padding: 14px 6px; } .search-field svg { margin-inline: 12px 2px; } .search-field .btn { padding: 0 14px; } }
.search-field svg { width: 20px; height: 20px; margin-inline: 16px 4px; color: var(--faint); flex: none; }
.search-field input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 18px; padding: 16px 8px; outline: none; }
.search-field .btn { margin: 6px; }
.search-field:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.search-hint { font-size: 14px; color: #93A3BA; margin-top: 12px; }
.search-hint button { all: unset; cursor: pointer; color: #D6E2F2; font-weight: 700; padding: 0 2px; border-bottom: 1px dashed rgba(214, 226, 242, .5); }
.search-hint button:focus-visible { outline: 2px solid var(--focus); }
.suggest { position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 30; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(11, 18, 32, .18); list-style: none; margin: 0; padding: 6px; display: none; max-height: 420px; overflow: auto; }
.suggest.open { display: block; }
.suggest li { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--surface-2); }
.suggest .code { font-size: 16px; }
.suggest .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest .where { font-size: 13px; color: var(--muted); white-space: nowrap; }
.suggest .section { grid-template-columns: 1fr; font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 12px 2px; cursor: default; }
.suggest .section:hover { background: none; }

/* ---------- AIRAC strip ---------- */
.airac { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .12); color: #B9C6D8; font-size: 15px; }
.airac strong { color: #fff; font-size: 17px; }

/* ---------- Sections & cards ---------- */
.section { padding-block: clamp(40px, 6vw, 72px); }
.section + .section { padding-top: 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head p { margin: 0; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.panel-pad { padding: 22px var(--px); }
:root { --px: clamp(16px, 2.4vw, 24px); }

.airport-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.airport-tile { display: block; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.airport-tile:hover { border-color: var(--primary); }
.airport-tile .code { font-size: 22px; display: block; }
.airport-tile .name { display: block; font-weight: 600; margin-top: 2px; }
.airport-tile .where { font-size: 14px; color: var(--muted); }

.sources { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.sources > div { padding: 24px clamp(18px, 3vw, 28px); }
.sources > div + div { border-inline-start: 1px solid var(--border); }
.sources h3 { display: flex; align-items: center; gap: 10px; }
.sources p { color: var(--muted); margin: 0; }
@media (max-width: 860px) { .sources { grid-template-columns: 1fr; } .sources > div + div { border-inline-start: 0; border-top: 1px solid var(--border); } }

.coverage { font-size: clamp(18px, 2.2vw, 21px); max-width: 60ch; }
.coverage strong { font-weight: 800; }

/* ---------- Airport page ---------- */
.airport-head { background: var(--surface); border-bottom: 1px solid var(--border); }
.airport-head .wrap { padding-block: 28px 24px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.ident { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
.ident .code { font-size: clamp(40px, 6vw, 56px); line-height: 1; }
.ident .iata { font-size: 20px; font-weight: 700; color: var(--muted); }
.ident h1 { font-size: clamp(20px, 2.6vw, 26px); font-weight: 700; margin: 0; flex-basis: 100%; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 18px 0 0; padding: 0; list-style: none; font-size: 15px; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-weight: 700; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; padding-block: 28px 56px; }
@media (max-width: 960px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.layout aside { display: flex; flex-direction: column; gap: 16px; }

.chart-group { margin-bottom: 8px; }
.chart-group h3 { font-size: 15px; color: var(--muted); font-weight: 700; margin: 0; padding: 14px var(--px) 8px; }
.chart-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 14px var(--px); border-top: 1px solid var(--border); }
.chart-row .title { font-weight: 700; }
.chart-row .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 14px; color: var(--muted); margin-top: 4px; }
.chart-row .actions { display: flex; gap: 8px; }
@media (max-width: 560px) { .chart-row { grid-template-columns: 1fr; } }

.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--info-bg); font-size: 15px; }
.notice-warn { background: var(--warn-bg); }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--link); }
.notice-warn svg { color: var(--warn); }
.notice p { margin: 0; }

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { border-top: 1px solid var(--border); }
.link-list li:first-child { border-top: 0; }
.link-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 14px var(--px); text-decoration: none; color: var(--text); }
.link-list a:hover { background: var(--surface-2); }
.link-list .label { font-weight: 700; }
.link-list .note { grid-column: 1; font-size: 14px; color: var(--muted); }
.link-list .ext { grid-row: 1 / span 2; grid-column: 2; color: var(--faint); width: 18px; height: 18px; }

table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td { text-align: start; padding: 10px var(--px); border-top: 1px solid var(--border); }
table.data th { font-size: 13px; color: var(--muted); font-weight: 700; border-top: 0; }
.table-scroll { overflow-x: auto; }

.side-card { padding: 20px var(--px); }
.side-card h2 { font-size: 16px; margin-bottom: 8px; }
.side-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.side-card dt { color: var(--muted); }
.side-card dd { margin: 0; font-weight: 700; }

/* ---------- Directory ---------- */
.country-cols { columns: 4 220px; column-gap: 28px; }
.country-cols h3 { break-after: avoid; font-size: 14px; color: var(--muted); margin: 18px 0 6px; }
.country-cols a { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; text-decoration: none; color: var(--text); break-inside: avoid; }
.country-cols a:hover { color: var(--link); }
.country-cols .n { color: var(--faint); font-size: 14px; }
.result-list { list-style: none; padding: 0; margin: 0; }
.result-list li + li { border-top: 1px solid var(--border); }
.result-list a { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px var(--px); color: var(--text); text-decoration: none; }
.result-list a:hover { background: var(--surface-2); }
.result-list .code { font-size: 18px; }
.result-list .where { color: var(--muted); font-size: 14px; }
@media (max-width: 560px) { .result-list a { grid-template-columns: 64px minmax(0, 1fr); } .result-list .size { display: none; } }
.pager { display: flex; gap: 8px; justify-content: center; padding: 20px; }

/* ---------- Ads (clearly labelled, never in the chart viewer) ---------- */
.ad { border: 1px dashed var(--border); border-radius: var(--radius); padding: 10px 14px 14px; background: var(--surface); }
.ad-label { display: block; font-size: 12px; font-weight: 700; color: var(--faint); margin-bottom: 8px; }
.ad a.sponsor { display: flex; flex-direction: column; gap: 2px; color: var(--text); text-decoration: none; }
.ad a.sponsor:has(img) { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center; }
.ad-banner a.sponsor { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }
.ad a.sponsor img { grid-row: span 2; width: 56px; height: 56px; object-fit: contain; border-radius: var(--radius-sm); }
.ad a.sponsor strong { font-size: 16px; }
.ad a.sponsor span { font-size: 14px; color: var(--muted); }
.ad-banner { margin-block: 8px; }

/* ---------- Prose pages ---------- */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-inline-start: 1.2em; }
.prose li { margin-bottom: .4em; }
.page-head { padding-block: 40px 8px; }

/* ---------- Footer ---------- */
.foot { background: var(--surface); border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.foot .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; padding-block: 32px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: flex-end; align-content: start; }
.foot nav a { color: var(--muted); }
.foot .disclaimer { margin: 0 0 8px; color: var(--text); }
@media (max-width: 760px) { .foot .wrap { grid-template-columns: 1fr; } .foot nav { justify-content: flex-start; } }

.flash { background: var(--info-bg); border-bottom: 1px solid var(--border); }
.flash .wrap { padding-block: 12px; font-weight: 600; }

/* ---------- Chart viewer ---------- */
.viewer-body { background: #3A4250; }
.viewer-bar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px var(--gutter); background: var(--surface); border-bottom: 1px solid var(--border); }
.viewer-bar .t { min-width: 0; flex: 1 1 260px; }
.viewer-bar .t strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-bar .t span { font-size: 13px; color: var(--muted); }
.viewer-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.viewer-tools output { min-width: 56px; text-align: center; font-weight: 700; font-size: 14px; }
.viewer-stage { overflow: auto; height: calc(100vh - 64px); touch-action: pan-x pan-y; cursor: grab; }
.viewer-stage.dragging { cursor: grabbing; }
.viewer-pages { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 16px; width: max-content; min-width: 100%; }
.viewer-pages canvas { background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); display: block; }
.viewer-page { position: relative; background: #fff; }
.viewer-pages .ph { display: grid; place-items: center; color: #56667D; font-size: 14px; }
.viewer-frame { width: 100%; height: calc(100vh - 64px); border: 0; background: #fff; display: block; }
.viewer-status { color: #E7EDF6; text-align: center; padding: 40px; }

/* ---------- Live map ---------- */
.live { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 65px); }
.live-panel { overflow: auto; border-inline-end: 1px solid var(--border); background: var(--surface); padding: 20px; }
.live-map { position: relative; }
#map { position: absolute; inset: 0; }
@media (max-width: 860px) { .live { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } .live-panel { order: 2; max-height: 45vh; border-inline-end: 0; border-top: 1px solid var(--border); } }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
