/*
 * The client's delivery page. Bootstrap does the layout (grid, buttons, sticky headings);
 * this is what Bootstrap does not have: square photo tiles, the tick in a photo's corner,
 * and the bar fixed to the bottom of the screen.
 */

/* The batch heading sticks to the top of the screen, under the page's own content */
body.delivery .batch-head { z-index: 3; }

/* Photo tiles */
body.delivery .media:has(input:checked) { outline: 3px solid var(--mom-accent); outline-offset: -3px; }
body.delivery .media img,
body.delivery .media video {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bs-tertiary-bg);
}
body.delivery .media > a { display: block; cursor: zoom-in; }

/* The tick in a photo's corner. The whole corner is the tap target. */
body.delivery .pick {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: flex;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.35rem;
  cursor: pointer;
}
body.delivery .pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
body.delivery .pick-mark {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}
body.delivery .pick input:checked + .pick-mark { background: var(--mom-accent); }
body.delivery .pick input:checked + .pick-mark::after {
  content: "";
  display: block;
  width: 0.35rem;
  height: 0.7rem;
  margin: 0.1rem auto 0;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
body.delivery .pick input:focus-visible + .pick-mark { outline: 3px solid var(--mom-accent); outline-offset: 2px; }

/* A video's own controls (play, fullscreen, volume) fill the whole tile, so its tick sits in a row
   under the player instead of over the corner. position: relative keeps the invisible input inside
   that row rather than stretching over the player. */
body.delivery .media-video .pick {
  position: relative;
  width: auto;
  height: auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--bs-border-color);
}
body.delivery .media-video .pick-mark { border-color: #6c757d; background: #fff; box-shadow: none; }
body.delivery .media-video .pick input:checked + .pick-mark { border-color: var(--mom-accent); background: var(--mom-accent); }
body.delivery .pick-text { color: #212529; }
/* The clip's file name, wrapped rather than cut off: long names are the useful ones. */
body.delivery .video-name {
  padding: 0.5rem 0.75rem;
  overflow-wrap: anywhere;
}

/* Keeps the bar clear of the home indicator on an iPhone; Bootstrap's z-index sits under PhotoSwipe's */
body.delivery .dock { padding-bottom: calc(0.5rem + env(safe-area-inset-bottom)); z-index: 1030; }
