@import url("/brand/tokens.css") layer(palette);
/**
 * Copy edit: the toolbar and the editable-block outline.
 *
 * The component from `monterosa-components/copy-edit` ships no CSS on purpose,
 * so each consuming project styles it in its own language. This is Fantenna's,
 * built on the one Fantenna palette (FANTENNA-1818): every colour names a token.
 * The public copy loads `/brand/tokens.css` first, as a low-priority layer, so
 * it reads correctly on a page that has no tokens of its own (the blog) while a
 * marketing page's own values still win where they overlap.
 *
 * Nothing here renders until the shortcut is pressed: the bar is created on
 * demand and removed on exit.
 */

.copyedit-bar {
  position: fixed;
  z-index: 2147483000; /* above every overlay the pages themselves use */
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 24px);
  padding: 10px 14px;
  border: 1px solid var(--ink-3);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif);
  font-size: 17px; /* the house minimum for readable text */
  line-height: 1.3;
  box-shadow: 0 8px 28px var(--shadow-lift);
}

.copyedit-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--coral);
  flex: 0 0 auto;
}

.copyedit-bar strong { font-weight: 700; white-space: nowrap; }

.copyedit-status {
  color: var(--ink-2);
  /* Wide enough that the common message ("160 blocks editable") sits on one
     line, and fixed so the buttons do not jump under the pointer when the
     status changes. The clipboard-refused message is longer and wraps, which is
     the right trade: it is rare and it needs to be read. */
  min-width: 17ch;
}

.copyedit-bar button {
  font: inherit;
  white-space: nowrap; /* "Copy changes" wrapped to two lines and squashed
                          "Done" next to it at 1429px */
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid var(--ink-3);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.copyedit-bar button:first-of-type {
  border-color: var(--coral);
  background: var(--coral-fill);
  color: var(--on-coral);
}

.copyedit-bar button:hover { filter: brightness(0.95); }

.copyedit-bar button:focus-visible {
  outline: 2px solid var(--coral-ink);
  outline-offset: 2px;
}

.copyedit-hint {
  color: var(--ink-3);
  white-space: nowrap;
  font-size: 15px; /* UI chrome, so below the 17px body minimum is fine */
}

/* Show what is editable. Without this a reader presses the shortcut, sees
   nothing change, and concludes it did not work. */
.copyedit-target {
  outline: 1px dashed var(--coral);
  outline-offset: 3px;
  border-radius: 2px;
}

.copyedit-target:focus {
  outline: 2px solid var(--coral);
  background: var(--coral-tint);
}

/* The clipboard fallback: on the page so it can be selected, out of the way so
   it does not shift the layout. */
.copyedit-fallback {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}

@media (max-width: 640px) {
  .copyedit-bar { flex-wrap: wrap; justify-content: center; }
  .copyedit-hint { display: none; } /* no keyboard to press it with */
}

@media (prefers-reduced-motion: reduce) {
  .copyedit-bar button:hover { filter: none; }
}
