/* The delivery page (js/delivery-detail.js): the hero (cover, title, facts,
   Copy link), the recipient rows and their form, the Advanced options
   disclosure (js/delivery-options.js) and Activity. Loaded by index.html
   after uploads.css and upload-tiles.css. Shared pieces (.panel .cols .stack
   .list .list-row .linkrow .tl .tag .field .hint) are app.css's and
   components.css's; the Files panel is styled in uploads.css and
   upload-tiles.css.

   The hero, wide:
     +-- cover 5:3, 400 ----+   Wedding, 12 September          (serif 40)
     |            |  small  |   Alex, alex@example.com
     |   large    |---------|   FILES    SIZE     LINKS     CREATED
     |            |  small  |   1,860    412 GB   1 active  Today, 14:05
     +----------------------+   [Copy link]

   Recipient row:  [av] name                        [Active]
                        email
                   [ https://theirway.app/r/... ] [Copy]

   Advanced options:  > Advanced options               (closed: one line)
                      v Advanced options               (open)
                        How your client can receive the files
                        [x] Let the client send ... SFTP server
                            The files go from our storage ... */

/* --- the hero --------------------------------------------------------- */

.hero{align-items:center;gap:var(--space-6);margin-bottom:var(--space-7)}
.hero.has-cover{display:grid;grid-template-columns:minmax(0,400px) minmax(0,1fr)}
.hero h1{font-size:var(--text-4xl);overflow-wrap:anywhere}   /* a title is the producer's text: a long word must not push the page sideways */
.hero-cover{display:grid;grid-template-columns:2fr 1fr;grid-template-rows:1fr 1fr;gap:4px;aspect-ratio:5/3;border-radius:var(--radius-l);overflow:hidden;background:var(--sunken)}
.hero-cover img{width:100%;height:100%;object-fit:cover;display:block;min-height:0;animation:fade var(--dur-slow) var(--ease-out)}
.hero-cover img:first-child{grid-row:1 / span 2}
.hero-cover.count-1{grid-template-columns:1fr}
.hero-cover.count-2 img:nth-child(2){grid-row:1 / span 2}
.hero-actions{display:flex;gap:var(--space-3);margin-top:var(--space-5)}
.hero-actions:empty{display:none}

/* The facts: a small label over each value, in a row that wraps. */
.detail-meta{display:flex;flex-wrap:wrap;gap:var(--space-3) var(--space-6);margin:var(--space-5) 0 0}
.fact dt{font:500 var(--text-label)/16px var(--font-sans);letter-spacing:.04em;text-transform:uppercase;color:var(--mute)}
.fact dd{margin:var(--space-1) 0 0;font:400 var(--text-xl)/24px var(--font-display);color:var(--ink)}

/* The cover goes above the title, not beside it, wherever the page has
   less than 1024px: from 821px the sidebar takes 248px, and a 400px cover
   beside the title leaves the title a few letters a line and pushes Copy
   link out of the window. */
@media (max-width:1023px){
 .hero.has-cover{grid-template-columns:minmax(0,1fr);gap:var(--space-5)}
 .hero-cover{aspect-ratio:16/9}
}

@media (max-width:820px){
 .hero{margin-bottom:var(--space-6)}
 .detail-meta{gap:var(--space-3) var(--space-5)}
 .hero-actions .btn{flex:1}
}

/* --- the two columns ---------------------------------------------------- */

/* The right column is wide enough for a link field and its Copy button to
   show 270px of link (at 340px only "https://theirway.app/..." shows)
   inside a panel's 24px of padding on each side. The price: the Files
   panel shows three tile columns at 1360px, four only from 1440px.

   Below 1024px the columns stack: the list, then the side column. Beside
   each other they would leave the Files panel 83px at 821px (the sidebar,
   248px, is back from 821px, and the side column keeps 320px) and under
   320px all the way to 1023px; stacked it is at least 427px. The phone
   (components.css, up to 820px) stacks them the same way. */
.delivery-cols{grid-template-columns:minmax(0,1fr)}

@media (min-width:1024px){
  .delivery-cols{grid-template-columns:minmax(0,1fr) clamp(320px,31vw,416px);column-gap:var(--space-5)}
}

/* --- recipients ------------------------------------------------------ */

.recipients{margin-block:0;padding:0;list-style:none}
.recipients .list-row{align-items:start}
.recipient-row .linkrow .text{height:var(--control-s)}

/* The form is its own part of the panel: a sunken foot below the rows. */
.recipient-form{margin:var(--space-4) calc(-1 * var(--panel-pad)) calc(-1 * var(--panel-pad));padding:var(--space-4) var(--panel-pad) var(--panel-pad);border-top:1px solid var(--line2);background:var(--bg);border-radius:0 0 var(--radius-l) var(--radius-l)}
.recipient-form .btn{margin-top:var(--space-4)}
/* "No links yet." sits in the links' own slot (.link-rows), beside the form. */
.panel > .empty.inline, .link-rows > .empty.inline{margin-bottom:var(--space-2)}

/* --- a delivery nobody else has a link to (js/delivery-incoming.js) ---- */

/* Under the client's name: the Incoming tag, then the fact in words. */
.incoming-line{margin:var(--space-2) 0 0;color:var(--ink2)}
.incoming-line .tag{margin-right:var(--space-1)}
/* The line that says a read found the delivery the other way; empty, it
   takes no room. */
.other-way-line{margin:var(--space-2) 0 0}
.other-way-line:empty{margin:0}

/* Send this delivery, in Recipients' place: a sentence, the held files with
   their one button (wrapping under the words on a phone, as the request
   panel's do), revoked links' rows, Make a link, and the link form once it
   is asked for. */
.send-delivery > .s{margin:0}
.send-held{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);flex-wrap:wrap;margin:var(--space-3) 0 0}
.send-held > span{min-width:0;overflow-wrap:anywhere}
.send-delivery .recipients{margin-top:var(--space-3)}
.send-delivery [data-a=send-make-link]{margin-top:var(--space-4)}
/* A small button is a small target; a finger gets the full control height. */
@media (pointer:coarse),(max-width:820px){
 .send-held .btn.sm{min-height:var(--control-l)}
}

/* --- activity, on the paper --------------------------------------------- */

.activity{padding:0 var(--space-1)}
.activity h2{font-size:var(--text-l);line-height:22px;font-family:var(--font-sans);font-weight:500;margin-bottom:var(--space-3)}

/* --- advanced options -------------------------------------------------- */

/* A <details> that is a .panel. The summary holds an h2, so the heading
   is the app's own heading style (app.css) and follows it when that
   changes. The browser's triangle is replaced by a chevron at the right
   edge that turns over when the panel opens (120ms, transform only): it
   is what tells the eye that this opens, and the summary element still
   tells a screen reader. Closed, the panel has no content gap; open, the
   groups below start a step under the summary. */
.options > summary{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);list-style:none;cursor:pointer;border-radius:var(--radius-s)}
.options > summary::-webkit-details-marker{display:none}
.options > summary::after{content:"";flex:none;width:var(--icon-m);height:var(--icon-m);background:var(--mute);transition:transform var(--dur-fast) var(--ease-out),background-color var(--dur-fast) var(--ease-out);-webkit-mask:var(--chevron) center/contain no-repeat;mask:var(--chevron) center/contain no-repeat}
.options > summary:hover::after{background:var(--ink)}
.options[open] > summary::after{transform:rotate(180deg)}
.options[open] > summary{margin-bottom:var(--space-4)}

/* The help line sits under its label, in line with the label's text (the
   box is 18px wide and .check puts --space-3 after it). */
.option{padding-bottom:var(--space-1)}
.option-help{display:block;margin-left:calc(18px + var(--space-3))}

/* The boxes are switched off while a change is being saved; the label
   dims a little so that reads as "working", not "broken". */
.options[aria-busy=true] .option{opacity:.6}
