/* Quick Edit in the page's light style: a light panel and a large photo lie right on the page, like the key
   editor below. Keys and the pill are the same as in the feature stories (story.css). The mechanics and the
   rest of the layout stay in stands.css and js/quickedit.js; this file comes after stands.css. */

/* the panel takes what the photo leaves, so the photo always fills its column */
.ft .qe {
  --qe-pad: clamp(16px, 1.6vw, 20px);
  --qe-h: min(clamp(640px, calc(100svh - 160px), 740px), 70vw);
  --qe-pill: 40px;
  grid-template-columns: minmax(320px, 1fr) minmax(0, calc(var(--qe-h) * 0.75)); column-gap: 28px;
  height: var(--qe-h); border-radius: 0; overflow: visible;
}
.ft .qe-in { gap: 8px; padding: var(--qe-pad); border-radius: 18px; background: #ebebed; color: #17212e;
  box-shadow: 0 0 0 1px #dfe1e4, 0 24px 60px rgba(27, 42, 61, 0.11); }
.ft .qe-out { padding: 0; background: none; }
.ft .qe-frame { border-radius: 18px; }
.ft .qe:not([data-mode="straighten"]) .qe-frame { background: none; } /* no dark hairline at the photo's edge */
.ft .qe-photo { border-radius: 18px; box-shadow: 0 24px 60px rgba(27, 42, 61, 0.18); }

/* the pill stands at the foot of the panel */
.ft .qe-title { display: none; } /* the stand is handed over by Try it yourself in the intro; it has no chip of its own */
.ft .qe-title > span { display: none; }
.ft .qe-play[data-state], .ft .qe-play:not([data-state="playing"]) { gap: 8px; height: var(--qe-pill); margin: 0; padding: 0 16px; background: rgba(23, 33, 46, 0.82); color: #fff; font: 550 14px/1 var(--font); }
.ft .qe-play:not([data-state="playing"]) { padding-left: 13px; }
.ft .qe-play svg { width: 14px; height: 14px; }
@media (hover: hover) and (pointer: fine) {
  .ft .qe-play[data-state="playing"]:hover, .ft .qe-play:not([data-state="playing"]):hover { background: rgba(23, 33, 46, 0.94); }
}

/* modes: one blue, the rest quiet */
.ft .qe-modes { gap: 8px; }
.ft .qe-modes button { --pg-bg: #e1e2e5; border-radius: 9px; background: #e1e2e5; color: #4a5664; }
.ft .qe-modes button[aria-checked="true"] { --pg-bg: #086ed8; background: #086ed8; color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .ft .qe-modes button[aria-checked="false"]:hover { background: #d8dadf; }
}

/* the field for the mouse */
.ft .qe-pad { margin-top: 6px; border-radius: 11px; background: #fff; color: #17212e; }
.ft .qe-pad::after { display: none; }
.ft .qe-axis { opacity: 1; }
.ft .qe-axis i { background: #e3e6ea; }
.ft .qe-coach-do { color: #17212e; letter-spacing: -0.015em; }
.ft .qe-coach-lo, .ft .qe-coach-hi { color: #7b8693; opacity: 1; bottom: 54px; line-height: 16px; } /* under the rail's ends, on one row with Green under the tint rail */
.ft .qe-fake { opacity: 1; }
.ft .qe-fake::before { display: none; }
.ft .qe-note { color: #586473; }
.ft .qe-note b { color: #17212e; }

/* the key, as Click and Shift above; it goes down with the hold */
.ft .qe-coach-do kbd { display: inline-block; min-width: 0; height: auto; margin: 0 0.18em; padding: 0.34em 0.62em 0.38em; border: 1px solid #cdd5de; border-radius: 0.36em;
  background: linear-gradient(#fff, #f4f6f9); box-shadow: 0 2.5px 0 #c2cbd6, 0 4px 8px #1b2a3d14; color: #17212e;
  font: 600 0.86em/1 -apple-system, BlinkMacSystemFont, sans-serif; vertical-align: 0.06em;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background-color 0.22s; }
.ft .qe.is-held .qe-coach-do kbd, .ft .qe.is-hands .qe-coach-do kbd { transform: translateY(2.5px); background: #e9eef5; color: #17212e; box-shadow: 0 0 0 #c2cbd6, 0 1px 2px #1b2a3d14; transition-duration: 0.07s; }
.ft .qe-coach-do kbd::after { display: none; }
.ft .qe-coach-do { max-width: 15em; margin: 0 auto; line-height: 1.7; } /* always two lines */

/* the value on the photo, as the app's black message: grey name, white value */
.ft .qe-hud { gap: 0; align-items: center; padding: 8px 15px; border-radius: 7px; background: rgba(10, 10, 10, 0.88); color: #b9b9b9; font-size: 15px; box-shadow: none; }
.ft .qe-hud-one { display: flex; gap: 18px; align-items: baseline; }
.ft .qe-hud-wb { display: none; gap: 16px; }
.ft .qe[data-mode="wb"] .qe-hud-one { display: none; }
.ft .qe[data-mode="wb"] .qe-hud-wb { display: flex; }
/* white balance as in Lightroom: Temp in kelvin and Tint, each over a small colour scale with a white mark */
/* two columns of one width: the scale fills its column, so the gap between the texts and between the scales is the same */
.ft .qe-wb { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 96px; }
.ft .qe-wb-t { white-space: nowrap; font-size: 14px; font-variant-numeric: tabular-nums; }
.ft .qe-wb-t b { color: #fff; font-weight: 600; }
.ft .qe-wb-bar { position: relative; display: block; width: 100%; height: 4px; border-radius: 2px; }
/* as in the app's banner: the picked slider's scale at full colour and its name bold, the other at 30% */
.ft .qe-wb-bar::before { content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: 0.3; transition: opacity 0.15s ease; }
.ft .qe-wb.is-on .qe-wb-bar::before { opacity: 1; }
.ft .qe-wb-t { font-weight: 400; }
.ft .qe-wb.is-on .qe-wb-t { color: #fff; font-weight: 600; }
.ft .qe-wb-bar.is-temp::before { background: linear-gradient(90deg, rgb(64, 135, 245), rgb(255, 212, 66)); }
.ft .qe-wb-bar.is-tint::before { background: linear-gradient(90deg, rgb(71, 207, 110), rgb(212, 82, 224)); }
.ft .qe-wb-bar b { z-index: 1; position: absolute; top: -3px; left: calc(var(--p, 0.5) * 100% - 1.5px); width: 3px; height: 10px; border-radius: 2px; background: #fff; }

/* the entrance: plays once when it comes into view; without the script or with reduced motion it simply stands there */
/* Quick Edit is the page's key feature, so its intro alone is centred, on the same type scale as the rest (type.css).
   The text runs wide enough for two balanced lines on a laptop, so it reads as one even block, not stairs. */
.qi { margin: -28px 0 0; /* the story above keeps 120px of air under its picture */ text-align: center; scroll-margin-top: 40px; }
.qi + .qe { margin-top: clamp(36px, 4vw, 52px); }
.qi-name { margin: 0; color: #17212e; } /* sizes: type.css */
.qi-name span { display: inline-block; padding: 0 0.06em 0.07em; white-space: nowrap; }
.qi-sub { margin: 10px 0 0; text-wrap: balance; }
.qi-moves { max-width: 840px; margin: 16px auto 0; color: #4a5664; line-height: 1.5; text-wrap: balance; }
.qi-moves > span { display: block; }
.qi-try { margin: 24px 0 0; }
.qi-try .btn { border: 0; font: inherit; font-weight: 600; cursor: pointer; }

@media (prefers-reduced-motion: no-preference) {
  /* everything stands from the start; only the name gets the light running over it once */
  .js .qi.is-lit .qi-name span { background: linear-gradient(100deg, #17212e 0 42%, #086ed8 48%, #7cc0ff 50%, #086ed8 52%, #17212e 58% 100%) 100% 0 / 300% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; opacity: 1; animation: qi-light 1.5s cubic-bezier(0.45, 0, 0.2, 1) both; }
  .js .qi.is-done .qi-name span { background: none; -webkit-text-fill-color: currentColor; opacity: 1; animation: none; } /* plain text again */
}
@keyframes qi-light { from { background-position: 100% 0; } to { background-position: 0 0; } }

@media (max-width: 760px) {
  .ft .qe { display: flex; height: auto; }
  .ft .qe-in { order: 1; padding: var(--qe-pad); }
  .ft .qe-out { order: 2; margin-top: calc(var(--qe-pad) + 16px); padding: 0; }
  .ft .qe-play[data-state] { height: var(--qe-pill); }
  .ft .qe-photo { width: 100%; }
  .ft .qe-pad { min-height: 300px; } /* room for the hint and the note about the first move */
  .qi { margin-top: 12px; }
}

/* White balance on the pad: both sliders until the first move picks one (temperature across, tint upright),
   and a note that says so, in the accent colour so it is seen before the first try. */
.ft .qe-pick { display: none; width: fit-content; margin: 14px auto 0; padding: 5px 12px; border-radius: 999px; background: #e6f0fc; color: #086ed8; font-size: 15px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.ft .qe[data-mode="wb"] .qe-pick, .ft .qe[data-mode="brush"] .qe-pick { display: block; } /* brush: which key does what */
.ft .qe[data-mode="wb"] .qe-pick { transition: background-color 0.2s ease, color 0.2s ease; }
.ft .qe[data-wb="temp"] .qe-pick, .ft .qe[data-wb="tint"] .qe-pick { background: #eef1f4; color: #4a5664; }
.ft .qe.is-switch[data-wb] .qe-pick { background: #e6f0fc; color: #086ed8; } /* a move along the other axis: the rule again, in blue */
/* Temperature on the usual rail across, tint on an upright rail at the right edge. The two meet at the
   corner: the tint rail ends level with the temperature rail, a short gap from its end, so Warmer and Green
   share one row under the corner with room between them. The unpicked rail fades away. */
.ft .qe[data-mode="wb"] .qe-axis i { display: block; transition: opacity 0.3s ease; }
.ft .qe[data-mode="wb"] .qe-axis-h { left: 70px; right: 70px; } /* the same inset on both sides, so the rail stays centred */
.ft .qe[data-mode="wb"] .qe-axis-v { top: 48px; bottom: 76px; }
/* Cooler and Warmer keep their places under the rail whichever slider is picked (an upright pick must not
   move them to Straighten's spots while they fade). */
.ft .qe[data-mode="wb"] .qe-coach-lo { top: auto; right: auto; bottom: 54px; left: 70px; }
.ft .qe[data-mode="wb"] .qe-coach-hi { top: auto; left: auto; bottom: 54px; right: 70px; }
.qe-coach-tu, .qe-coach-td { display: none; position: absolute; right: 31px; transform: translateX(50%); color: #7b8693; font-size: 13px; font-weight: 500; line-height: 16px; }
.qe-coach-tu { top: 26px; }
.qe-coach-td { bottom: 54px; }
.ft .qe[data-mode="wb"] .qe-coach-tu, .ft .qe[data-mode="wb"] .qe-coach-td { display: block; }
.ft .qe[data-mode="wb"] .qe-coach-lo, .ft .qe[data-mode="wb"] .qe-coach-hi,
.ft .qe[data-mode="wb"] .qe-coach-tu, .ft .qe[data-mode="wb"] .qe-coach-td { transition: opacity 0.3s ease; }
.ft .qe[data-mode="wb"][data-axis="x"] .qe-axis-v, .ft .qe[data-mode="wb"][data-axis="x"] .qe-coach-tu, .ft .qe[data-mode="wb"][data-axis="x"] .qe-coach-td,
.ft .qe[data-mode="wb"][data-axis="y"] .qe-axis-h, .ft .qe[data-mode="wb"][data-axis="y"] .qe-coach-lo, .ft .qe[data-mode="wb"][data-axis="y"] .qe-coach-hi { opacity: 0; }

/* Try it yourself hands the stand over: the pad rings twice and the key in the hint shakes */
@media (prefers-reduced-motion: no-preference) {
  .ft .qe.is-called .qe-pad { animation: qe-call 0.9s ease-out 2; }
}
@keyframes qe-call { from { box-shadow: 0 0 0 0 rgba(8, 110, 216, 0.55); } to { box-shadow: 0 0 0 16px rgba(8, 110, 216, 0); } }

/* the brush ring: the dashed inner ring marks where the soft edge starts (hardness, set by js) */
.ft .qe-brush i + i { inset: var(--soft, 22%); }


/* The hardness key in the hint, drawn as printed: ~ over `. ` is the one to press (dark, bold); ~ is small and pale.
   The backtick sits high in its em box, hence its larger offset. */
.ft .qe-coach-do kbd.is-grave { position: relative; width: 1.95em; height: calc(1.72em + 2px); padding: 0; vertical-align: -0.51em; }
.ft .qe-coach-do kbd.is-grave span { position: absolute; left: 0; right: 0; text-align: center; line-height: 1; }
.ft .qe-coach-do kbd.is-grave .g-alt { top: 0.18em; font-size: 0.66em; font-weight: 400; color: #aab2bc; }
.ft .qe-coach-do kbd.is-grave .g-main { top: 0.5em; font-size: 1.7em; font-weight: 700; color: #17212e; }

/* the readout sits close to the photo's top edge; the photo is cropped so the head starts just under it */
.ft .qe-hud { top: 14px; }
@media (max-width: 760px) { .ft .qe-hud { top: 10px; } }

/* For now the stand shows Temp only and brush size only: no Tint readout, no "which key" line */
.ft .qe-hud-wb .qe-wb:nth-child(2) { display: none; }
.ft .qe[data-mode="wb"] .qe-pick, .ft .qe[data-mode="brush"] .qe-pick { display: none; }
/* the keys on the stand are a US English keyboard's */
.qi-layout { margin: 12px 0 0; color: #7b8693; font-size: 14px; line-height: 1.4; }

/* The photo keeps its own compositing layer all the time. Otherwise the browser lifted it onto one while it redrew
   (white balance, exposure) and snapped it to whole pixels, so the picture jumped by a pixel. */
.ft .qe-frame canvas { will-change: transform; }
