/* Trueread portal (Trueread Noir): the day page (page-day) and the roster page (page-roster).
   - The week strip for choosing a day.
   - "Hour by hour": a bar per trading hour to drag through, as the website's hourly chart (Ash up to a usual hour,
     Sodium above it, Mercury for the gap below it), with a line that carries on down through the roster.
   - Bands behind the roster bars, as the website's roster track: people added are a 2px Sodium edge with 135°
     hatching, people taken off a 2px dashed Mercury edge with a 16% Mercury fill.
   Sodium means busier and Mercury quieter, and nothing else; each also has a sign, a position or words.
   The behaviour is in day.js. */

/* The roster timeline's role column (app.css: 112px, 64px on phones). The chart and the bands line up on it. */
:is(.page-day, .page-roster) { --tl-label: 112px; }
@media (max-width: 520px) { :is(.page-day, .page-roster) { --tl-label: 64px; } }

/* ---------------------------------------------------------------- week strip */
/* One cell per day, ruled. All of them across on a wide screen; on a phone the strip scrolls sideways, cell by cell.
   The day you are on is Gunmetal with a White rule along its top. */
.week-strip { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(64px, 1fr); gap: 0;
  margin: 0; padding: 0 0 4px; list-style: none; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--tr-line-strong) transparent; }
.week-strip > li { min-width: 0; scroll-snap-align: center; }
.week-strip > li + li .wk { box-shadow: inset 1px 0 0 var(--tr-line); }
.wk { display: grid; justify-items: center; gap: 6px; padding: 10px 4px; border: 0; border-radius: 0;
  color: var(--tr-text); text-decoration: none; font-variant-numeric: tabular-nums;
  transition: background-color var(--tr-dur-1, 120ms) linear; }
.wk:hover { background: var(--tr-well); text-decoration: none; }
.wk[aria-current="page"], .week-strip > li + li .wk[aria-current="page"] { background: var(--tr-well); box-shadow: inset 0 2px 0 var(--tr-text); }
.wk:focus-visible { outline-offset: -2px; }   /* the strip scrolls, so the ring sits inside the cell */
.wk-name { font-family: var(--tr-font-mono); font-size: 12px; line-height: 16px; letter-spacing: .02em; color: var(--tr-text-2); white-space: nowrap; }
.wk[aria-current="page"] .wk-name { color: var(--tr-text); }
.wk svg.i { width: 18px; height: 18px; color: var(--tr-text-2); }
.wk[aria-current="page"] svg.i, .wk:hover svg.i { color: var(--tr-text); }
.wk-change { font-family: var(--tr-font-mono); font-size: 12px; line-height: 16px; }
.wk-change:not(.busier):not(.quieter) { color: var(--tr-text-2); }
/* A day with staff to add or take off: a small White square (round is kept for a reading's dot). */
.wk-dot { display: inline-block; width: 6px; height: 6px; }
.wk-dot.on { background: var(--tr-text); }
.wk-key { margin-top: 10px; padding: 0 4px; color: var(--tr-text-2); font-size: 13px; line-height: 20px; text-wrap: pretty; }
.wk-key .wk-dot { margin: 0 4px; vertical-align: 1px; }
.page-day .day-intro { padding: 12px; }
/* Staffing against a usual day: the role, then its changes to tick off, on one baseline. */
.page-day .staff-moves > li { align-items: start; }
.page-day .staff-role { line-height: 20px; color: var(--tr-text); font-weight: 500; }
@media (min-width: 700px) {   /* beside its changes (portal-a.css), on the first tick's line */
  .page-day .staff-role { padding-top: 6px; }
}
@media (min-width: 700px) and (pointer: coarse) {
  .page-day .staff-role { padding-top: 12px; }
}
.page-roster .roster-intro nav { min-width: 0; }

/* ---------------------------------------------------------------- send to team */
.section-head .share-btn { margin-left: auto; align-self: center; }

/* ---------------------------------------------------------------- hour by hour: the chart to drag through */
.scrub-body { padding-bottom: 16px; }
/* What the chart says about the hour under the line. Two lines: the hour, its sales and weather, then people. */
.scrub-readout { margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--tr-line); font-variant-numeric: tabular-nums; }
/* Every item starts with a 16px middle dot; the line is pulled 16px left and clipped there, so the dot in front of
   the first item on each line (also after a wrap on a phone) is never seen. */
.ro-line { display: flex; flex-wrap: wrap; align-items: baseline; margin-left: -16px; clip-path: inset(0 0 0 16px); color: var(--tr-text-body); }
.ro-staff { min-height: 20px; margin-top: 6px; color: var(--tr-text-body); }
.ro-staff .busier, .ro-staff .quieter { font-family: var(--tr-font-mono); font-weight: 500; }
.ro-item { white-space: nowrap; }
.ro-item::before { content: "\00B7"; display: inline-block; width: 16px; text-align: center; color: var(--tr-ref); font-size: 14px; font-weight: 400; }
.ro-clock { font-family: var(--tr-font-mono); font-size: 14px; line-height: 28px; font-weight: 500; color: var(--tr-text-2); letter-spacing: .02em; margin-right: 4px; }
.ro-figure { font-size: 24px; line-height: 28px; font-weight: 400; font-stretch: 112.5%; letter-spacing: -0.01em; color: var(--tr-text); }
.ro-figure.busier { color: var(--tr-above); }
.ro-figure.quieter { color: var(--tr-below); }

/* The chart: the scale in the roster's role column, then the plot, the rain and the hours under it. */
.scrub { display: grid; grid-template-columns: var(--tl-label) minmax(0, 1fr); }
.scrub-scale { position: relative; font: var(--tr-axis); color: var(--tr-text-2); }
.scrub-scale span { position: absolute; right: 10px; transform: translateY(50%); white-space: nowrap; }
.scrub-plot { position: relative; height: 176px; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize; }
.scrub-plot::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--tr-line-strong); }   /* zero */
.scrub-plot:focus-visible { outline-offset: 4px; }
.scrub-grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--tr-data-grid, #1C1D1E); }
.scrub-col { position: absolute; top: 0; bottom: 0; transition: background-color var(--tr-dur-1, 120ms) linear; }
.scrub-col.on { background: var(--tr-well); }   /* the hour under the line */
/* A bar per hour, square, from zero to the forecast. About usual it is Ash. Busier, it is Ash up to the usual hour
   and Sodium above (a gradient split at --u, the usual hour's height as a share of the bar's); quieter, it is Ash and
   the gap up to the usual hour hangs from that line in Mercury. */
.scrub-bar { position: absolute; bottom: 0; left: 0; right: 0; width: calc(100% - 6px); max-width: 32px; margin: 0 auto; background: var(--tr-ref); }
.scrub-bar.busier { background: linear-gradient(to top, var(--tr-ref) calc(var(--u, 0) * 100%), var(--tr-above) calc(var(--u, 0) * 100%)); }
.scrub-bar.quieter::after { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: calc(var(--gap, 0) * 100%); background: var(--tr-below); }
/* A usual hour: a dashed White tick across the bar, a little wider than it. */
.scrub-usual { position: absolute; left: 0; right: 0; width: calc(100% - 2px); max-width: 40px; height: 2px; margin: 0 auto;
  background: repeating-linear-gradient(90deg, var(--tr-text) 0 3px, transparent 3px 6px); transform: translateY(50%); }
/* Temperature: a thin Silver line over the bars. */
.scrub-temp { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.scrub-temp polyline { fill: none; stroke: var(--tr-text-body); stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
/* The line that follows the pointer, finger or arrow keys, with a small square handle at the top. */
.scrub-line { position: absolute; top: -8px; bottom: 0; width: 2px; margin-left: -1px; background: var(--tr-text); pointer-events: none; }
.scrub-line::before { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; background: var(--tr-text); }
/* Rain: small Silver marks along the bottom, one, two or three for light, steady or heavy. */
.scrub-rain { position: relative; height: 16px; }
.drop { position: absolute; top: 4px; width: 2px; height: 6px; margin-left: -1px; background: var(--tr-text-body); }
.drop.d2 { margin-left: -3px; box-shadow: 4px 2px 0 0 var(--tr-text-body); }
.drop.d3 { box-shadow: -4px 2px 0 0 var(--tr-text-body), 4px 2px 0 0 var(--tr-text-body); }
.scrub-ticks { position: relative; height: 16px; font: var(--tr-axis); color: var(--tr-text-2); }
.scrub-ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.scrub-ticks span:first-child { transform: none; }
.scrub-ticks span[style*="left: 100"] { transform: translateX(-100%); }
/* What the marks mean: a swatch before each word, as the website's chart legend. */
.scrub-key { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 20px 0 0; padding: 0; list-style: none; color: var(--tr-text-2); font-size: 13px; line-height: 20px; }
.scrub-key li { display: inline-flex; align-items: center; gap: 8px; }
.scrub-key .key-bar { width: 10px; height: 10px; background: var(--tr-ref); }
.scrub-key .key-bar.busier { background: var(--tr-above); }
.scrub-key .key-bar.quieter { background: var(--tr-below); }
.scrub-key .key-usual { width: 16px; height: 2px; background: repeating-linear-gradient(90deg, var(--tr-text) 0 3px, transparent 3px 6px); }
.key-temp { width: 16px; height: 2px; background: var(--tr-text-body); transform: rotate(-20deg); }
.key-rain { width: 2px; height: 6px; margin-right: 4px; background: var(--tr-text-body); box-shadow: 4px 2px 0 0 var(--tr-text-body); }
/* The same hours as a table, behind "Show as a table". */
.scrub-table { border-top: 1px solid var(--tr-line); }
.scrub-table .table-note { padding: 0 var(--pad) 8px; color: var(--tr-text-2); font-size: 13px; line-height: 20px; }
.scrub-table .scroll { padding-bottom: 8px; }

/* ---------------------------------------------------------------- roster bars: the changes behind them */
.tl-group { position: relative; }
.tl-group + .tl-group { margin-top: 10px; }   /* in place of .tl-gap */
.tl-bands { position: absolute; top: -4px; bottom: 0; left: var(--tl-label); right: 0; pointer-events: none; }
.tl-band { position: absolute; top: 0; bottom: 0; border-radius: 0; }
.tl-band.add, .key-band.add { border: 2px solid var(--tr-above);
  background: repeating-linear-gradient(135deg, var(--tr-above) 0 1px, transparent 1px 6px); }
.tl-band.cut, .key-band.cut { border: 2px dashed var(--tr-below);
  background: rgba(143, 179, 207, .16); background: color-mix(in srgb, var(--tr-below) 16%, transparent); }
.tl-key { display: flex; flex-wrap: wrap; gap: 6px 24px; color: var(--tr-text-2); font-size: 13px; line-height: 20px; }
.tl-key > span { display: inline-flex; align-items: center; gap: 8px; }
.key-band { width: 18px; height: 12px; }
.tl-key .wk-dot { margin: 0 6px; }   /* as wide as a band's swatch, so the words line up */
.page-day .tl-key { margin-top: 8px; padding: 0 0 4px; }
.page-day .section-body > .tl { margin: -16px calc(var(--pad) * -1) 0; }   /* the timeline keeps its own padding */
.tl-ticks { font-family: var(--tr-font-mono); }

/* The hour from the chart, carried down through the shifts: a White line over the bars, and shifts not on at that
   hour step back. */
.tl-line { display: none; position: absolute; top: 40px; bottom: 12px; width: 2px; margin-left: -1px; pointer-events: none; background: var(--tr-text);
  left: calc(var(--pad) + var(--tl-label) + (100% - 2 * var(--pad) - var(--tl-label)) * var(--x, 0)); }
.tl.scrubbed .tl-line { display: block; }
.tl .tl-bar { transition: opacity var(--tr-dur-2, 240ms) var(--tr-ease, ease-out); }
.tl.scrubbing .tl-bar.off { opacity: .3; }

/* ---------------------------------------------------------------- the roster page: the fortnight, a day a panel */
.page-roster .roster-intro { display: grid; gap: 16px; }
.page-roster .roster-intro .tl-key { padding-top: 4px; }
/* The markup keeps one .panel for the fortnight and a .tile per day; in Noir a card never holds a card, so the
   outer sheet goes and each day is a Carbon panel of its own. */
.page-roster .roster-days { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 0; background: none; border: 0; overflow: visible; }
.page-roster .roster-day { background: var(--tr-surface); border: 1px solid var(--tr-line); scroll-margin-top: 88px; }   /* a jump link lands below the top bar */
.page-roster .roster-day .section-head h2 { font-size: 18px; line-height: 24px; }
.page-roster .roster-day .section-head h2 .day-link { color: var(--tr-text); }

/* Under each day, behind "Shift times": the same shifts as words, for a phone where a short bar has no room for its
   time; and the kitchen prep on the day page. Ruled rows, the name in Smoke, the figure in White. */
:is(.page-day, .page-roster) .shift-times { list-style: none; margin: 0; padding: 4px var(--pad) 16px; display: grid; gap: 0; font-variant-numeric: tabular-nums; }
:is(.page-day, .page-roster) .shift-times li { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--tr-line); }
:is(.page-day, .page-roster) .shift-times li > :last-child { font-family: var(--tr-font-mono); color: var(--tr-text); }
.page-day .section-body > .shift-times { padding: 0; border-top: 1px solid var(--tr-line-strong); }
.page-day .section-body > .shift-times li { grid-template-columns: minmax(0, 1fr) auto; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 860px) {
  .page-roster .roster-day { scroll-margin-top: 136px; }
}
@media (max-width: 520px) {
  .page-day .section-head .aside { margin-left: 0; }
  .section-head .share-btn { margin-left: 0; }
  .scrub-plot { height: 144px; }
  .scrub-ticks span:nth-child(even) { color: transparent; }   /* every second hour label goes, as on the roster */
  .ro-staff { min-height: 40px; }
  .ro-figure { font-size: 20px; }
  :is(.page-day, .page-roster) .shift-times li { grid-template-columns: 64px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .tl .tl-bar, .scrub-col, .wk { transition: none; }
  .week-strip { scroll-behavior: auto; }
}
@media (forced-colors: active) {
  .scrub-bar, .scrub-bar.busier, .scrub-key .key-bar { background: GrayText; }
  .scrub-bar.busier { background: linear-gradient(to top, GrayText calc(var(--u, 0) * 100%), CanvasText calc(var(--u, 0) * 100%)); }
  .scrub-bar.quieter::after { background: CanvasText; }
  .scrub-usual, .scrub-line, .scrub-line::before { background: Highlight; }
  .wk-dot.on { background: CanvasText; }
  .wk[aria-current="page"] { outline: 2px solid Highlight; outline-offset: -2px; }
}
