/* midas-hourly.css: the Met Office's hourly rain gauges (includes/midas-hourly-page.php): the "Hour by hour" card on a
   storm page (storm.php) and the "Wettest hours on record" block on a historic gauge page (rainfall-historic.php, at the
   end of this file), which a rain gauge page also draws (rainfall-station-v2.php, "Wettest hours before our records
   began"). Linked only when a card or block is drawn (on a rain gauge page whenever MHR_ENABLED is true, since its script
   draws the block after the page is sent), never from styles.css: a rule there would change every page's styles.css?v=
   and so its bytes (plan docs/superpowers/plans/2026-11-20-met-office-hourly-rain.md, Global Constraints). The storm
   page is light only; its own --sp-* colours are used where it has one.

   The three lines' colours: the page's accent blue, then an orange and a green, checked together on white for colour
   blindness and contrast (each 3:1 or more against the card). They are told apart without colour too: the first solid,
   the second dashed, the third dotted, and the legend draws each the same way, so it reads in greyscale and a line lying
   along 0 does not hide the ones under it. The card comes after the archive's captions, so it keeps a gap above. */
.mhp-card { margin: 1.2rem 0; --mhp-c0: var(--sp-accent, #2563eb); --mhp-c1: #d9581f; --mhp-c2: #12916a; }
.mhp-peak { margin: 0 0 .7rem; font-size: .95rem; line-height: 1.5; }
.mhp-peak strong, .mhp-peaks strong { font-weight: 800; font-variant-numeric: tabular-nums; }
.mhp-card a { color: var(--sp-accent, #2563eb); text-decoration: none; font-weight: 600; }
.mhp-card a:hover { text-decoration: underline; }

/* The chart: inline SVG drawn on the server, scaled to the card. Its text is sized in drawing units, larger as the
   drawing shrinks, so it reads at about 10 to 11 px at every width; MHP_TEXT_MAX (23) is the largest size here, and the
   gutters and the date labels' thinning are worked out for it. */
.mhp-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.mhp-chart text { font-size: 9px; fill: var(--sp-muted, #5a6a7e); font-variant-numeric: tabular-nums; }
.mhp-grid { stroke: var(--sp-border, #e2e8f0); stroke-width: 1; }
.mhp-grid-0 { stroke: #b8c4d2; }
.mhp-day { stroke: #d5dde7; stroke-width: 1; stroke-dasharray: 2 3; }
.mhp-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.mhp-line.mhp-c0, .mhp-est.mhp-c0 { stroke: var(--mhp-c0); }
.mhp-line.mhp-c1, .mhp-est.mhp-c1 { stroke: var(--mhp-c1); }
.mhp-line.mhp-c2, .mhp-est.mhp-c2 { stroke: var(--mhp-c2); }
.mhp-line.mhp-c1 { stroke-dasharray: 7 4; }
.mhp-line.mhp-c2 { stroke-width: 2.5; stroke-dasharray: 0.1 5; }
.mhp-dot.mhp-c0 { fill: var(--mhp-c0); }
.mhp-dot.mhp-c1 { fill: var(--mhp-c1); }
.mhp-dot.mhp-c2 { fill: var(--mhp-c2); }
.mhp-est { fill: var(--sp-card, #fff); stroke-width: 1.5; }

/* The legend, under the chart, in HTML so it wraps and its names can link. */
.mhp-legend { list-style: none; margin: .7rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem 1.4rem; font-size: .88rem; line-height: 1.45; }
.mhp-leg { display: flex; align-items: baseline; gap: .45rem; min-width: 0; }
.mhp-key { flex: none; width: 1.75rem; height: .4rem; align-self: flex-start; margin-top: .5em; overflow: visible; }
.mhp-site { font-size: .82rem; font-weight: 600; white-space: nowrap; }
.mhp-leg-n { color: var(--sp-muted, #5a6a7e); font-variant-numeric: tabular-nums; }

/* A storm too long to draw: the highest hour at each of three gauges. */
.mhp-long { margin: 0 0 .4rem; font-size: .92rem; line-height: 1.55; color: var(--sp-text, #1a2332); }
.mhp-peaks { margin: 0; padding-left: 1.2rem; font-size: .92rem; line-height: 1.6; }

@media (max-width: 768px) { .mhp-chart text { font-size: 12px; } }
@media (max-width: 600px) {
    .mhp-chart text { font-size: 15px; }
    .mhp-chart .mhp-x-thin { display: none; }
    .mhp-dot, .mhp-est { r: 5px; }
    .mhp-leg-n { display: block; }   /* a gauge's figures under its name, never a line starting with the dot */
    .mhp-leg-n .mhp-sep { display: none; }
}
@media (max-width: 480px) { .mhp-chart text { font-size: 19px; } .mhp-dot, .mhp-est { r: 6px; } }
@media (max-width: 400px) { .mhp-chart text { font-size: 23px; } .mhp-dot, .mhp-est { r: 7px; } }

/* "Wettest hours on record" on a historic gauge page: a card of that page (rv2-card, its title, note, data note and
   credit), so it takes that page's look; the page is light only, and its --slate-* colours are used, with the same
   values as fallbacks. A list of six hours or more runs in two columns where the card is wide enough (five and five),
   one on a phone, and a shorter list in one (a browser without :has() keeps one column); the bursts sit under them,
   each wrapping as a whole; the set-aside hours are smaller and muted, apart from the list. */
.mhp-top { margin: 0; padding-left: 1.7rem; font-size: .85rem; line-height: 1.5; color: var(--slate-700, #334155); }
.mhp-top:has(> li:nth-child(6)) { columns: 19rem 2; column-gap: 3rem; }
.mhp-top li { break-inside: avoid; padding: .14rem 0; }
.mhp-top li::marker { color: var(--slate-500, #64748b); font-variant-numeric: tabular-nums; }
.mhp-top strong, .mhp-bursts strong { font-weight: 700; color: var(--slate-800, #1e293b); font-variant-numeric: tabular-nums; }
.mhp-bursts { display: flex; flex-wrap: wrap; gap: .3rem 1.75rem; margin: .8rem 0 0; padding-top: .7rem; border-top: 1px solid var(--slate-100, #f1f5f9);
    font-size: .85rem; line-height: 1.5; color: var(--slate-700, #334155); }
.mhp-aside { list-style: none; margin: .45rem 0 0; padding: 0; font-size: .72rem; line-height: 1.5; color: var(--slate-500, #64748b); }
.mhp-aside li + li { margin-top: .2rem; }
/* The credit line: the historic page's own .rh-credit values (rainfall-historic.php), given here too because a rain gauge
   page (rainfall-station-v2.php, whose script draws the same block from its stats answer) has no .rh-credit rule. */
.mhp-hours .rh-credit { margin: .8rem 0 0; font-size: 0.74rem; line-height: 1.5; color: var(--slate-600, #475569); }

/* The block on a rain gauge page (rainfall-station-v2.php's #moHourly, after its two-column rows). Above it the gap is a
   card's own 1.25rem and the rows' 1rem (the page keeps a card's margin inside .rv2-cols), so it keeps the same 2.25rem
   below. Its note takes the historic page's slate-500: that page's .rv2-card-subtitle colour, where this page's is the
   paler slate-400, which would make the gauge's name the palest text in the block. */
#moHourly .mhp-hours { margin-bottom: 2.25rem; }
#moHourly .rv2-card-subtitle { color: var(--slate-500, #64748b); }
