/* /android, loaded after home.css so the page shares the home page's palette,
   header, type scale and footer. Only the parts home.css cannot supply live
   here.

   The widget gallery is one of them. home.css's carousel is built around a CSS
   crop (.screenshot-crop / .widget-cutout) tuned to the exact geometry of a
   1320x2868 iPhone capture, and an Android screenshot does not sit the same way
   inside its frame. These are shown whole instead. */

/* Fixed column counts rather than auto-fill. Letting the grid pack as many
   columns as fit gave seven of them on a 1280px screen, at which point a month
   grid is 147px wide and unreadable. Twelve widgets divide evenly by two,
   three and four, and four columns on a desktop leaves each card around 270px
   - enough to read the event titles the widgets are there to show. */
.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px 20px;
  padding: 0;
  margin: 30px 0 0;
  list-style: none;
}
@media (min-width: 640px) { .shot-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 980px) { .shot-grid { grid-template-columns: repeat(4, 1fr); } }
/* Cards no longer share a height - a Today widget is wider than it is tall and
   a Month widget is nearly twice as tall as it is wide - so they hang from the
   top of their row instead of stretching. The gallery is ordered by shape for
   the same reason: the seven tall ones first, then List, then the four wide
   ones, which keeps each row's cards roughly the same height. */
.shot-grid { align-items: start; }
.shot-grid figure { margin: 0; text-align: center; }

/* Each cell crops its capture down to the widget, the way the iPhone gallery
   does, so the grid shows widgets rather than twelve small phones.

   The numbers are per capture and derived, not nudged: the card's bounding box
   is measured in the file (canvas, scanning for rows that are near-white
   across the middle 60%), and `width` is what makes the card fill the frame,
   with left/top placing it. left and width are percentages of the frame's
   width, top of its height - that is how CSS resolves them, which is why top
   cannot be shared between widgets of different heights.

   A frame with no crop class shows its image whole. The placeholders rely on
   that: they are flat colour cut to card proportions already. */
.shot-frame {
  position: relative;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 18px;
  background: #ece9f1;
  filter: drop-shadow(0 15px 15px #4732581c);
}
.shot-frame img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  max-width: none;
  border-radius: 0;
}
/* One rule per capture. Every number is measured, not nudged: the widget
   card's bounding box is found in each file on a canvas - rows that are more
   than a third white give top and bottom, then columns that stay white down
   most of that height give left and right - and the three values are what make
   that box fill the frame, with `aspect-ratio` the card's own.

   The box is then pulled in by 5px on every side, which is the fix for the
   dark fringe that kept showing along a card's edge. It is not the card's
   antialiased edge on its own: the browser downscales these captures by 3x or
   more, and each output pixel is filtered from several source pixels, so
   wallpaper from *outside* the card is averaged into the edge even when the
   crop stops exactly on it. 2px was not enough - rendered against a copy of
   each file with the wallpaper painted white, the frame's edge still differed
   by up to 123/255. At 4px the difference is zero for all twelve captures at
   every column width the grid uses, and 5px is that with a pixel to spare.
   5px of 804 is 0.6% of the card.

   One rule each rather than shared classes: several captures do measure
   identically, but a re-shoot should move exactly one card and never a
   neighbour. Re-deriving is mechanical - measure, inset, substitute. */
.shot-frame.crop-month     { aspect-ratio: 804 / 1396; }
.shot-frame.crop-four      { aspect-ratio: 804 / 1396; }
.shot-frame.crop-timeline  { aspect-ratio: 804 / 1398; }
.shot-frame.crop-upnext    { aspect-ratio: 804 / 1398; }
.shot-frame.crop-two       { aspect-ratio: 803 / 680; }
.shot-frame.crop-three     { aspect-ratio: 803 / 682; }
.shot-frame.crop-agenda    { aspect-ratio: 804 / 681; }
.shot-frame.crop-grid      { aspect-ratio: 804 / 682; }
.shot-frame.crop-list      { aspect-ratio: 592 / 920; }
.shot-frame.crop-today     { aspect-ratio: 804 / 681; }
.shot-frame.crop-one       { aspect-ratio: 803 / 443; }
.shot-frame.crop-mini      { aspect-ratio: 804 / 443; }

.shot-frame.crop-month     img { width: 111.692%; left: -5.846%; top:   -9.670%; }
.shot-frame.crop-four      img { width: 111.692%; left: -5.846%; top:   -9.670%; }
.shot-frame.crop-timeline  img { width: 111.692%; left: -5.846%; top:   -9.657%; }
.shot-frame.crop-upnext    img { width: 111.692%; left: -5.846%; top:   -9.657%; }
.shot-frame.crop-two       img { width: 111.831%; left: -5.978%; top: -125.294%; }
.shot-frame.crop-three     img { width: 111.831%; left: -5.978%; top:  -19.795%; }
.shot-frame.crop-agenda    img { width: 111.692%; left: -5.846%; top: -125.110%; }
.shot-frame.crop-grid      img { width: 111.692%; left: -5.846%; top:  -19.795%; }
.shot-frame.crop-list      img { width: 151.689%; left: -7.939%; top:  -66.630%; }
.shot-frame.crop-today     img { width: 111.692%; left: -5.846%; top: -125.110%; }
.shot-frame.crop-one       img { width: 111.831%; left: -5.978%; top:  -84.424%; }
.shot-frame.crop-mini      img { width: 111.692%; left: -5.846%; top:  -30.474%; }
.shot-grid figcaption {
  margin-top: 14px;
  font-size: 15px;
  font-weight: 550;
  letter-spacing: -.3px;
}
.shot-grid figure p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.difference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 32px;
}
.difference-grid > div {
  border-radius: 22px;
  background: #f1eef6;
  padding: 26px 28px;
}
.difference-grid h3 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 550;
  letter-spacing: -.4px;
}
.difference-grid p { margin: 0; color: #5f5869; font-size: 14px; line-height: 1.65; }
.difference-grid code {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #e4dced;
}

.requirements-note { color: var(--muted); font-size: 13px; }

@media (max-width: 720px) {
  .shot-grid { gap: 22px 14px; }
  .shot-grid figcaption { font-size: 13px; }
  .difference-grid > div { padding: 22px; }
}
