/* The monsoon page.
 *
 * Colour that carries meaning lives in monsoon.js, next to the reasoning about which
 * scale each job needs. What is here is layout and the recessive furniture — grid,
 * axes, tooltip — which should never compete with the marks. */

.mon section { margin: 30px 0; }
.mon-status { padding: 14px 16px; background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--saffron); border-radius: 4px; font-size: 14px; line-height: 1.5; }

/* --- The headline ---------------------------------------------------------- */
.hero-stat {
  display: flex; flex-wrap: wrap; gap: 22px 40px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 5px;
  padding: 20px 22px; margin: 22px 0 6px;
}
.hs-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
/* Tabular figures so the number does not jitter when it updates, and a tight
   line-height so the unit sits against the digits rather than floating. */
.hs-value { font-size: 54px; font-weight: 800; line-height: 1.02; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; margin: 2px 0 6px; }
.hs-unit { font-size: 26px; font-weight: 700; margin-left: 2px; color: var(--ink2); }
.hs-facts { display: grid; grid-template-columns: repeat(2, auto); gap: 12px 34px; margin: 4px 0 0; }
.hs-facts dt { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--mut); }
.hs-facts dd { margin: 1px 0 0; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* The class chip. `--c` is set inline from the diverging scale; the text is white on
   the darker classes and ink on the pale neutral, chosen by luminance rather than by
   listing every case. */
.cat-chip { display: inline-block; padding: 4px 11px; border-radius: 3px; font-size: 12px;
  font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--c, #b8b3a8);
  /* Text colour is set inline from textOn() in monsoon.js, by measured contrast. */
  border: 1px solid rgba(0,0,0,.18); }
.cat-chip.sm { padding: 2px 7px; font-size: 10.5px; }

/* --- The chart ------------------------------------------------------------- */
.chart-sub { font-size: 13px; color: var(--ink2); margin: -6px 0 12px; max-width: 70ch; }
.chart-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 5px; padding: 12px 14px 6px; }
.chart { position: relative; }
.chart svg { display: block; overflow: visible; }
.legend { display: flex; gap: 18px; margin: 0 0 6px 4px; font-size: 12.5px; color: var(--ink2); }
.lg { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
/* The normal is dashed as well as a different hue: identity never rests on colour
   alone, and this is the cheapest secondary encoding a line has. */
.sw.dash { background-image: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px); }

/* Grid and axes are furniture. They orient the eye and must not draw it. */
.grid line { stroke: var(--line2); stroke-width: 1; }
text.ax { font-size: 11px; fill: var(--mut); font-variant-numeric: tabular-nums; }
text.ax-title { font-size: 10px; fill: var(--mut); letter-spacing: .06em; text-transform: uppercase; }
.ln { stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ln.normal { stroke-dasharray: 6 5; }
text.endlab { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* The preliminary tail, marked rather than hidden: the reader is entitled to know
   which part of the curve has not been through the final gauge merge. */
rect.prelim { fill: var(--ink); opacity: .045; }
text.prelim-t { font-size: 10px; fill: var(--mut); letter-spacing: .08em; text-transform: uppercase; }

.cross { stroke: var(--ink2); stroke-width: 1; stroke-dasharray: 3 3; opacity: .5; }
.hp { stroke: #fff; stroke-width: 2; }
.hp.ha { fill: #0a5ca8; } .hp.hn { fill: #b07c2a; }
.tip { position: absolute; top: 8px; width: 190px; pointer-events: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  padding: 7px 9px; font-size: 12px; line-height: 1.45; box-shadow: 0 2px 8px rgba(0,0,0,.11); }
.tip b { display: block; margin-bottom: 3px; }
.tip span { display: flex; align-items: center; gap: 6px; color: var(--ink2); }
.tip i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.tip .tdep { margin-top: 3px; font-weight: 700; color: var(--ink); }

/* --- The departure table --------------------------------------------------- */
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.seg .btn.on { background: var(--sign); color: var(--sign-tx); border-color: var(--sign-dk); }
table.dep { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.dep th { text-align: left; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--mut); border-bottom: 2px solid var(--line); padding: 6px 8px; }
table.dep td { padding: 5px 8px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
table.dep td.num, table.dep th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.dep td.dep-n { font-weight: 700; }
table.dep a { color: var(--navy); text-decoration: none; }
table.dep a:hover { text-decoration: underline; }
a.side { font-size: 11px; color: var(--mut); margin-left: 8px; }
.flag { font-size: 10px; color: var(--mut); border: 1px solid var(--line);
  border-radius: 2px; padding: 0 4px; margin-left: 6px; cursor: help; }

/* The diverging bar. Zero is the centre of the cell and the bar grows either way, so
   sign is a direction rather than a colour the reader has to decode. */
th.bar-h { width: 34%; }
td.bar-c { position: relative; height: 22px; min-width: 150px; }
td.bar-c .axis { position: absolute; left: 50%; top: 3px; bottom: 3px; width: 1px; background: var(--line); }
td.bar-c .bar { position: absolute; top: 6px; height: 10px; border-radius: 2px; }

@media (max-width: 720px) {
  .hs-value { font-size: 42px; }
  .hs-facts { grid-template-columns: 1fr; }
  th.bar-h, td.bar-c { display: none; }
}

/* --- The ten-day outlook ----------------------------------------------------
   A forecast sits beside observations and must not be mistaken for one, so it is
   the last column, lighter, and its departure is a small second line rather than a
   figure of the same weight as the season's. */
th.fc-h, td.fc-c { text-align: right; white-space: nowrap; }
.fc { font-variant-numeric: tabular-nums; font-weight: 600; }
.fc small { font-weight: 400; color: var(--mut); }
.fcd { display: block; font-size: 10.5px; color: var(--mut); font-variant-numeric: tabular-nums; }
.fc.up { color: #08447a; } .fc.dn { color: #8c4a12; }
.hs-facts .hs-fc dd .fcd { display: inline; font-size: 12px; font-weight: 400; }
@media (max-width: 720px) { th.fc-h, td.fc-c { display: none; } }


/* ── this season in the record ─────────────────────────── */
/* A bar a year for the same calendar window, and this year last. The colour is the
   season line's, so the two charts agree about which mark means "now". */
.rank-line { font-size: 16px; line-height: 1.5; margin: 2px 0 14px; max-width: 72ch; }
.rank-line b { font-weight: 800; }
.rk-bar { fill: #b8b2a6; }
.rk-bar:hover { fill: #8d8578; }
.rk-bar.now { fill: #0a5ca8; }
.rk-med { stroke: #b07c2a; stroke-width: 1.5; stroke-dasharray: 5 4; }
.rk-medlab { fill: #b07c2a; font-weight: 700; }
.ax.now { font-weight: 800; fill: #0a5ca8; }
