/* Styles for the imagefx drawer (js/tools/imagefx.js). Uses the tokens in style.css. */

.fx-val { font-family: var(--mono); font-size: .85rem; color: var(--ink-2); }
.fx-colour { flex: 0 0 auto; }
.fx-grow { flex: 1 1 200px; min-width: 0; }
.drop.fx-drop { min-height: 110px; }
.drop.fx-drop.small { min-height: 80px; }
.chip.on { border-color: var(--accent); color: var(--ink); background: var(--panel-2); }

/* Result area: the picture scaled to fit, on a chequerboard so transparency shows. */
.fx-checker {
  --c1: color-mix(in srgb, var(--bg-2) 70%, #fff 6%);
  --c2: color-mix(in srgb, var(--bg-2) 80%, #000 12%);
  background-color: var(--c1);
  background-image:
    linear-gradient(45deg, var(--c2) 25%, transparent 25%, transparent 75%, var(--c2) 75%),
    linear-gradient(45deg, var(--c2) 25%, transparent 25%, transparent 75%, var(--c2) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}
.fx-stage {
  display: grid; place-items: center; min-height: 120px; padding: 10px;
  border-radius: 12px; border: 1px solid var(--line); overflow: hidden;
}
.fx-stage:empty { display: none; }
.fx-stage canvas, .fx-stage img {
  display: block; max-width: 100%; max-height: 62vh; width: auto; height: auto; object-fit: contain;
}
.fx-stage.fx-square canvas { max-height: min(62vh, 520px); }

/* Seamless scroll: slides side by side, scrolling inside the card only. */
.fx-strip {
  display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 10px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.fx-slide { margin: 0; flex: 0 0 auto; scroll-snap-align: start; position: relative; }
.fx-slide canvas { display: block; height: 240px; width: auto; border-radius: 6px; border: 1px solid var(--line); }
.fx-slide figcaption {
  position: absolute; top: 6px; left: 6px; font: 700 .8rem var(--mono);
  background: rgba(0, 0, 0, .6); color: #fff; border-radius: 6px; padding: 2px 7px;
}
@media (max-width: 600px) { .fx-slide canvas { height: 170px; } }

/* De-skew editor: the photo with a draggable four-corner frame on top. */
.fx-deskew {
  position: relative; width: 100%; max-width: 900px; margin: 0 auto;
  user-select: none; -webkit-user-select: none;
}
.fx-deskew-img { display: block; width: 100%; height: 100%; border-radius: 8px; }
.fx-quad { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.fx-quad polygon {
  fill: color-mix(in srgb, var(--accent) 14%, transparent); stroke: var(--accent);
  stroke-width: 2; vector-effect: non-scaling-stroke;
}
.fx-handle {
  position: absolute; width: 48px; height: 48px; margin: -24px 0 0 -24px; padding: 0;
  border: 0; background: none; cursor: grab; touch-action: none; border-radius: 50%;
}
.fx-handle::after {
  content: ''; position: absolute; inset: 12px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  border: 3px solid var(--accent); box-shadow: 0 0 0 2px rgba(0, 0, 0, .45);
}
.fx-handle.on, .fx-handle:focus-visible { cursor: grabbing; outline: none; }
.fx-handle.on::after, .fx-handle:focus-visible::after { inset: 6px; background: color-mix(in srgb, var(--accent) 20%, transparent); }

/* Grain close-up: shown pixel for pixel. */
.fx-zoom canvas {
  display: block; max-width: 100%; height: auto; image-rendering: pixelated;
  border-radius: 8px; border: 1px solid var(--line);
}
