/* The crop box (crop-box.js). Only the page's colour tokens come from
   style.css; everything else the component draws is styled here. */

.crop-box {
  padding-top: 2px;
}

/* The stage takes the video's own shape (set inline from its real size), so
   a percentage on the box is a fraction of the frame and nothing else. */
.crop-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.crop-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Everything outside the box is dimmed by the box's own shadow: one element,
   and the dimmed area is always exactly the part the crop throws away. */
.crop-selection {
  position: absolute;
  box-sizing: border-box;
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 0 9999px rgb(0 0 0 / 55%);
  cursor: move;
}
.crop-selection:focus {
  outline: none;
}
.crop-selection:focus-visible {
  border-color: var(--text);
}

.crop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px;
  border: 2px solid var(--accent);
  border-radius: 3px;
  background: var(--text);
}
.crop-handle-nw {
  left: 0;
  top: 0;
  cursor: nwse-resize;
}
.crop-handle-ne {
  right: 0;
  top: 0;
  cursor: nesw-resize;
}
.crop-handle-sw {
  left: 0;
  bottom: 0;
  cursor: nesw-resize;
}
.crop-handle-se {
  right: 0;
  bottom: 0;
  cursor: nwse-resize;
}

.crop-box.is-disabled .crop-stage {
  cursor: default;
}

.crop-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.crop-aspect {
  flex: 1;
}

.crop-readout {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
