/* Aerodrome pages: the live weather block (#weather, .wx): observed values and
   the runway the wind favours. No METAR or TAF on the public site. Loaded AFTER
   aerodrome.css on the same pages and built on its custom properties
   (--sunken --surface --raised --high --content --secondary --tertiary --edge
   --edge-strong --accent --link --warning). Plain CSS, no fonts, no images.

   Colour marks the KIND of thing (the report's age, headwind, crosswind,
   tailwind). The one exception is the flight category, which carries the
   conventional VFR green / MVFR blue / IFR red / LIFR magenta (Stephane,
   2026-11-18), always with its name and the note that it is not a VMC call. Every kind also has its
   word in the markup, so nothing relies on colour alone.

   Cached for a year (firebase.json). The pages link this file with a content
   hash that landing-page/scripts/build_aerodrome_pages.py computes, so edit it
   and re-run the generator; never bump a version by hand. */

.wx {
  --wx-wind: #8CDBDF;
  --wx-head: #5B9BFF;
  --wx-cross: #3CC7C0;
  --wx-tail: #FF7A59;
  --wx-current: #8EE0AE;
  position: relative;
  overflow: hidden;                 /* nothing in the block may widen the page */
  border: 1px solid var(--edge-strong);
  border-radius: 14px;
  background: var(--surface);
  padding: 16px;
  margin: 22px 0 0;
}
.wx[hidden] { display: none !important; }

/* Heading row and the age pill */
.wx-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 0 0 6px; }
.wx-head h2 { margin: 0; }
.wx-age {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap;
  border: 1px solid var(--edge-strong); color: var(--secondary); background: var(--raised);
}
.wx-age--current { color: var(--wx-current); border-color: rgb(142 224 174 / 0.38); background: rgb(142 224 174 / 0.12); }
.wx-age--old { color: var(--warning); border-color: rgb(245 185 74 / 0.42); background: rgb(245 185 74 / 0.1); }
.wx-age--unknown { color: var(--secondary); border-color: var(--edge-strong); background: var(--raised); }

.wx .obs { font-size: 13px; color: var(--secondary); margin: 0 0 12px; }
.wx .obs.old {
  color: var(--warning); background: rgb(245 185 74 / 0.08); border: 1px solid rgb(245 185 74 / 0.3);
  border-radius: 8px; padding: 8px 10px;
}
.wx .obs.old strong { color: var(--warning); }
.wx .small { margin: 10px 0 0; }
.wx > .small { margin: 14px 0 0; }

/* Tiles */
.wx-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 0 0 14px; }
.wx-tile {
  position: relative; min-width: 0; display: flex; flex-direction: column; gap: 4px;
  padding: 11px 12px; border-radius: 12px;
  background: var(--raised); border: 1px solid var(--edge);
}
.wx-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tertiary); }
.wx-value { font-size: 20px; line-height: 1.2; font-weight: 700; color: var(--content); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wx-tile--wind { border-color: rgb(140 219 223 / 0.35); background: linear-gradient(135deg, rgb(140 219 223 / 0.12), var(--raised) 70%); padding-right: 52px; }
.wx-tile--wind .wx-label { color: var(--wx-wind); }
.wx-arrow { position: absolute; right: 12px; top: 50%; width: 30px; height: 30px; margin-top: -15px; color: var(--wx-wind); }

.wx-tile--cond { grid-column: span 2; }
@media (max-width: 420px) { .wx-tile--cond { grid-column: auto; } }
.wx-tile--fr .wx-value { display: inline-flex; align-items: center; gap: 8px; }
.wx-tile--fr .wx-value::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--fr); }
.wx-tile--fr { border-color: color-mix(in srgb, var(--fr) 45%, transparent); }
.wx-tile--vfr { --fr: #4CC38A; }
.wx-tile--mvfr { --fr: #5B9BFF; }
.wx-tile--ifr { --fr: #FF5C5C; }
.wx-tile--lifr { --fr: #D46BFF; }
.wx .wx-note { margin: -4px 0 14px; }

/* The runway box and its bars */
.wx-runway { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--edge-strong); }
.wx-runway-name { font-size: 18px; font-weight: 800; letter-spacing: 0.01em; color: var(--content); margin: 0 0 10px; }
.wx-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "track track"; gap: 4px 12px; align-items: baseline; margin: 0 0 10px; }
.wx-bar-label { grid-area: label; font-size: 13px; font-weight: 600; color: var(--secondary); }
.wx-bar-value { grid-area: value; font-size: 14px; font-weight: 700; color: var(--content); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wx-bar-track { grid-area: track; display: block; height: 10px; border-radius: 999px; background: var(--high); overflow: hidden; }
.wx-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--wx-head); }
.wx-bar--head .wx-bar-fill { background: var(--wx-head); }
.wx-bar--cross .wx-bar-fill { background: var(--wx-cross); }
.wx-bar--tail .wx-bar-fill { background: var(--wx-tail); }
.wx-bar--head .wx-bar-label { color: #9CC4FF; }
.wx-bar--cross .wx-bar-label { color: #7FE0DA; }
.wx-bar--tail .wx-bar-label { color: #FF9C82; }
@media (min-width: 560px) {
  .wx-bar { grid-template-columns: 12.5rem minmax(0, 1fr) 6.5rem; grid-template-areas: "label track value"; align-items: center; }
  .wx-bar-value { text-align: right; }
}

@media (max-width: 420px) {
  .wx { padding: 14px 12px; }
  .wx-value { font-size: 18px; }
}
