/* photo-editor.css — the photo editor (js/ui/photo-editor.js) and its small Edit buttons. */

.photo-editor { z-index: 1700; padding-top: 16px; }

.photo-editor__panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(820px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.photo-editor__stage {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  padding: 12px;
  background: #1d1d1f;
  border-radius: 6px;
}

.photo-editor__frame {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.photo-editor__canvas {
  max-width: 100%;
  max-height: min(56vh, 520px);
  width: auto;
  height: auto;
}

.photo-editor__crop {
  position: absolute;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  outline: 2px solid #fff;
  cursor: move;
  touch-action: none;
  background-image:
    linear-gradient(to right, transparent 33%, rgba(255,255,255,.35) 33%, rgba(255,255,255,.35) calc(33% + 1px), transparent calc(33% + 1px), transparent 66%, rgba(255,255,255,.35) 66%, rgba(255,255,255,.35) calc(66% + 1px), transparent calc(66% + 1px)),
    linear-gradient(to bottom, transparent 33%, rgba(255,255,255,.35) 33%, rgba(255,255,255,.35) calc(33% + 1px), transparent calc(33% + 1px), transparent 66%, rgba(255,255,255,.35) 66%, rgba(255,255,255,.35) calc(66% + 1px), transparent calc(66% + 1px));
}
.photo-editor__frame { overflow: hidden; }

.photo-editor__handle {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  touch-action: none;
}
.photo-editor__handle--nw { top: -3px; left: -3px; border-right: 0; border-bottom: 0; cursor: nwse-resize; }
.photo-editor__handle--ne { top: -3px; right: -3px; border-left: 0; border-bottom: 0; cursor: nesw-resize; }
.photo-editor__handle--sw { bottom: -3px; left: -3px; border-right: 0; border-top: 0; cursor: nesw-resize; }
.photo-editor__handle--se { bottom: -3px; right: -3px; border-left: 0; border-top: 0; cursor: nwse-resize; }

.photo-editor__tabs { align-self: center; }

.photo-editor__filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.photo-editor__filter {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.photo-editor__filter.is-on { border-color: var(--color-accent); }

.photo-editor__filter-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
}

.photo-editor__sliders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 18px;
}

.photo-editor__slider {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}
.photo-editor__slider--inline { flex: 1 1 220px; }

.photo-editor__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.photo-editor__ratio.is-on { background: var(--color-accent); color: var(--color-on-accent, #fff); border-color: var(--color-accent); }

.photo-editor__actions { display: flex; align-items: center; gap: 8px; }
.photo-editor__spacer { flex: 1; }

@media (max-width: 600px) {
  .photo-editor .sub-viewer__panel { padding: 12px; }
  .photo-editor__canvas { max-height: 44vh; }
  .photo-editor__sliders { grid-template-columns: 1fr; }
}

/* The small pencil on a thumbnail. */
.photo-edit-button {
  position: absolute;
  top: 2px;
  left: 2px;
  display: flex;
  padding: 4px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
}

.vault-file__edit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 6px 0 10px;
}
