/* Photo Enhancer — the parts the shared media stylesheet does not already cover.
 *
 * Kept to the family's own pieces so this page cannot drift away from the other
 * image tools: same panel, same buttons, same drop zone. Only what is new here is
 * defined — the stacked before/after frames, the facts line, the progress row.
 */

/*
 * The original and the result share one grid cell rather than being positioned on
 * top of each other. A stacked pair keeps the stage's height derived from the
 * picture that is showing, so switching between them cannot move the page, and a
 * doubled result (same aspect ratio, twice the pixels) lands in exactly the same
 * box.
 */
body.sk-tool-page-body .sk-media-page #sk-photo-stage {
  display: grid;
  grid-template-areas: 'frame';
  align-items: center;
  justify-items: center;
}

body.sk-tool-page-body .sk-media-page #sk-photo-stage > canvas {
  grid-area: frame;
  display: block;
  max-width: 100%;
  height: auto;
}

body.sk-tool-page-body .sk-media-page #sk-photo-stage > canvas[hidden] {
  display: none;
}

body.sk-tool-page-body .sk-media-page #sk-photo-stage > .sk-media-empty {
  grid-area: frame;
}

body.sk-tool-page-body .sk-media-page .sk-photo-facts {
  margin: 10px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--sk26-muted, #5c5750);
}

body.sk-tool-page-body .sk-media-page .sk-photo-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 10px;
  font-size: 0.85rem;
  color: var(--sk26-ink, #111);
}

body.sk-tool-page-body .sk-media-page .sk-photo-progress progress {
  flex: 1 1 180px;
  height: 8px;
  accent-color: var(--sk26-accent, #0007cb);
}

body.sk-tool-page-body .sk-media-page .sk-photo-progress[hidden] {
  display: none;
}

/*
 * The format picker carries a label above its select, which makes it taller than
 * the buttons beside it. Left alone, flex stretches the two buttons to 80px to
 * match the field and the row reads as three unrelated blocks. Bottom-aligning
 * the row keeps all three controls on one line at their own heights.
 */
body.sk-tool-page-body .sk-media-page .sk-media-actions {
  align-items: flex-end;
}

/*
 * The format is a choice beside the download button, not a form field with a label
 * stacked above it: the label made the row taller than its buttons and the whole
 * line read as three unrelated blocks. It keeps the buttons' height so the row has
 * one baseline.
 */
body.sk-tool-page-body .sk-media-page .sk-photo-format {
  flex: 0 0 auto;
}

body.sk-tool-page-body .sk-media-page .sk-photo-format select {
  /* 46 is what the buttons beside it measure at, so the row has one height as
     well as one baseline: the vision pass said "uneven", the boxes said 46 and 44. */
  min-height: 46px;
  padding: 0 12px;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 2px;
  cursor: pointer;
}

@media (max-width: 760px) {
  body.sk-tool-page-body .sk-media-page .sk-photo-format {
    width: 100%;
  }

  body.sk-tool-page-body .sk-media-page .sk-photo-format select {
    width: 100%;
  }
}
