/* product.css: the page a client opens, drawn in HTML and CSS from the
   app's own parts instead of a screenshot, for both front pages: the
   card, the head that says who sent what, the tiles of a delivery of
   pictures and the list of a delivery of files. Every drawing of it
   stands in a figure whose caption starts "An example".

     AN EXAMPLE: WHAT YOUR CLIENT SEES ...  the caption names the picture
     +----------------------------------+
     | Fjord Studio sent you files      |  .client-head: who sent it,
     | Autumn campaign, product shots   |  the delivery, its size
     | 486 files, 9.3 GB                |
     |                                  |
     | [tile] [tile] [tile] [tile]      |  .rc-grid: 4 x 2, two chosen
     | [tile] [tile] [tile] [tile]      |  (4 x 1 on a phone)
     |----------------------------------|
     | 2 selected, 37 MB  [Download 2]  |  .rc-bar: what is chosen
     +----------------------------------+

     +----------------------------------+
     | Harbour Software sent you files  |  a list (.file-list), as a
     | Acme builds                      |  delivery of files is drawn
     |----------------------------------|
     | [kind] setup-2.4.2.exe [Download]|  .file-row: a kind, the name,
     |        48.3 MB                   |  its size and what the app
     |        This is a program. ...    |  writes under it
     +----------------------------------+

   The hero's card is the one thing on a page that is lifted off the paper
   (the overlay shadow): a page somebody has open. Its square tiles set
   its height, and the words beside it end on the same line (landing.css);
   if the words ever run taller, the card stretches and the room left over
   goes under the title. The smaller examples (.excerpt) lie flat on a
   hairline.

   The class names are the app's (.rc-grid, .rc-cell, .up-tile, .rc-bar),
   the parts the client's page is built from; the bar's button is the
   shared button (button.css), the same one the app draws. In the hero
   each tile is a button: a pointer or the keyboard chooses it,
   aria-pressed is its state, and the bar counts what is chosen
   (choose.js), aloud for a screen reader. Typing our name chooses every
   picture, and the bar counts the whole delivery (main.js). Everywhere
   else the buttons are spans and none is in the tab order: those cards
   are pictures.

   The pictures are small photographs (/media/example-*.jpg), stand-ins
   of a coffee roaster that does not exist. The delivery is 9.3 GB: a new
   account gets 10 GiB of storage, so the hero shows one that fits.

   The kinds of file are drawn with a line, in the ink, with square
   corners: a window for a program, a page with its corner folded for a
   document, a strip of film for a video. A program is told apart by the
   line under it, in words, not by a colour. */

/* --- the card --------------------------------------------------------- */

.example{margin:0;display:flex;flex-direction:column;min-width:0}
.client-page{--btn-ground:var(--surface);flex:1;display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-l);overflow:hidden}
.hero .client-page{box-shadow:var(--shadow-overlay)}
.client-page .btn{cursor:default}
.client-head{padding:var(--space-6) var(--space-5)}
.client-title{font:400 var(--text-4xl)/1.15 var(--font-display);letter-spacing:-.018em;margin-block:var(--space-1h) var(--space-1)}

/* a smaller example: the same head, set smaller */
.excerpt .client-head{padding:var(--space-5) var(--space-5) var(--space-4)}
.excerpt .client-title{font-size:var(--text-2xl);line-height:1.2}

/* --- the tiles of a delivery of pictures ------------------------------ */

/* Two are chosen, so the page shows what choosing looks like; choosing one
   shrinks the picture into its frame and sets the tick. */
.rc-grid{margin-top:auto;padding:0 var(--space-5) var(--space-5);display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--space-3)}
.rc-cell{display:block;min-width:0;padding:0;border:0;border-radius:var(--radius-control);background:none;cursor:pointer}
.up-tile{position:relative;display:block;aspect-ratio:1;border-radius:var(--radius-control);overflow:hidden;background:var(--sunken)}
.up-tile img{display:block;width:100%;height:100%;object-fit:cover;transition:transform var(--dur) var(--ease-out)}
.up-tile::after{content:"";position:absolute;top:var(--space-2);right:var(--space-2);width:20px;height:20px;border-radius:var(--radius-s);opacity:0;transform:scale(.4);transition:opacity var(--dur-fast) var(--ease-out),transform var(--dur) var(--ease-out)}
.rc-cell[aria-pressed=true] .up-tile{background:var(--accent-tint);box-shadow:inset 0 0 0 2px var(--accent)}
.rc-cell[aria-pressed=true] img{transform:scale(.9);border-radius:var(--radius-s)}
.rc-cell[aria-pressed=true] .up-tile::after{opacity:1;transform:none;background:var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.4 2.4 4.6-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat}

/* the download bar: what is chosen, and the way to take it. It is the page's
   footer, so it rests on a hairline, not a shadow of its own. The button is
   the app's own, fold and all; the card is white, so the fold's bite shows
   white. */
.rc-bar{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-4) var(--space-4) var(--space-4) var(--space-5);border-top:1px solid var(--line)}
.rc-bar .btn.rc-download{cursor:default}
.rc-bar-text{flex:1;min-width:0;margin:0;font-size:var(--text-l);line-height:22px;color:var(--ink2)}
.rc-bar-text b{color:var(--ink)}

/* a smaller example's pictures: four, two across, cut to 4:3 from the
   photographs' 3:2 */
.mini-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-2);padding:0 var(--space-5) var(--space-5)}
.mini-grid img{display:block;width:100%;height:auto;aspect-ratio:4 / 3;object-fit:cover;border-radius:var(--radius-control);background:var(--sunken)}

/* --- the list of a delivery of files ---------------------------------- */

.file-list{list-style:none;margin:0;padding:0 var(--space-5);border-top:1px solid var(--line)}
.file-list > li + li{border-top:1px solid var(--line)}
.file-row,.taken-row{display:grid;grid-template-columns:24px minmax(0,1fr) auto;column-gap:var(--space-3);align-items:start;padding-block:var(--space-4)}
.kind{display:block;width:24px;height:24px;fill:none;stroke:var(--ink2);stroke-width:1.5;stroke-linejoin:miter}
.file-name{font:400 var(--text-m)/18px var(--font-mono);overflow-wrap:anywhere}
.file-body .s{margin-top:var(--space-1)}
.file-row .btn{margin-top:-6px}

/* a file's checksum, shortened, with its Copy */
.sum{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--space-1) var(--space-2);margin-top:var(--space-1h)}
.sum code{font:400 var(--text-m)/18px var(--font-mono)}
.copy{font:500 var(--text-m)/18px var(--font-sans);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px;text-decoration-color:var(--line-strong)}

/* the line under a program: a condition in plain words ("Run it only
   if ..."), in quiet ink on sunken paper */
.trust{margin-top:var(--space-2);padding:var(--space-2) var(--space-3);background:var(--sunken);color:var(--ink2);font:400 var(--text-m)/18px var(--font-sans)}

.new{margin-top:var(--space-2)}

/* a day's heading: the date as the app sets it (.rc-day, in
   /app/css/recipient-files.css) */
.day{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--space-1) var(--space-3);padding-block:var(--space-3)}
.day-date{font:500 var(--text-label)/16px var(--font-sans);letter-spacing:.06em;text-transform:uppercase;color:var(--mute)}

/* --- narrower screens ------------------------------------------------- */

/* One column, from 1024 px down: no wider than a tablet's page (at
   1024 px a full-width card would be 900 px tall). A smaller example is
   wide there, so its pictures go four across. */
@media (max-width:1024px){
  .hero .product{max-width:760px}
  .mini-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}

/* On a phone the card stays short, so the form is close under it: one row
   of four tiles (still far over 44 px a side for a thumb). The four after
   them are not chosen at load, and choose.js lets go of one that was
   chosen on a wider screen, so the count stays right. A
   row's button moves under its words, so the name keeps the width it
   needs. */
@media (max-width:520px){
  .client-head,.excerpt .client-head{padding:var(--space-4) var(--space-4) var(--space-4)}
  .rc-grid{padding:0 var(--space-4) var(--space-4);gap:var(--space-2)}
  .rc-cell:nth-child(n+5){display:none}
  .rc-bar{padding-left:var(--space-4)}
  .mini-grid,.file-list{padding-inline:var(--space-4)}
  .mini-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .file-row,.taken-row{grid-template-columns:24px minmax(0,1fr)}
  .file-row .btn{grid-column:2;justify-self:start;margin-top:var(--space-2)}
}
