/* Go Roam: the meals chapter made explorable (give-explore.js). Laid over give.css's drawing, never edited into it: the
   deck keeps byte-identical copies of give.css and give.js. Loaded after landing.css. */

/* ---------- the parts: a cell or a part's label is a target; while its card is up the other parts step back ---------- */
.ch-meals .gcells i,.ch-meals .gkeep,.ch-meals .gp-m,.ch-meals .gp-p,.ch-meals .gx{pointer-events:auto}
.gcells i,.gkeep,.gp-m,.gp-p{cursor:default}
@media (pointer:coarse){ .gcells i,.gkeep,.gp-m,.gp-p{cursor:pointer} }   /* WebKit sends a tap's click only to what looks clickable */
/* one paper veil over each part's cells, over the ink and the cells both; shown on the parts not being read */
.gx-v{grid-row:3;z-index:2;background:var(--paper);opacity:0;pointer-events:none;transition:opacity var(--m-exit) var(--ease)}
.gx-v.k{grid-column:1/span var(--keep,5)}
.gx-v.m{grid-column:calc(var(--keep,5) + 1)/span var(--meals,4)}
.gx-v.p{grid-column:-2/-1}
.gkeep,.ggive,.gp-m,.gp-p{transition:opacity var(--m-exit) var(--ease)}
.give:has([data-tip="g-keep"][aria-describedby]) :is(.gx-v.m,.gx-v.p),
.give:has([data-tip="g-meals"][aria-describedby]) :is(.gx-v.k,.gx-v.p),
.give:has([data-tip="g-partner"][aria-describedby]) :is(.gx-v.k,.gx-v.m),
.give:has([data-tip="half"][aria-describedby]) .gx-v.k{opacity:.62;transition:opacity var(--m-state) var(--ease)}
.give:has([data-tip="g-keep"][aria-describedby]) :is(.ggive,.gp-m,.gp-p),
.give:has([data-tip="g-meals"][aria-describedby]) :is(.gkeep,.ggive,.gp-p),
.give:has([data-tip="g-partner"][aria-describedby]) :is(.gkeep,.ggive,.gp-m),
.give:has([data-tip="half"][aria-describedby]) .gkeep{opacity:.38;transition:opacity var(--m-state) var(--ease)}

/* ---------- the choice: how many routes to imagine buying ---------- */
/* One axis for the three things a visitor reads together, the bowls, the caption under them and the key that chooses how
   many: the page's own, the one the headline stands on, at every count. The projection lines still run from the "School
   meals" cells to the ends of the bowls, wherever they stand. */
.gx{grid-row:7;grid-column:1/-1;justify-self:center;width:max-content;display:flex;align-items:center;gap:16px;margin:32px 0 0}
.gx-l{white-space:nowrap;font-size:var(--t-14);color:var(--muted);letter-spacing:.01em}
.gx-seg{position:relative;display:grid;grid-template-columns:repeat(3,1fr);padding:3px;border:1.5px solid var(--rule-strong);border-radius:10px;background:var(--field)}
.gx-ink{position:absolute;left:3px;top:3px;bottom:3px;width:calc((100% - 6px) / 3);border-radius:7px;background:var(--ink);
  transform:translateX(calc(var(--i,0) * 100%));transition:transform var(--m-enter) var(--ease)}
.gx-seg label{position:relative;display:grid;place-items:center;min-height:44px;padding:0 18px;border-radius:7px;font-size:var(--t-16);font-weight:600;
  color:var(--muted);white-space:nowrap;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:color var(--m-state) var(--ease)}
.gx-seg label span{transition:transform var(--m-enter) var(--ease-pop)}
.gx-seg label:hover{color:var(--ink);transition-duration:var(--m-hover)}
.gx-seg label:has(:checked){color:var(--paper)}
.gx-seg label:active span{transform:scale(.97);transition:transform var(--m-press) var(--ease)}
.gx-seg label:has(:focus-visible){outline:2px solid var(--teal);outline-offset:2px}
.gx-seg input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}

/* ---------- the bowls: one route as the page has always drawn it; more routes as gates of five small bowls ----------
   The shelf keeps one height for every choice (three rows of small bowls, or one row of large ones, whichever is taller),
   so nothing under it, the about line or the choice itself, ever moves. Rows stack up from the ruled line (wrap-reverse):
   the first routes stay where they are and more routes are set on top of them. */
.give{--gx-top:var(--g-gap);--gx-in:4px;--gx-gate:28px;--gx-row:12px;--gx-pad:24px;--gx-rows:1;--gx-mini:44px;
  --gx-shelf:max(calc(var(--g-bowl) * .78),calc(var(--gx-rows-max,3) * var(--gx-mini) * .78 + (var(--gx-rows-max,3) - 1) * var(--gx-row)))}
.give .bowls{grid-column:1/-1;position:relative;margin-top:calc(var(--gx-top) + var(--gx-shelf) - var(--g-bowl) * .78)}
.give.many .bowls{flex-wrap:wrap-reverse;justify-content:center;   /* a short last row (nine routes, two gates a row) stands centred */
  row-gap:var(--gx-row);column-gap:var(--gx-in);
  width:calc(var(--gx-gpr) * var(--gx-per) * var(--gx-mini) + (var(--gx-gpr) * var(--gx-per) - 1) * var(--gx-in) + (var(--gx-gpr) - 1) * (var(--gx-gate) - var(--gx-in)) + var(--gx-pad));
  margin-top:calc(var(--gx-top) + var(--gx-shelf) - var(--gx-rows) * var(--gx-mini) * .78 - (var(--gx-rows) - 1) * var(--gx-row))}
.give.many .bowls li{position:relative;width:var(--gx-mini)}
.give.many .bowls li.gs{margin-left:calc(var(--gx-gate) - var(--gx-in))}   /* a route's five bowls stand together, a gate apart from the next */
.give.many .bowls svg{stroke-width:2.2}   /* small bowls keep the line weight of the large ones */
.give.many .bowls .rim{stroke-width:4}
.give.many .bowls .hatch,.give.many .bowls .steam{display:none}   /* too fine to read at this size */
/* a route's bowls are set down together, one route after the next (--m-serve), so nine routes land in about a second */
.give.many .bowls li.on{transition-delay:calc(var(--d,0) * var(--m-serve))}
/* a small bowl is tapped as a whole tile: no dead gap between neighbours (the gap is padding, never a miss) */
.give.many .bowls li::after{content:"";position:absolute;inset:calc(var(--gx-row) / -2) calc(var(--gx-in) / -2)}
.give.many .bowls li.gs::after{left:calc((var(--gx-gate) - var(--gx-in)) / -2)}
/* one route's projection lines tie its meals' cells to its bowls; more routes are not that one cell's share, so they go */
.give.on.many .gproj{opacity:0;transition:opacity var(--m-exit) var(--ease)}
/* bowls no longer counted, lifted out where they stood and put away */
.give .bowls.gx-gone{position:absolute;inset:0;display:block;width:auto;margin:0;padding:0;border:0;pointer-events:none}
.give .bowls.gx-gone li{position:absolute;margin:0}

/* the about line: the count, then the app-store range, each its own line, so the choice under it never moves */
.give .gabout{grid-column:1/-1;max-width:none}   /* on the page's axis, under the bowls it counts */
.gabout span{display:block}
.gabout span:first-child{white-space:nowrap}

@media (max-width:699px){
  .give{--gx-top:8px;--gx-in:2px;--gx-gate:12px;--gx-row:19px;--gx-pad:8px;   /* a row is 44 px of tap target: a bowl's height and the gap, which its ::after spans */
    --gx-mini:calc((100vw - 2 * var(--pad) - var(--gx-pad) - 2 * var(--gx-gate)) / 9);   /* a gate is three bowls wide, three gates across */
    --gx-gridh:calc(3 * (2 * var(--gx-mini) * .78 + 4px) + 2 * var(--gx-row));
    --gx-shelf:max(calc(var(--g-bowl) * .78),var(--gx-gridh))}
  /* every route: nine gates in a 3 x 3 block; each gate three bowls over two, centred. Tracks are half a bowl wide so the
     lower two sit between the upper three; a bowl spans two */
  .give.wide .bowls{display:grid;width:max-content;column-gap:0;row-gap:0;justify-content:center;
    --h:calc(var(--gx-mini) / 2); --m:calc(var(--gx-mini) * .78 + 2px);
    grid-template-columns:repeat(6,var(--h)) var(--gx-gate) repeat(6,var(--h)) var(--gx-gate) repeat(6,var(--h));
    grid-template-rows:var(--m) var(--m) var(--gx-row) var(--m) var(--m) var(--gx-row) var(--m) var(--m);
    margin-top:calc(var(--gx-top) + var(--gx-shelf) - var(--gx-gridh))}
  .give.wide .bowls li{grid-column:calc(var(--gc) * 7 + var(--cs)) / span 2;grid-row:calc(var(--gr) * 3 + var(--rs) + 1);margin:0;padding:0 1px;width:auto}
  .gx{grid-row:8;grid-column:1/-1;flex-direction:column;gap:4px;margin-top:12px}
  .gx-seg label{padding:0 12px;font-size:var(--t-14)}
  .give.many .bowls svg{stroke-width:3}
  .give.many .bowls .rim{stroke-width:5}
  .give.many .bowls .beans{stroke-width:5}
  .give.many .bowls .spoon,.give.many .bowls .spoon-b{display:none}
}
/* the bowl a card is about: filled while its card shows */
.bowls li.hot .body,.bowls li.hot .food,.bowls li.hot .rim{fill:var(--impact)}
.bowls li.hot .beans{stroke:var(--paper)}
