/* ------------------------------------------------------------
   contexts, the client decks

   Two pages, /artifacts/astrato and /artifacts/safe-space, are the decks
   as they were delivered: the real
   exported slides, in order, with the argument written around them. They
   use the document vocabulary in site.css and stage.css and add almost
   nothing, because the point of rebuilding them was to stop them being
   somebody else's website.

   What they do need is a rule about how a slide sits on a page.
   ------------------------------------------------------------ */

/* A slide is not an illustration. It is a landscape artefact, usually
   1500 by 880, and .fig img sets width:100% because that is right for a
   screenshot of a product. At a full column that is a little over five
   hundred pixels of one picture, which is fine. The portrait crops here
   are the problem: a slide with its photograph cut off the right-hand
   side, so what is left is a tall column of text, runs to about a
   thousand pixels at the same width and makes the reader stop and sit
   through it.

   So: height is capped and width follows it. At 1440 the cap takes three
   of the thirty figures across the three decks and leaves the rest alone,
   because a landscape slide's natural height at this width is already
   under it. The portrait ones come back to the same visual weight as
   everything else, which is the actual intent: every slide counts the same.

   This comment used to say two thousand pixels rather than one. That
   number was measured while every picture on the site was being laid out
   at the literal height written in its height attribute, which is the bug
   the base img rule in site.css now describes. It was never the real
   shape of a slide. The cap is still worth having at the true numbers,
   which is why it survived the fix, but it is worth having for a smaller
   reason than the one originally written down here. */
.doc .sec .fig img[src*="/plate-"]{
  max-height:min(74vh, 760px);
  width:auto;max-width:100%;
  margin-inline:auto;
}

/* Two plates side by side get less room each, so they are allowed to be
   shorter still rather than setting up a ragged pair. */
.doc .sec .figrow .fig img[src*="/plate-"]{max-height:min(52vh, 520px)}

@media(max-width:760px){
  /* On a phone the cap is counterproductive: the limit on a slide is the
     width of the screen, and shrinking it further to satisfy a height rule
     would make the type inside it unreadable. */
  .doc .sec .fig img[src*="/plate-"],
  .doc .sec .figrow .fig img[src*="/plate-"]{max-height:none;width:100%}
}

@media print{
  .doc .sec .fig img[src*="/plate-"],
  .doc .sec .figrow .fig img[src*="/plate-"]{max-height:none;width:100%}
}

/* --- embedded in a case file ---------------------------------------------

   Each case file embeds its deck in an iframe, under the heading "live
   artifact", which worked when the decks were separate websites: you saw
   the delivered thing inside the page that described it.

   Now that the decks are pages of this workspace, the naive version of
   that is a workspace inside a workspace: a second topbar, a second
   navigator taking a third of an already small frame, a second status bar,
   and a theme switch that only changes the inner page. artifact-frame.js
   has had the same problem since it was written and solves it by saying
   nothing when framed. This is the same move from the other direction: the
   chrome goes and the document stays, which is all the embed was ever
   showing.

   The class is set by a head script rather than this sheet alone, because
   CSS cannot ask whether it is in a frame. */
.in-frame .topbar,
.in-frame .viewhead,
.in-frame .statusbar{display:none}
.in-frame .view{padding-top:0}
/* the skip link only has somewhere to go when there is chrome to skip */
.in-frame .skip{display:none}

/* The navigator is removed differently from the rest of the chrome, and the
   difference is not stylistic.

   display:none on .sidenav, with .shell dropped to a single column, renders
   the frame blank: the document lays out correctly, every ancestor computes
   visible at full height, the hero measures 1,523px at the top of the view,
   and nothing paints. Restoring either the element or the two-column
   template brings it straight back. Chromium, compositing a grid whose
   named-view-transition child has just been taken out of flow inside an
   iframe; it took a bisect to find because every measurement said the page
   was fine.

   Keeping the element in the grid and collapsing its column to zero avoids
   the whole thing. visibility:hidden also takes it out of the tab order and
   out of the accessibility tree, which is what display:none was wanted for
   in the first place, so nothing is lost but the bug. */
.in-frame .sidenav{visibility:hidden}
.in-frame .shell{grid-template-columns:0 1fr;overflow:hidden}
