/* Trueread forecast page (Trueread Noir): today's update, the fortnight at a glance, days to act on, and the
   14 days. Loaded by overview.html after the shell (app.css, portal-a.css) and feature.css.
   Colour is a reading and nothing else: Sodium (--tr-above) where the forecast is above a usual day, Mercury
   (--tr-below) where it is below, Ash (--tr-about) within the usual band. Every one of them also has a sign, a
   position against the usual line, or words. */

/* ---------------------------------------------------------------- Today's update */
/* Today and tomorrow side by side, each under a Seam rule, not boxed: one level of container. */
.today-update .update-days { gap: 24px 40px; margin-top: 4px; }
.today-update .update-day { display: flex; flex-direction: column; padding: 16px 0 0; border: 0; border-top: 1px solid var(--tr-line-strong); background: none; }
.update-when { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 500; }
.update-when .day-link { color: var(--tr-text); font-size: 16px; line-height: 24px; }
.update-when .change { font-size: 16px; line-height: 24px; }
.update-sentence { margin-top: 8px; color: var(--tr-text-body); font-size: 15px; line-height: 24px; text-wrap: pretty; }
/* Who to add or take off: ruled rows, the role first (the line comes as one sentence). */
.today-update .update-staff { margin: 12px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--tr-line); }
.today-update .update-staff li { padding: 8px 0; border-bottom: 1px solid var(--tr-line); color: var(--tr-text); }
/* Send to team: the quiet button at the foot of each day, so the two line up. */
.update-share { margin-top: auto; padding-top: 16px; }
.today-update .note { margin-bottom: 12px; }

/* Since yesterday's forecast: a label, then ruled rows of before and after. */
.today-update .update-sub { margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--tr-line); font: var(--tr-label); letter-spacing: .02em; color: var(--tr-text-2); }
.today-update .update-sub.prose { font: var(--tr-small); color: var(--tr-text-2); }
.update-list.since { margin: 8px 0 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.update-list.since li { padding: 8px 0; border-bottom: 1px solid var(--tr-line); color: var(--tr-text-body); }
.update-list.since li + li { margin-top: 0; }
.update-list.since .day-link { display: block; }
.since-when { color: var(--tr-text); font-weight: 500; }
.since-old { font-family: var(--tr-font-mono); color: var(--tr-text-2); }
.since-new { display: inline-block; font-family: var(--tr-font-mono); font-weight: 500; text-align: right; }
.since-new:not(.busier):not(.quieter) { color: var(--tr-text); }
/* A figure that has just arrived fades in (forecast.js); it never counts up. */
.since-new.is-new { animation: since-in var(--tr-dur-2, 240ms) var(--tr-ease, ease-out) both; }
@keyframes since-in { from { opacity: 0; } }

/* ---------------------------------------------------------------- Fortnight at a glance */
/* One column a day: Ash up to a usual day, Sodium above it, Mercury for the gap below it (as the website's
   hourly chart). A day within 12% of usual is Ash to its forecast. The dashed Smoke tick either side of the bar
   is a usual day; the thin whisker is the likely range. Fourteen columns across, or two weeks of seven. */
.glance-body { container-type: inline-size; }
.glance-days { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.glance-days > li { min-width: 0; }

.glance-day { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0 10px;
  color: var(--tr-text); text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--tr-dur-1, 120ms) linear; }
.glance-day:hover { background: var(--tr-well); text-decoration: none; }
.glance-day.on { background: var(--tr-well); box-shadow: inset 0 1px 0 var(--tr-text); }   /* the day the readout shows */
.glance-day:focus-visible { outline-offset: -2px; }

/* The plot: Seam at zero, the shapes stood on it. Heights are inline, in % of the tallest figure. */
.glance-plot { position: relative; align-self: stretch; height: 136px; margin-bottom: 4px; box-shadow: 0 1px 0 var(--tr-line-strong); }
.glance-plot i { position: absolute; bottom: 0; left: 50%; display: block; transform: translateX(-50%); }
.glance-usual { width: min(84%, 34px);
  background: repeating-linear-gradient(90deg, var(--tr-data-ref-line, #9FA1A3) 0 3px, transparent 3px 6px) top / 100% 2px no-repeat; }
.glance-bar, .glance-over, .glance-short { width: min(44%, 18px); }
.glance-bar { background: var(--tr-ref); }
.glance-over { background: var(--tr-above); }
.glance-short { background: var(--tr-below); }
.glance-plot:not(.is-busier):not(.is-quieter) :is(.glance-over, .glance-short) { display: none; }   /* about usual */
/* The likely range, low to high: Void where it crosses the bar, Silver above it, with a cap at each end. */
.glance-range { width: 2px; background: linear-gradient(to top, var(--tr-bg) var(--dark, 0%), var(--tr-text-body) var(--dark, 0%)); }
.glance-range::before, .glance-range::after { content: ""; position: absolute; left: 50%; width: 8px; height: 2px; transform: translateX(-50%); }
.glance-range::before { top: 0; background: var(--tr-text-body); }   /* high */
.glance-range::after { bottom: 0; background: var(--tr-bg); }        /* low */
.glance-range.sunk::before { background: var(--tr-bg); }             /* the whole range lies inside the bar */
.glance-range.afloat::after { background: var(--tr-text-body); }     /* the whole range lies above it */

.glance-wd { font: var(--tr-axis); letter-spacing: .02em; color: var(--tr-text-2); }
.glance-date { font-family: var(--tr-font-mono); font-size: 14px; line-height: 20px; font-weight: 500; color: var(--tr-text); font-variant-numeric: tabular-nums; }
.glance-day svg.i { width: 16px; height: 16px; color: var(--tr-text-2); }
.glance-day.on svg.i, .glance-day:hover svg.i { color: var(--tr-text); }
.glance-day.on .glance-wd { color: var(--tr-text); }
/* Staff to add or take off: a small White square (round is kept for a reading's dot). */
.glance-dot { width: 6px; height: 6px; }
.glance-dot.on { background: var(--tr-text); }

/* The readout under the chart: the figures of the day tapped, focused or pointed at, on a Seam rule. */
.glance-readout.tile { margin-top: 12px; min-height: 44px; padding: 12px 0 0; border: 0; border-top: 1px solid var(--tr-line-strong); background: none;
  color: var(--tr-text-body); font-variant-numeric: tabular-nums; text-wrap: pretty; }
.glance-readout b { color: var(--tr-text); font-weight: 500; }
.glance-readout .arrow { margin-left: 8px; white-space: nowrap; }

/* How to read it: a swatch before each word, as the website's chart legend. */
.glance-key { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 16px 0 0; padding: 0; list-style: none;
  color: var(--tr-text-2); font-size: 13px; line-height: 20px; }
.glance-key li { display: inline-flex; align-items: center; gap: 8px; }
.glance-key i { display: block; flex: none; }
.key-usual { width: 16px; height: 2px; background: repeating-linear-gradient(90deg, var(--tr-data-ref-line, #9FA1A3) 0 3px, transparent 3px 6px); }
.key-bar, .key-over, .key-short { width: 10px; height: 10px; }
.key-bar { background: var(--tr-ref); }
.key-over { background: var(--tr-above); }
.key-short { background: var(--tr-below); }
.key-range { width: 8px; height: 12px;
  background: linear-gradient(var(--tr-text-body), var(--tr-text-body)) center / 2px 100% no-repeat,
              linear-gradient(var(--tr-text-body), var(--tr-text-body)) top / 8px 2px no-repeat,
              linear-gradient(var(--tr-text-body), var(--tr-text-body)) bottom / 8px 2px no-repeat; }
.key-dot { width: 6px; height: 6px; background: var(--tr-text); }

@container (max-width: 560px) {
  .glance-days { grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 12px; }
  .glance-plot { height: 104px; }
  .glance-usual { width: min(90%, 30px); }
}

/* ---------------------------------------------------------------- Days to act on */
/* The website's roster rows: the signed change in a column of its own, then the day in words, and the staffing
   changes to tick off beside it (under it on a phone). */
.page-forecast .acton { container-type: inline-size; padding: 0; border-top: 1px solid var(--tr-line-strong); margin: 16px var(--pad) 8px; }
.page-forecast .acton > li { grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "change day" "change what" ". why" "moves moves";
  gap: 4px 12px; align-items: baseline; padding: 16px 0; border-top: 0; border-bottom: 1px solid var(--tr-line); }
.page-forecast .acton > li:last-child { border-bottom: 0; }
.page-forecast .acton-change { font-size: 18px; line-height: 24px; text-align: left; }
.page-forecast .acton-day { color: var(--tr-text); font-size: 16px; line-height: 24px; font-weight: 500; }
.page-forecast .acton-what { color: var(--tr-text-body); }
.page-forecast .acton-why { color: var(--tr-text-2); }
.page-forecast .acton-why svg.i { width: 16px; height: 16px; color: var(--tr-text-2); }
.page-forecast .acton-moves { margin-top: 8px; font-weight: 400; }
.page-forecast .acton-moves > span { font-family: var(--tr-font-mono); }
@container (min-width: 720px) {
  /* A fourth, stretchy row takes the height of a long list of changes, so the day's own lines stay together. */
  .page-forecast .acton > li { grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto auto 1fr;
    grid-template-areas: "change day moves" ". what moves" ". why moves" ". . moves"; column-gap: 24px; }
  .page-forecast .acton-moves { margin-top: 0; }
}
/* Who to add or take off: the role in a column of its own, its changes beside it (wrapping under each other). */
ul.acton-staff { gap: 0; }
ul.acton-staff > li { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: start; column-gap: 8px; }
ul.acton-staff > li:not(:has(> b)) { display: block; margin-top: 4px; }
ul.acton-staff b { padding-top: 6px; line-height: 20px; color: var(--tr-text); font-weight: 500; }   /* on the first tick's line */
@media (pointer: coarse) { ul.acton-staff b { padding-top: 12px; } }
@media (max-width: 520px) { ul.acton-staff > li { grid-template-columns: 64px minmax(0, 1fr); } }

/* ---------------------------------------------------------------- the 14 days */
/* Column names in Red Hat Mono are wide, so they may take two lines; the figures under them set the widths. */
table.forecast thead th { white-space: normal; text-wrap: balance; }
table.forecast .range { font-size: 11px; line-height: 16px; letter-spacing: 0; }
.forecast .wx svg.i { width: 16px; height: 16px; color: var(--tr-text-2); }
.forecast td.strong .day-link { color: var(--tr-text); }

/* ---------------------------------------------------------------- the one line about savings */
.saving-line b { font-weight: 500; color: var(--tr-text); }

@media (max-width: 520px) {
  .glance-readout.tile { min-height: 64px; }   /* two lines, so the key under it doesn't jump on a phone */
  .page-forecast .acton { margin-left: var(--pad); margin-right: var(--pad); }
}
@media (prefers-reduced-motion: reduce) {
  .since-new.is-new { animation: none; }
  .glance-day { transition: none; }
}
@media (forced-colors: active) {
  .glance-bar, .key-bar { background: GrayText; }
  .glance-over, .glance-short, .key-over, .key-short, .glance-dot.on, .key-dot { background: CanvasText; }
  .glance-usual, .key-usual { background: CanvasText; height: 2px; }
  .glance-usual { background: linear-gradient(CanvasText, CanvasText) top / 100% 2px no-repeat; }
  .glance-range, .glance-range::before, .glance-range::after { background: Highlight; }
  .glance-day.on { outline: 2px solid Highlight; outline-offset: -2px; }
}
