/* METAR and TAF article: the decoder and the two figures.
 * Shares tokens with home.css / article.css. */
.widget.mt { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.mt-out, .mt-bar, .mt-strip { min-width: 0; }
.mt-in { width: 100%; min-width: 0; resize: vertical; padding: 12px 13px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); color: var(--ink); font: 600 16px/1.5 var(--mono); text-transform: uppercase; }
.mt-in:focus { outline: 2px solid var(--magenta); outline-offset: 1px; }
.mt-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mt-lbl { font-size: 14px; color: var(--ink-soft); }
.mt-chip, .mt-clear, .mt-load { font: 600 13px var(--mono); padding: 7px 11px; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; }
.mt-chip:hover, .mt-load:hover { border-color: var(--magenta); color: var(--magenta); }
.mt-clear { margin-left: auto; font-family: var(--body); color: var(--ink-soft); }
.mt-chip:focus-visible, .mt-clear:focus-visible, .mt-load:focus-visible, .mt-tok:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
.mt-out h4 { margin: 18px 0 8px; font: 500 12px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.mt-strip { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; border-radius: 10px; background: var(--paper-2); }

/* one colour per kind of group, used in the strip, the list and the figure */
.mt-tok { --c: var(--ink-soft); font: 600 14px/1.2 var(--mono); padding: 5px 7px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 12%, var(--card)); color: var(--ink); white-space: nowrap; }
button.mt-tok { cursor: pointer; }
.c-id { --c: #6b7280; }
.c-wind { --c: var(--blue); }
.c-vis { --c: #2f855a; }
.c-wx { --c: #c05621; }
.c-cloud { --c: #4a5fc1; }
.c-temp { --c: #b7791f; }
.c-press { --c: #0f766e; }
.c-trend { --c: var(--magenta); }
.c-sup { --c: #7c3aed; }
.c-unk { --c: #c53030; border-style: dashed; }

.prose .mt-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.prose .mt-list li { margin: 0; display: grid; grid-template-columns: minmax(0, auto) 1fr; column-gap: 12px; row-gap: 2px; align-items: baseline; padding: 8px 10px; border-radius: 8px; font-size: 16px; line-height: 1.5; }
.mt-list li.on { background: color-mix(in srgb, var(--magenta) 8%, transparent); }
.mt-list .mt-tok { grid-row: span 2; align-self: start; }
.mt-cat { font: 500 11px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.mt-txt { color: var(--ink); }
.mt-tbl td.mono { font: 600 14px var(--mono); }
.mt-v { display: inline-block; margin: 2px 6px 2px 0; padding: 4px 9px; border-radius: 999px; font: 600 13px/1.2 var(--body); }
.v-ok { background: color-mix(in srgb, #2f855a 16%, transparent); color: #276749; }
.v-svfr { background: color-mix(in srgb, #d69e2e 22%, transparent); color: #8a5a00; }
.v-below { background: color-mix(in srgb, #c53030 16%, transparent); color: #9b2c2c; }
.mt-out .w-note { margin-top: 10px; }
.quiz .mt-load { margin-top: 10px; }

/* figure 1: anatomy of a METAR */
.mt-fig-strip { display: flex; flex-wrap: wrap; gap: 6px 6px; justify-content: center; padding: 6px 0 2px; }
.mt-fig-strip .mt-tok { font-size: 15px; }
.prose .mt-legend { list-style: none; padding: 0; margin: 14px 4px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
.prose .mt-legend li { margin: 0; font-size: 14px; line-height: 1.4; display: flex; gap: 8px; align-items: baseline; }
.mt-legend .mt-tok { font-size: 12px; padding: 3px 6px; }

/* figure 2: how BECMG, TEMPO and FM change the weather over time */
.tl-axis { stroke: var(--ink-soft); stroke-width: 1.2; }
.tl-grid { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 4; }
.tl-min { stroke: var(--magenta); stroke-width: 1.4; stroke-dasharray: 6 5; }
.tl-line { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linejoin: round; }
.tl-band { fill: var(--magenta); opacity: 0.1; }
.tl-t { font: 500 12px var(--mono); fill: var(--ink-soft); }
.tl-th { font: 600 13px var(--mono); fill: var(--ink); }
.tl-tc { font: 600 12px var(--mono); fill: var(--magenta); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .v-ok { color: #8fd8a8; }
  :root:not([data-theme="light"]) .v-svfr { color: #f2c66d; }
  :root:not([data-theme="light"]) .v-below { color: #f5a3a3; }
}
:root[data-theme="dark"] .v-ok { color: #8fd8a8; }
:root[data-theme="dark"] .v-svfr { color: #f2c66d; }
:root[data-theme="dark"] .v-below { color: #f5a3a3; }

@media (max-width: 760px) {
  .prose .mt-list li { grid-template-columns: 1fr; }
  .mt-list .mt-tok { grid-row: auto; justify-self: start; }
  .mt-clear { margin-left: 0; }
  .widget.mt { padding: 14px; }
  .mt-tbl { font-size: 14px; }
  .prose .mt-tbl th, .prose .mt-tbl td { padding: 8px 6px; }
  .mt-tbl td.mono { font-size: 12px; }
  .mt-v { font-size: 12px; padding: 3px 7px; }
}
