/* =========================================================
   Said So: the crop view (crop.ts), and the way back into it under the visitor's photo. After style.css, whose
   colours and fonts it uses.
   ========================================================= */

/* under the visitor's own photo: "Crop photo", the button back to the crop view, or while it's open, how it works */
.photo-crop__hint {
  display: none;
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--grey);
}
.photo-crop.is-cropping .photo-crop__again {
  display: none;
}
.photo-crop.is-cropping .photo-crop__hint {
  display: block;
}

/* the crop view, in place of the preview: the design flat with the rest of the photo faint round it, a handle on the
   photo, − and + at its bottom right, and "Save" under it */
.stage-wrap.is-cropping > .stage,
.stage-wrap.is-cropping > .mug-viewer {
  display: none;
}
.cropper {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: 2.4rem 1.6rem 2rem;
}
.cropper[hidden] {
  display: none;
}
.spread .cropper {
  padding-bottom: 6rem;
} /* the bail and the roller, as under the preview */
.cropper__title {
  margin: 0;
  font-family: var(--font-text);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #8c8c8c;
}
.cropper__frame {
  position: relative;
  line-height: 0;
  cursor: grab;
  touch-action: none; /* the finger drags the photo, never the page */
  user-select: none;
}
.cropper__frame.is-dragging {
  cursor: grabbing;
}
.cropper__frame:focus-visible {
  outline: 2px dashed var(--ink);
  outline-offset: 4px;
}
.cropper__frame canvas {
  display: block;
  max-width: 100%;
  max-height: 62vh;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.12));
}
.cropper__handle {
  position: absolute;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: rgba(15, 15, 15, 0.55); /* the ink, see-through: it says "drag me" without hiding what's under it */
  color: var(--paper);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  transition:
    opacity 0.25s,
    scale 0.25s var(--ease);
}
/* once the photo moves (a drag, a zoom, a key), the handle has said its piece and steps aside for good: the middle of
   the photo is usually the face being placed */
.cropper__frame.is-dragging .cropper__handle,
.cropper__frame.is-moved .cropper__handle {
  opacity: 0;
  scale: 0.8;
}
.cropper__bar {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}
.cropper__zoom {
  display: flex;
  gap: 0.45rem;
}
.cropper__zoom button {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-text);
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}
.cropper__zoom button:disabled {
  opacity: 0.35;
  cursor: default;
}
.cropper__zoom button:focus-visible {
  outline: 2px dashed var(--ink);
  outline-offset: 2px;
}
