:root {
  --slide-w: 1280px;
  --slide-h: 720px;
  --label-w: 125px;
  --day-w: 217px;
  --green: #008000;
  --yellow: #ffff00;
  --red: #ff0000;
  --blue: #0000ff;
  --purple: #800080;
  --time-bg: #ffd9b8;
  --ink: #000;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #d9d9d9;
  font-family: "Arial Narrow", "Aptos Narrow", Arial, Helvetica, sans-serif;
  color: var(--ink);
}

.deck { display: grid; gap: 32px; justify-content: center; padding: 24px; }

.slide {
  position: relative;
  width: var(--slide-w);
  height: var(--slide-h);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}



/* ---------- matrix ---------- */
.matrix {
  position: absolute;
  top: 52px;
  bottom: 11.6px;   /* the legend always ends at y = 708.4, however many lines it takes */
  left: 50%;
  width: calc(var(--label-w) + var(--days) * var(--day-w));
  transform: translateX(-50%);
  display: flex; flex-direction: column;
}

.day-labels, .row {
  display: grid;
  grid-template-columns: var(--label-w) repeat(var(--days), var(--day-w));
}

.day-labels {
  flex: none; height: 39px; align-items: center; text-align: center;
  font-size: 28px; line-height: 34px; letter-spacing: -1.25px;
}

.grid { border: 1px solid #000; border-left: 0; }

.row { border-bottom: 1px solid #000; }
.row:last-child { border-bottom: 0; }

.label {
  display: flex; align-items: center; justify-content: flex-end; text-align: center;
  padding: 0 4px; font-weight: 700; font-size: 13px; line-height: 14px; letter-spacing: .1px;
}
.label.two { flex-direction: column; justify-content: space-evenly; }
.label.two span:first-child { font-size: 24px; line-height: 26px; }
.label.two span:last-child { font-size: 15px; line-height: 17px; letter-spacing: -.2px; }
.vert { writing-mode: vertical-rl; text-orientation: upright; font-size: 11px; line-height: 11px; letter-spacing: 0; margin: auto; }

.day { display: flex; border-left: 2px solid #000; min-width: 0; position: relative; }
.half { flex: 1 1 50%; min-width: 0; border-left: 1px solid #000; position: relative; overflow: hidden; }
.half:first-child { border-left: 0; }

/* row heights */
.r-icon { flex: 68.4 68.4 0; }
.r-precip { flex: 22 22 0; }
.r-temps { flex: 66 66 0; }
.r-chill { flex: 24 24 0; }
.r-winds { flex: 92 92 0; }
.r-dapa { flex: 22 22 0; }
.r-solar { flex: 70 70 0; }
.r-moon { flex: 34 34 0; }
.r-illum { flex: 18 18 0; }
.r-ops { flex: 17 17 0; }
.r-time { flex: 17 17 0; }
.r-temps, .r-winds, .r-solar, .r-moon, .r-illum, .r-ops, .r-time, .r-precip, .r-chill, .r-dapa, .r-icon { overflow: visible; }
.r-icon, .r-precip, .r-chill, .r-dapa, .r-temps, .r-winds { border-bottom-color: #000; }
.r-solar, .r-moon, .r-illum, .r-ops, .r-time { border-bottom-width: 0; }
.r-solar { border-bottom-width: 1px; }
.r-time.zulu { border-bottom: 0; }

/* forecast icons */
.r-icon .half { display: flex; align-items: center; justify-content: center; }
.r-icon svg { width: 100%; height: 100%; }

.precip { margin: auto; color: #00007a; font-weight: 700; font-size: 13px; }
.r-precip .half { display: flex; }

/* temps */
.r-temps .half { padding: 0 1px; }
.big { font-size: 19px; line-height: 26px; font-weight: 700; white-space: nowrap; letter-spacing: -.3px; }
.kv { display: flex; font-size: 12px; line-height: 14px; font-weight: 700; }
.kv span:first-child { width: 28px; }
.kv span:last-child { flex: 1; text-align: center; padding-right: 14px; }
.r-temps .lo { color: var(--blue); }
.r-temps .hi { color: var(--red); }
.r-temps .hi .kv span:last-child { padding-right: 20px; }

/* wind chill / heat index */
.r-chill .half { display: flex; align-items: center; }
.mini { font-size: 8px; line-height: 8px; font-weight: 400; padding-left: 1px; flex: none; }
.val { flex: 1; text-align: center; font-weight: 700; font-size: 16px; }
.r-chill .lo { color: var(--blue); }
.r-chill .hi { color: var(--red); }

/* winds / sky */
.r-winds .half { padding: 2px 0 0; text-align: center; font-weight: 700; }
.wind { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 8px; height: 38px; }
.arrow { width: 28px; height: 34px; flex: none; }
.spd { flex: 1; font-size: 13px; line-height: 14px; text-align: center; }
.vis { font-size: 12px; line-height: 14px; margin-top: 2px; }
.wx { font-size: 10px; line-height: 12px; margin-top: 3px; font-weight: 700; }

/* DA / PA */
.r-dapa .half { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.r-dapa b { color: var(--blue); margin-left: 3px; }

/* solar / lunar */
.r-solar .half.sol { display: grid; grid-template-columns: 1fr 1fr; align-content: center; row-gap: 4px; padding: 0 14px 0 4px; }
.r-solar .k { font-size: 11px; font-weight: 700; text-align: right; margin-right: 8px; align-self: center; }
.r-solar .v { color: var(--purple); font-size: 14px; align-self: center; }

/* dark / moon period */
.r-moon .half { display: flex; align-items: center; }
.r-moon .val { color: var(--purple); font-weight: 400; font-size: 14px; }

/* illumination */
.illum { position: relative; display: grid; grid-template-columns: repeat(24, 1fr); width: 100%; background: var(--yellow); }
.illum b { position: absolute; left: 1px; top: 1px; font-size: 11px; line-height: 14px; z-index: 1; }
.illum i { border-left: 1px solid rgba(0,0,0,.45); }
.illum i:first-of-type { border-left: 0; }
.illum i.y { background: var(--yellow); }
.illum i.o { background: #9a9a00; }
.illum i.k { background: #000; }

/* ops bars */
.track { display: grid; grid-template-columns: repeat(48, 1fr); width: 100%; background: var(--green); }
.seg { display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap;
  font-size: 9px; line-height: 1; font-weight: 700; border-left: 1px solid rgba(0,0,0,.35); min-width: 0; }
.seg.g { background: var(--green); }
.seg.y { background: var(--yellow); }
.seg.r { background: var(--red); }
.seg.n { background: #fff; border-left: 0; }

/* time scales */
.r-time .day { background: var(--time-bg); }
.r-time .label { padding-right: 3px; }
.scale { height: 100%; }
.scale .t { position: absolute; top: 0; line-height: 17px; font-size: 11px; font-weight: 700; transform: translateX(-50%); }
.scale .t0 { transform: none; margin-left: 2px; }
.scale .t4 { transform: translateX(-100%); margin-left: -2px; }

/* legend */
.legend { display: flex; justify-content: center; gap: 14px; height: 17px; align-items: center; font-size: 13px; font-weight: 700; margin-top: 1px; }

@media print {
  body { background: #fff; }
  .deck { display: block; padding: 0; }
  .slide { box-shadow: none; page-break-after: always; }
}

/* tweaks */
.r-ops .label, .r-time .label, .r-illum .label { white-space: nowrap; font-size: 12px; padding-right: 2px; letter-spacing: -.2px; }
.wind { height: 34px; }
.arrow { height: 30px; width: 26px; }
.vis { margin-top: 0; }
.wx { margin-top: 2px; font-size: 9.5px; line-height: 10px; }
.wx { white-space: nowrap; font-size: 9px; letter-spacing: -.2px; }
.big { font-size: 18px; }

/* integrated version: project PNG icons instead of inline SVG */
.r-icon .half img { position: absolute; left: 0; top: 0; box-sizing: border-box; width: 100%; height: 100%; object-fit: contain; padding: 0; transform: scale(1.4); }   /* the pictures have wide transparent margins, so they are enlarged to fill the row; taken out of the flow and sized by the row, so the picture never makes the row taller */

/* rows share a fixed-height grid in proportion to their weight, so hiding one grows the others */
.grid { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; }   /* 586.4 px with a one-line legend */
.grid > .row { min-height: 0; }
.row.is-hidden { display: none; }
.grid > .row:not(.is-hidden):last-of-type { border-bottom: 0; }

/* on-page row toggles (not printed) */
.toggles { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; padding: 10px 24px 0; font: 13px/1.4 system-ui, sans-serif; }
.toggles label { white-space: nowrap; cursor: pointer; }
@media print { .toggles { display: none; } }

/* day labels: the date, with the T offset beneath it */
.day-labels span { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.day-labels span small { font-size: 11px; letter-spacing: 0; font-weight: 700; margin-top: 2px; }
.toggles small { opacity: .65; }
.day.is-hidden-day, .day-labels span.is-hidden-day, .slide.is-hidden-day { display: none; }
.day-labels { height: 52px; letter-spacing: 0; }
/* the date is the big, bold part; the T offset is the small line beneath it */
.day-labels span b.date { font-size: 24px; line-height: 28px; font-weight: 900; letter-spacing: -.4px; }
.day-labels span small.tn { font-size: 16px; line-height: 18px; font-weight: 700; margin-top: 1px; letter-spacing: 0; }
.legend { flex: none; width: 100%; flex-wrap: wrap; justify-content: center; text-align: center; column-gap: 14px; row-gap: 0; }
.legend span { white-space: nowrap; }

/* operations bars: one editable cell per hour (click = colour, type = text) */
.track { grid-template-columns: repeat(24, 1fr); }
.cell { position: relative; border-left: 1px solid rgba(0, 0, 0, .25); cursor: pointer; user-select: none; min-width: 0; }
.cell:first-child { border-left: 0; }
.cell.g { background: var(--green); }
.cell.y { background: var(--yellow); }
.cell.r { background: var(--red); }
.cell.n { background: #fff; border: 0; cursor: default; }
.cell i { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 700 9px/1 Arial, sans-serif;
  white-space: nowrap; pointer-events: none; color: #000; z-index: 1; }
.cell.sel { outline: 2px solid #1a40ff; outline-offset: -2px; z-index: 2; }
.toggles .hint { flex-basis: 100%; text-align: center; opacity: .8; }
.toggles .hint button { font: inherit; margin-left: 8px; cursor: pointer; }
@media print { .cell.sel { outline: 0; } }

/* Pull Data button and its status line (not printed) */
.toggles.pull { align-items: center; gap: 12px; }
.toggles.pull button { font: 600 14px/1 system-ui, sans-serif; padding: 8px 18px; cursor: pointer; }
.toggles.pull button:disabled { cursor: progress; opacity: .6; }
#pull-status { opacity: .85; }

/* the school this report is for, top right of every slide: its right end is 30 px inside the right edge of the report,
   so it clears the top right crosshair, which sits just outside that edge */
.site-label {
  position: absolute; top: 18px; right: calc(50% - (var(--label-w) + var(--days) * var(--day-w)) / 2 + 30px); max-width: 700px; white-space: nowrap; text-align: right;
  font-size: 22px; line-height: 26px; font-weight: 900; letter-spacing: -.3px;
}
.site { display: grid; gap: 32px; justify-content: center; }
@media print { .site { display: block; } }

/* Crosshairs: six reference marks on every slide, so a screenshot tool always finds the same points. They follow the
   width of the report (the matrix: the label column plus one 217 px column per shown day, centred on the slide), so
   cutting between them takes in the whole report and its border: the left ones are centred 3 px outside the left
   edge of the report and the right ones 3 px outside the right edge, whatever the number of days (the page script
   sets --days when days are shown or hidden). Each crosshair is a 20 px box (centre = box + 10 px). Heights do not
   change: the top ones are centred at y = 16, the bottom ones at y = 710 (on the bottom edge of the slide, below the
   legend, which ends at y = 708.4), and hl and hr at y = 48, on the line between the heading (the school name, which
   ends at y = 44) and the day labels (which start at y = 52). With five days the report is 1210 px wide (125 px of row labels plus 5 x 217 px), so the
   centres are at x = 32 and x = 1248 on the 1280 x 720 slide. Cutting along the hl / hr line removes the heading
   and leaves the days. */
.crosshair { position: absolute; width: 20px; height: 20px; pointer-events: none; z-index: 5; }
.crosshair::before, .crosshair::after { content: ""; position: absolute; background: #ff00aa; }
.crosshair::before { left: 0; right: 0; top: calc(50% - 1px); height: 2px; }
.crosshair::after { top: 0; bottom: 0; left: calc(50% - 1px); width: 2px; }
.crosshair.tl, .crosshair.hl, .crosshair.bl { left: calc(50% - (var(--label-w) + var(--days) * var(--day-w)) / 2 - 13px); }
.crosshair.tr, .crosshair.hr, .crosshair.br { left: calc(50% + (var(--label-w) + var(--days) * var(--day-w)) / 2 - 7px); }
.crosshair.tl, .crosshair.tr { top: 6px; }
.crosshair.hl, .crosshair.hr { top: 38px; }
.crosshair.bl, .crosshair.br { bottom: 0; }

/* Larger text (owner request 2026-10-10: "everything is very small"). The day-label dates stay as they are. The row
   weights above add up to the grid height (586.4 px), so the larger rows are paid for by the forecast icon row and
   the operations rows; every size here was checked with the longest values that can occur. */
.label { font-size: 17px; line-height: 18px; }
.label.two span:first-child { font-size: 26px; line-height: 28px; }
.label.two span:last-child { font-size: 17px; line-height: 19px; }
/* WINDS lines up with the wind arrow and speed, SKY/VIS/WX CONDITIONS with the description (visibility, ceiling and weather) beneath them */
.label.two { justify-content: flex-start; align-items: stretch; padding-top: 2px; }
.label.two span { display: flex; align-items: center; justify-content: center; text-align: center; }
.label.two span:first-child { flex: none; height: 36px; }
.label.two span:last-child { flex: 1; }
.r-winds .half { display: flex; flex-direction: column; }
.wind { flex: none; }
.desc { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.r-ops .label, .r-time .label, .r-illum .label { font-size: 15.5px; line-height: 15px; letter-spacing: -.3px; }
.r-solar .label { font-size: 16px; line-height: 16.5px; }
.vert { writing-mode: horizontal-tb; text-orientation: mixed; font-size: 17px; line-height: 18px; letter-spacing: .1px; margin: 0; }
.precip { font-size: 16px; }
.big { font-size: 18px; line-height: 24px; }
.kv { font-size: 16px; line-height: 19px; }
.kv span:first-child { width: 34px; }
.r-temps .kv span:last-child, .r-temps .hi .kv span:last-child { padding-right: 4px; }
.mini { font-size: 10px; line-height: 10px; }
.val { font-size: 18px; }
.wind { height: 36px; }
.arrow { width: 28px; height: 34px; }
.spd { font-size: 16px; line-height: 17px; }
.vis { font-size: 13px; line-height: 16px; letter-spacing: -.3px; white-space: nowrap; }
.wx { font-size: 10.5px; line-height: 11px; margin-top: 1px; letter-spacing: -.2px; white-space: normal; }
.r-dapa .half { font-size: 12.5px; line-height: 16px; white-space: nowrap; }
.r-dapa .label { line-height: 18px; }
.r-solar .k { font-size: 14px; }
.r-solar .v { font-size: 17px; }
.r-moon .half { flex-direction: column; align-items: center; justify-content: center; }
.r-moon .val { flex: none; font-size: 17px; line-height: 19px; white-space: nowrap; }
.r-moon .mini { font-size: 12px; line-height: 13px; font-weight: 700; padding: 0; white-space: nowrap; }
.illum b { font-size: 13px; }
.cell i { font-size: 11px; }
.scale .t { font-size: 13px; line-height: 17px; }
/* 15 px; a narrow report (few days) sets it a little smaller, down to 11 px, so it wraps onto as few lines as possible */
.legend { font-size: clamp(11px, calc((var(--label-w) + var(--days) * var(--day-w) - 10px) * 1.8 / 65), 15px); line-height: 17px; height: auto; min-height: 17px; }
/* 24 px, smaller only when few days make the report too narrow for the longest school name to fit inside it */
.site-label { font-size: clamp(14px, calc((var(--label-w) + var(--days) * var(--day-w) - 60px) / 17.5), 24px); line-height: 28px; }
/* very long values (below -9 F, or 100 F and above for the heat index) are set a little smaller so they still fit */
.big.tight { font-size: 16px; }
.val.tight { font-size: 15px; }
.r-moon .val.tight { font-size: 14px; }

/* the week bar: which week the brief is for (not printed) */
.toggles.week { align-items: center; gap: 6px 14px; }
.toggles.week input[type="date"] { font: inherit; padding: 3px 6px; }
.toggles.week button { font: inherit; padding: 3px 12px; cursor: pointer; }
.toggles.week a { color: #1a40ff; text-decoration: none; white-space: nowrap; }
.toggles.week a:hover { text-decoration: underline; }
#week-label { font-weight: 700; }

/* Open-Meteo credit (required by its free terms); not printed, so the printed slides stay as they are */
.credit { padding: 8px 24px 24px; text-align: center; font: 12px/1.4 system-ui, sans-serif; opacity: .75; }
@media print { .credit { display: none; } }
