/*
 * vector_editor.css — styles for the full-page live-word PDF editor.
 *
 * The background PNG carries the painted glyphs; the `.live-word` spans
 * are transparent hitboxes that become opaque during edit mode. No modal,
 * no popup — the caret lives directly on the page.
 */
:root {
  --ve-edit-color: #0b5cff;
  --ve-edit-outline: #0b5cff;
  --ve-hover-outline: rgba(212, 178, 84, 0.55);
  --ve-caret-color: #d4b254;  /* gold caret matches brand accent */
  --ve-page-gap: 16px;
  --ve-page-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  --ve-unsynced-badge: #f59e0b;
  --ve-ink: #0f172a;
}

.vector-page-stack,
.live-page-stack {
  display: flex;
  flex-direction: column;
  gap: var(--ve-page-gap);
  padding: var(--ve-page-gap) 0;
  align-items: center;
}

.vector-page-wrap {
  position: relative;
  background: #ffffff;
  box-shadow: var(--ve-page-shadow);
  border-radius: 4px;
  overflow: visible;
  transform-origin: top center;
  max-width: 100%;
}

.live-page-bg {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.live-page-caption {
  padding: 6px 0 2px;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.6);
  text-align: center;
}

.live-word-layer {
  font-family: sans-serif;
  pointer-events: auto;
}

.live-word {
  position: absolute;
  color: transparent;
  caret-color: var(--ve-caret-color);
  background: transparent;
  cursor: text;
  user-select: text;
  white-space: pre;
  border-radius: 2px;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  transition: outline-color 90ms ease-out, background-color 90ms ease-out;
  outline: 1px solid transparent;
}

.live-word:hover:not([contenteditable="true"]) {
  outline-color: var(--ve-hover-outline);
  background-color: rgba(212, 178, 84, 0.08);
}

.live-word:focus {
  outline: 1px dashed var(--ve-edit-outline);
  outline-offset: 0;
}

.live-word[contenteditable="true"],
.live-word.live-word-editing {
  color: var(--ve-ink) !important;
  background: #ffffff;
  outline: 1px solid var(--ve-edit-outline);
  z-index: 2;
}

.live-word-unsynced::after {
  content: '\2022';
  color: var(--ve-unsynced-badge);
  margin-left: 2px;
  position: absolute;
  right: -6px;
  top: -2px;
  font-size: 10px;
}

/* Backwards-compatible tokens kept so tests and legacy stylesheets that
 * reference the .vector-text-layer class keep working during transition. */
.vector-text-layer {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

.vector-word {
  user-select: text;
  cursor: text;
}

.vector-word[contenteditable="true"] {
  color: var(--ve-edit-color) !important;
}

@media (prefers-reduced-motion: reduce) {
  .live-word,
  .vector-page-wrap { transition: none; }
}
