/* Record pages (web/records/*.html, built by pipeline/build_records.py), on top of
   airport-page.css: the same panels, fonts and slate palette, plus the record charts. */

/* Back, one level up (records → map, a record → the records), then the brand */
.records .back { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 14px; font: 600 14px var(--ui); text-decoration: none; color: var(--ink); }
.records .back:hover { border-color: var(--accent); }
.records .top .brand { margin-right: auto; }

.records h3 { margin: 0; font-size: 17px; line-height: 1.25; text-wrap: balance; }
.rec-intro { display: grid; gap: 8px; justify-items: start; }
.rec-intro .code-big { font-size: clamp(56px, 11vw, 120px); }
.rec-intro .where { max-width: 44rem; }
.rec-hero .map { min-height: 0; padding: 14px; align-content: center; }

/* The record holder */
.champ { display: grid; gap: 2px; margin-top: 6px; }
.champ .k, .rec-card .k { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-text); font-weight: 700; }
.champ b { font: 800 clamp(36px, 6vw, 52px)/1 var(--display); letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.champ p { margin: 0; color: var(--ink-2); font-size: 14px; }
.rec-card .champ b { font-size: 30px; }

/* Index: one card per record */
.rec-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 16px; }
.rec-card { display: grid; gap: 10px; align-content: start; text-decoration: none; transition: border-color .15s, transform .15s; }
.rec-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.rec-card .mini { background: var(--map-bg); border-radius: 10px; padding: 10px; min-height: 120px; display: grid; align-items: center; }
.rec-card .mini .chart { max-height: 150px; }
.rec-card .mini .bars li { grid-template-columns: minmax(0, 7em) minmax(0, 1fr) 2.5em; font-size: 13px; }
.rec-card .mini .runways li { grid-template-columns: 3em minmax(0, 1fr); }
.rec-card .mini .runways b { display: none; }
.rec-card .mini .bagtags { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rec-card .mini .bagtag a { display: none; }
.rec-card .mini .bagtag b { font-size: 26px; }
.rec-card .mini .bagtag span { font-size: 11px; }
.rec-card .mini .polar text:not(.lbl) { display: none; }

/* World map with the ranked airports */
.world { width: 100%; height: auto; display: block; }
.world image { opacity: .9; }
.world circle { fill: var(--accent); stroke: var(--panel); stroke-width: 1; }
.world circle.top { fill: var(--ink); stroke: var(--accent); stroke-width: 3; }
.world text { font: 600 15px var(--mono); fill: var(--ink); paint-order: stroke; stroke: var(--map-bg); stroke-width: 4px; }

/* Charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--mono); text-anchor: middle; }
.chart .c { font-size: 12px; font-weight: 600; fill: var(--ink); }
.chart .v { font-size: 10px; fill: var(--ink-3); }
.chart .lbl { font: 500 10px var(--ui); fill: var(--ink-3); }
.peaks .mtn { fill: var(--rw); stroke: var(--panel); stroke-width: 1.5; stroke-linejoin: round; }
.peaks .snow { fill: #fff; opacity: .9; }
.peaks .base { stroke: var(--ink-3); }
.sea .water { fill: #3d8bd9; opacity: .18; }
.sea .sealine { stroke: #3d8bd9; stroke-width: 1.5; stroke-dasharray: 5 4; }
.sea .col { fill: var(--accent); }
.sea .col.below { fill: #3d8bd9; }
.polar .disc { fill: var(--map-bg); }
.polar .ring { fill: none; stroke: var(--ink-3); stroke-opacity: .35; }
.polar .pole { fill: var(--ink-3); }
.polar circle:not(.disc, .ring, .pole) { fill: var(--accent); stroke: var(--panel); stroke-width: 1; }
.polar circle.top { fill: var(--ink); stroke: var(--accent); stroke-width: 2.5; }
.polar text:not(.lbl) { font-size: 10px; font-weight: 600; fill: var(--ink); text-anchor: start; paint-order: stroke; stroke: var(--map-bg); stroke-width: 3px; }
.polar .lbl { text-anchor: start; }

/* Runways to scale: tarmac, a dashed centreline and threshold bars */
.runways { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.runways li { display: grid; grid-template-columns: 3.4em minmax(0, 1fr) 6.5em; gap: 10px; align-items: center; }
.runways .code { font-size: 14px; }
.runways b { font: 600 13px var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.strip {
  display: block; width: var(--w); height: 16px; border-radius: 2px; background:
    linear-gradient(90deg, #fff 0 3px, transparent 3px calc(100% - 3px), #fff calc(100% - 3px)) center / 100% 60% no-repeat,
    repeating-linear-gradient(90deg, #fff 0 10px, transparent 10px 20px) center / calc(100% - 16px) 2px no-repeat,
    #3b4a5e;
}

/* Funny codes as luggage tags */
.bagtags { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 12px; }
.bagtag { position: relative; display: grid; gap: 2px; padding: 14px 12px 12px 12px; border-radius: 6px 6px 6px 18px; background: var(--accent); color: var(--accent-ink); }
.bagtag::before { content: ""; position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--panel); box-shadow: inset 0 0 0 2px rgb(0 0 0 / 25%); }
.bagtag b { font: 800 36px/1 var(--display); letter-spacing: .04em; }
.bagtag span { font-weight: 600; font-size: 13px; }
.bagtag a { font-size: 12px; opacity: .75; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bagtag a:hover { text-decoration: underline; }

/* Countries: bars beside the hero text */
.side-bars { background: var(--map-bg); padding: 20px; display: grid; align-content: center; }

/* Full ranking */
.records td.n { color: var(--ink-3); width: 2.5em; }
.records td.code { font: 600 13px var(--mono); }
.records td.a { white-space: normal; }
.records td.a a { text-decoration: none; font-weight: 500; }
.records td.a a:hover { color: var(--accent-text); }
.records td.a small { display: block; }
.records td.v { font-family: var(--mono); font-size: 13px; }

/* Airport history: a line of years, then the events grouped by year */
.history h2 a { text-decoration: none; }
.history h2 a:hover { color: var(--accent-text); }
.history .note { margin: 0 0 8px; }
.axis-wrap { background: var(--map-bg); border-radius: 10px; padding: 6px 10px; margin-bottom: 14px; }
.axis { width: 100%; height: auto; display: block; }
.axis .spine, .axis .tick { stroke: var(--ink-3); stroke-width: 1.5; }
.axis .stem { stroke: var(--ink-3); stroke-opacity: .5; }
.axis .hub { fill: var(--ink-3); }
.axis .lbl { font: 600 11px var(--mono); fill: var(--ink-2); }
.axis circle.ok { fill: #22a565; }
.axis circle.sad { fill: #e0533d; }
.axis a:hover circle.ok, .axis a:hover circle.sad { stroke: var(--ink); stroke-width: 2; }
.events { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 10px; }
.ev { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--tile); text-decoration: none; height: 100%; transition: border-color .15s; }
.ev:hover { border-color: var(--accent); }
.ev .when { display: grid; justify-items: center; gap: 4px; }
.ev .yr { font: 800 22px/1 var(--display); letter-spacing: .02em; }
.ev .ico { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: rgb(34 165 101 / 16%); font-size: 15px; }
.ev .ico.sad { background: rgb(224 83 61 / 16%); }
.ev .txt { display: grid; gap: 2px; min-width: 0; }
.ev b { font-size: 15px; line-height: 1.25; }
.ev small { color: var(--ink-3); font-size: 12.5px; }
.ev small .code { color: var(--ink); background: var(--panel); border-radius: 4px; padding: 0 4px; }
.ev p { margin: 2px 0; font-size: 13.5px; color: var(--ink-2); }
.ev em { font-style: normal; font-size: 12.5px; font-weight: 600; color: #1b8f56; }
.ev em.sad { color: #c8432f; }
.ev .go { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 13px; }

@media (prefers-color-scheme: dark) {
  .ev em { color: #4fd18f; }
  .ev em.sad { color: #ff8a73; }
}

@media (max-width: 560px) {
  .runways li { grid-template-columns: 3em minmax(0, 1fr) 5.6em; gap: 8px; }
  .runways b { font-size: 12px; }
  .records th:nth-child(2), .records td.code { display: none; }
  .events { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .rec-card, .ev { transition: none; }
  .rec-card:hover { transform: none; }
}
