/**
 * The photograph picker, and improving a photograph.
 *
 * Its own file because the component is not its own screen. It appears in the
 * interview (one cover photograph) and again on the paid suite (thirty, in
 * order) - and while these rules lived in interview.css, which /suite does not
 * load, the picker rendered on the paid page with no styles at all: one
 * photograph stretched across the whole column, "CoverImproved" as running
 * text where two badges should have been, and the tool row as bare browser
 * buttons. A shared component has to have shared styles.
 */

/* photos */
.drop { border: 1px dashed var(--ink-3); background: var(--paper-2); padding: 3rem 2rem; text-align: center; }
.drop h3 { font-size: 1.5rem; margin: 0 0 .4rem; }
.drop > p { margin: 0 0 1.25rem; color: var(--ink-2); }
.drop .hint { margin: 1rem 0 0; }
.photo-picker.is-over .drop, .photo-picker.is-over .photo-grid { outline: 2px dashed var(--ink); outline-offset: 6px; }

.photo-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.photo-bar .k { color: var(--ink-2); }
.photo-bar .r { display: flex; gap: .6rem; flex-wrap: wrap; }
.photo-bar[hidden] { display: none; }
.photo-legend { margin-top: .9rem; }
.photo-legend[hidden] { display: none; }

.photo-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
.photo-picker.is-full .photo-grid { margin-top: 0; }
.photo { position: relative; aspect-ratio: 1; overflow: hidden; background: #141210; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.is-cover { outline: 3px solid var(--ink); outline-offset: -3px; }
.photo .num {
  position: absolute; left: 8px; top: 8px; padding: 3px 7px; color: #f3ede1;
  background: rgba(20,18,16,.8); font-family: var(--sans); font-size: .7rem; font-variant-numeric: tabular-nums;
}
.photo .cover {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 6px; text-align: center;
  background: var(--ink); color: var(--paper); font-family: var(--sans); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase;
}
.photo .fixed {
  position: absolute; right: 8px; top: 8px; padding: 3px 7px; color: #f3ede1; background: #4f6a52;
  font-family: var(--sans); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
}
/* The tools come up when the tile is pointed at or reached by keyboard. */
.photo .tools { display: none; position: absolute; inset: 0; flex-direction: column; justify-content: space-between; background: rgba(20,18,16,.55); }
.photo:hover .tools, .photo:focus-within .tools, .photo:focus .tools { display: flex; }
.photo .tools .top { display: flex; justify-content: flex-end; }
.photo .tools .top button { background: rgba(20,18,16,.85); color: #f3ede1; border: 0; font: inherit; font-size: 1rem; line-height: 1; padding: .35rem .7rem; cursor: pointer; }
.photo .tools .top button.x { color: #f0b8b0; }
.photo .tools .top button:hover { background: rgba(60,56,50,.95); }
.photo .tools .foot { display: grid; grid-template-columns: 1fr 1fr 1fr; background: rgba(20,18,16,.9); }
.photo .tools .foot.two { grid-template-columns: 1fr 1fr; }
.photo .tools .foot button {
  background: none; border: 0; border-right: 1px solid rgba(243,237,225,.15); color: #f3ede1; cursor: pointer;
  font-family: var(--sans); font-size: .6rem; letter-spacing: .06em; text-transform: uppercase; padding: .6rem .1rem; white-space: nowrap;
}
.photo .tools .foot button:last-child { border-right: 0; }
.photo .tools .foot button:hover { background: rgba(243,237,225,.12); }
.photo[draggable="true"] { cursor: grab; }
.photo.is-dragging { opacity: .35; }
.photo.add {
  display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer;
  background: var(--paper-2); border: 1px dashed var(--ink-3); color: var(--ink-2);
  font-family: var(--sans); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; line-height: 1.6;
}
.photo.add:hover { border-color: var(--ink); color: var(--ink); }

/* One photograph, not thirty: the cover picker fills the width it is given. */
.photo-picker.is-cover .photo-grid { grid-template-columns: minmax(0, 16rem); margin-top: 1rem; }
.photo-picker.is-cover .photo { aspect-ratio: 4 / 5; }
.photo-picker.is-cover .photo .tools .foot button { font-size: .7rem; padding: .8rem .2rem; }
/* On a phone there is no pointer to hover with, so the foot row stays up. */
@media (hover: none) {
  .photo .tools { display: flex; background: none; pointer-events: none; }
  .photo .tools .top { pointer-events: auto; }
  .photo .tools .foot { pointer-events: auto; }
  .photo .cover { display: none; }
}

/* ---------------------------------------------------------------------------
   Improving a photograph.

   Three steps in one panel, above the grid: what will change, how long it has
   been running, and the two versions side by side. It sits above the
   photographs rather than inside a tile because the comparison is the point,
   and a comparison has to be big enough to answer "is that still him".
   --------------------------------------------------------------------------- */
.retouch-panel {
  margin: 1.25rem 0 1.5rem;
  padding: 1.15rem 1.25rem;
  background: var(--paper-2);
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0;
}
.retouch-panel[hidden] { display: none; }
.retouch-panel h3 { font-family: var(--sans); font-size: 1rem; margin: 0 0 .4rem; }
.retouch-panel > .hint { margin: 0 0 1rem; }

.level-set { display: grid; gap: .55rem; margin-bottom: 1.1rem; }
.level {
  display: block; width: 100%; text-align: left; font: inherit; cursor: pointer;
  background: var(--paper); border: 1px solid var(--rule-strong); border-radius: var(--r);
  padding: .7rem .9rem; color: var(--ink);
}
.level:hover { border-color: var(--ink-3); }
.level.is-on { border-color: var(--accent); background: var(--accent-soft); }
.level b { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .15rem; }
.level span { display: block; font-size: .86rem; color: var(--ink-2); line-height: 1.45; }

.retouch-go { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.retouch-go .hint { margin: 0; }

.retouch-working { display: flex; gap: 1.1rem; align-items: flex-start; }
.retouch-working p { margin: 0 0 .4rem; }
.retouch-clock {
  font-variant-numeric: tabular-nums; color: var(--ink-3);
}
.retouch-shot {
  width: 8rem; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 30%;
  border: 1px solid var(--rule); background: var(--paper-3); display: block;
}
/* Something is happening to this picture, and the picture should say so. */
.retouch-shot.is-busy { animation: retouch-pulse 1.6s ease-in-out infinite; }
@keyframes retouch-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .retouch-shot.is-busy { animation: none; opacity: .6; } }

.retouch-compare { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.retouch-compare figure { margin: 0; }
.retouch-compare .retouch-shot { width: 11rem; }
.retouch-compare figcaption {
  font-size: .8rem; color: var(--ink-3); margin-top: .35rem; letter-spacing: .04em;
  text-transform: uppercase;
}
@media (max-width: 34rem) {
  .retouch-working { flex-direction: column; }
  .retouch-compare .retouch-shot { width: 8.5rem; }
}

/* The tile still says, at a glance, which photographs have been worked on. */

/* The three repair levels, folded: the default is named in one line, the
   choice is one click away rather than the first thing on the panel. */
.level-fold { margin-bottom: 1.1rem; }
.level-fold > summary { cursor: pointer; list-style: none; font-size: .95rem; color: var(--ink-2); padding: .2rem 0; }
.level-fold > summary::-webkit-details-marker { display: none; }
.level-fold > summary b { font-weight: 600; color: var(--ink); }
.level-fold > summary span { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.level-fold[open] > summary { margin-bottom: .75rem; }

@media (max-width: 34rem) {
  .photo .tools .foot button { min-height: 2.75rem; font-size: .66rem; letter-spacing: 0; white-space: normal; line-height: 1.2; padding: .6rem .3rem; }
  .photo .tools .top button { min-width: 2.75rem; min-height: 2.75rem; padding: .55rem .8rem; font-size: 1.15rem; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drop { padding: 2rem 1rem; }
  .drop .btn { min-height: 3rem; }
  .level { padding: 1rem 1.1rem; }
}
